Package org.eclipse.ui

Examples of org.eclipse.ui.IPersistableElement.saveState()


            IPersistableElement element = editorInputData.input
                    .getPersistable();
            if (element != null) {
                //get the IEditorInput to save its state
                element.saveState(memento);

                //convert memento to String
                StringWriter writer = new StringWriter();
                memento.save(writer);
                writer.close();
View Full Code Here


            IPersistableElement persistable = (IWorkingSet) i.next();
            IMemento workingSetMemento = memento
                    .createChild(IWorkbenchConstants.TAG_WORKING_SET);
            workingSetMemento.putString(IWorkbenchConstants.TAG_FACTORY_ID,
                    persistable.getFactoryId());
            persistable.saveState(workingSetMemento);
        }
  }
   
    /**
     * Recreates all working sets from the persistence store
View Full Code Here

            memento = XMLMemento
                    .createWriteRoot(IWorkbenchConstants.TAG_EDITOR);
            memento.putString(IWorkbenchConstants.TAG_ID, editorID);
            memento.putString(IWorkbenchConstants.TAG_FACTORY_ID, persistable
                    .getFactoryId());
            persistable.saveState(memento);
        }
        editorID = null;
        editorInput = null;
    }
View Full Code Here

        if (editorInput != null) {
            IPersistableElement persistable = editorInput.getPersistable();
            mem.putString(IWorkbenchConstants.TAG_ID, editorID);
            mem.putString(IWorkbenchConstants.TAG_FACTORY_ID, persistable
                    .getFactoryId());
            persistable.saveState(mem);
        } else if (memento != null) {
            mem.putMemento(memento);
        }
    }
}
View Full Code Here

          IMemento itemMemento = memento
              .createChild(IWorkbenchConstants.TAG_ITEM);

          itemMemento.putString(IWorkbenchConstants.TAG_FACTORY_ID,
              persistable.getFactoryId());
          persistable.saveState(itemMemento);
        }
      }
    }
  }
View Full Code Here

        // Save input.
        IMemento inputMem = editorMem
            .createChild(IWorkbenchConstants.TAG_INPUT);
        inputMem.putString(IWorkbenchConstants.TAG_FACTORY_ID,
            persistable.getFactoryId());
        persistable.saveState(inputMem);
       
        // any editors that want to persist state
        if (editor instanceof IPersistableEditor) {
          IMemento editorState = editorMem
              .createChild(IWorkbenchConstants.TAG_EDITOR_STATE);
View Full Code Here

          // Save input.
          IMemento inputMem = pageMem
              .createChild(IWorkbenchConstants.TAG_INPUT);
          inputMem.putString(IWorkbenchConstants.TAG_FACTORY_ID,
              persistable.getFactoryId());
          persistable.saveState(inputMem);
        }
      }
    }

    return result;
View Full Code Here

          // Save input.
          IMemento inputMem = pageMem
              .createChild(IWorkbenchConstants.TAG_INPUT);
          inputMem.putString(IWorkbenchConstants.TAG_FACTORY_ID,
              persistable.getFactoryId());
          persistable.saveState(inputMem);
        }
      }
    }

    // Save window advisor state.
View Full Code Here

                 * since it could potentially use a tag already used in the parent
                 * memento and thus overwrite data.
                 */
                IMemento persistableMemento = memento
                        .createChild(IWorkbenchConstants.TAG_PERSISTABLE);
                persistable.saveState(persistableMemento);
                memento.putString(IWorkbenchConstants.TAG_FACTORY_ID,
                        persistable.getFactoryId());
                if (descriptor != null && descriptor.getId() != null) {
                    memento.putString(IWorkbenchConstants.TAG_ID, descriptor
                            .getId());
View Full Code Here

        // Save input.
        IMemento inputMem = memento
            .createChild(IWorkbenchConstants.TAG_INPUT);
        inputMem.putString(IWorkbenchConstants.TAG_FACTORY_ID,
            persistable.getFactoryId());
        persistable.saveState(inputMem);
      } catch (PartInitException e) {
        new Status(IStatus.ERROR, "de.sebastianbenz.task.application",
            "Exception while saving editors", e);
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.