Examples of IMemento


Examples of org.eclipse.ui.IMemento

     * Saves the state of this entry and its location.
     */
    void saveState(IMemento mem, ArrayList entries) {
        mem.putString(IWorkbenchConstants.TAG_HISTORY_LABEL, getHistoryText());
        if (locationMemento != null) {
            IMemento childMem = mem
                    .createChild(IWorkbenchConstants.TAG_POSITION);
            childMem.putMemento(locationMemento);
        } else if (location != null) {
            IMemento childMem = mem
                    .createChild(IWorkbenchConstants.TAG_POSITION);
            location.saveState(childMem);
        }
    }
View Full Code Here

Examples of org.eclipse.ui.IMemento

      }

      IMemento[] mementoElements = historyMemento
          .getChildren(infoNodeName);
      for (int i = 0; i < mementoElements.length; ++i) {
        IMemento mementoElement = mementoElements[i];
        Object object = restoreItemFromMemento(mementoElement);
        if (object != null) {
          historyList.add(object);
        }
      }
View Full Code Here

Examples of org.eclipse.ui.IMemento

     * @param memento
     *            memento to which the history will be added
     */
    public void save(IMemento memento) {

      IMemento historyMemento = memento.createChild(rootNodeName);

      Object[] items = getHistoryItems();
      for (int i = 0; i < items.length; i++) {
        Object item = items[i];
        IMemento elementMemento = historyMemento
            .createChild(infoNodeName);
        storeItemToMemento(item, elementMemento);
      }

    }
View Full Code Here

Examples of org.eclipse.ui.IMemento

    public IStatus saveState(IMemento memento) {
        Iterator iterator = fifoList.iterator();
        while (iterator.hasNext()) {
            EditorHistoryItem item = (EditorHistoryItem) iterator.next();
            if (item.canSave()) {
                IMemento itemMemento = memento
                        .createChild(IWorkbenchConstants.TAG_FILE);
                item.saveState(itemMemento);
            }
        }
        return new Status(IStatus.OK, PlatformUI.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
View Full Code Here

Examples of org.eclipse.ui.IMemento

    IMemento[] workingSetReferences = workingSetMemento
        .getChildren(IWorkbenchConstants.TAG_WORKING_SET);
    ArrayList list = new ArrayList(workingSetReferences.length);

    for (int i = 0; i < workingSetReferences.length; i++) {
      IMemento setReference = workingSetReferences[i];
      String setId = setReference.getID();
      IWorkingSet set = manager.getWorkingSet(setId);
      if (set != null) {
        list.add(set);
      }
    }
View Full Code Here

Examples of org.eclipse.ui.IMemento

    details.setVisible(toggleStatusLine);

    String setting = settings.get(HISTORY_SETTINGS);
    if (setting != null) {
      try {
        IMemento memento = XMLMemento.createReadRoot(new StringReader(
            setting));
        this.contentProvider.loadHistory(memento);
      } catch (WorkbenchException e) {
        // Simply don't restore the settings
        StatusManager
View Full Code Here

Examples of org.eclipse.ui.IMemento

     * Method to save the width of the perspective bar in the
     * @param persBarMem
     */
    public void saveState(IMemento persBarMem) {
        // save the width of the perspective bar
        IMemento childMem = persBarMem
                .createChild(IWorkbenchConstants.TAG_ITEM_SIZE);

        int x;
        if (currentLocation == TOP_RIGHT && topBar != null) {
      x = topBar.getRightWidth();
    } else {
      x = getDefaultWidth();
    }

        childMem.putString(IWorkbenchConstants.TAG_X, Integer.toString(x));
    }
View Full Code Here

Examples of org.eclipse.ui.IMemento

    public void restoreState(IMemento memento) {
        if (memento == null) {
      return;
    }
        // restore the width of the perspective bar
        IMemento attributes = memento
                .getChild(IWorkbenchConstants.TAG_PERSPECTIVE_BAR);
        IMemento size = null;
        if (attributes != null) {
      size = attributes.getChild(IWorkbenchConstants.TAG_ITEM_SIZE);
    }
        if (size != null && currentLocation == TOP_RIGHT && topBar != null) {
            final Integer x = size.getInteger(IWorkbenchConstants.TAG_X);
            StartupThreading.runWithoutExceptions(new StartupRunnable() {

        public void runWithException() {
          if (x != null) {
            topBar.setRightWidth(x.intValue());
View Full Code Here

Examples of org.eclipse.ui.IMemento

    if (preferences != null) {
      final IMemento[] preferenceMementos = preferences
          .getChildren(TAG_ACTIVE_KEY_CONFIGURATION);
      int preferenceMementoCount = preferenceMementos.length;
      for (int i = preferenceMementoCount - 1; i >= 0; i--) {
        final IMemento memento = preferenceMementos[i];
        String id = memento.getString(ATT_KEY_CONFIGURATION_ID);
        if (id != null) {
          try {
            bindingManager.setActiveScheme(bindingManager
                .getScheme(id));
            return;
View Full Code Here

Examples of org.eclipse.ui.IMemento

    if (preferences != null) {
      final IMemento[] preferenceMementos = preferences
          .getChildren(TAG_KEY_BINDING);
      int preferenceMementoCount = preferenceMementos.length;
      for (int i = preferenceMementoCount - 1; i >= 0; i--) {
        final IMemento memento = preferenceMementos[i];

        // Read out the command id.
        String commandId = readOptional(memento, ATT_COMMAND_ID);
        if (commandId == null) {
          commandId = readOptional(memento, ATT_COMMAND);
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.