Examples of IPersistableElement


Examples of org.eclipse.ui.IPersistableElement

    boolean restore = preferences.getBoolean(DefaultPreferences.REOPEN_BROWSER_TABS);
    if (!restore)
      return null;

    return new IPersistableElement() {
      public String getFactoryId() {
        return FACTORY_ID;
      }

      public void saveState(IMemento memento) {
View Full Code Here

Examples of org.eclipse.ui.IPersistableElement

        .getEditorReferences();
    for (IEditorReference editor : editorReferences) {
      IEditorInput input;
      try {
        input = editor.getEditorInput();
        IPersistableElement persistable = input.getPersistable();
        // 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

Examples of org.eclipse.ui.IPersistableElement

      }

      for (Map.Entry<IAspectDefinition, List<IAopReference>> entry : maps.entrySet()) {
        IMemento definitionM = appendNewChild(projectM, ASPECT_DEFINITION_ELEMENT);
        if (entry.getKey() instanceof IAdaptable) {
          IPersistableElement pers = (IPersistableElement) ((IAdaptable) entry.getKey())
              .getAdapter(IPersistableElement.class);
          if (pers != null) {
            pers.saveState(definitionM);
            definitionM.putString(FACTORY_ID, pers.getFactoryId());
          }
          for (IAopReference ref : entry.getValue()) {
            if (ref instanceof IAdaptable) {
              IPersistableElement pers2 = (IPersistableElement) ((IAdaptable) ref)
                  .getAdapter(IPersistableElement.class);
              if (pers2 != null) {
                IMemento refM = appendNewChild(definitionM, AOP_REFERENCE_ELEMENT);
                pers2.saveState(refM);
                refM.putString(FACTORY_ID, pers2.getFactoryId());
              }
            }
          }
        }
      }
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.