Package org.eclipse.ui

Examples of org.eclipse.ui.IMemento


        super.restoreDialog(settings);

        final String setting = settings.get(WORKINGS_SET_SETTINGS);
        if (setting != null) {
            try {
                final IMemento memento = XMLMemento.createReadRoot(new StringReader(
                        setting));
                workingSetFilterActionGroup.restoreState(memento);
            } catch (final WorkbenchException e) {
                StatusManager.getManager().handle(
                        new Status(IStatus.ERROR, ErlideUIPlugin.PLUGIN_ID,
View Full Code Here


    @Override
    public void saveState(final IMemento aMemento) {
        if (exprs.isEmpty()) {
            return;
        }
        final IMemento aMemento2 = aMemento.createChild("LiveExpressions");
        final Iterator<LiveExpr> iter = exprs.iterator();
        while (iter.hasNext()) {
            aMemento2.createChild("expression").putTextData(iter.next().toString());
        }
    }
View Full Code Here

    public Integer getZoomLevel() {
        return zoomLevel;
    }
   
    public void save(boolean selectionAutomatic, int zoomLevel) {
        IMemento memento = (IMemento) blackboard.get(WMTLayerStyleContent.EXTENSION_ID);
        if(memento == null ){
            memento = XMLMemento.createWriteRoot("WMTLayer"); //$NON-NLS-1$
        }
       
        memento.putBoolean(WMTService.KEY_PROPERTY_ZOOM_LEVEL_SELECTION_AUTOMATIC, selectionAutomatic);
        memento.putInteger(WMTService.KEY_PROPERTY_ZOOM_LEVEL_VALUE, zoomLevel);

        blackboard.put(WMTLayerStyleContent.EXTENSION_ID, memento);
    }
View Full Code Here

        blackboard.put(WMTLayerStyleContent.EXTENSION_ID, memento);
    }
   
    public boolean load() {
        IMemento memento = (IMemento) blackboard.get(WMTLayerStyleContent.EXTENSION_ID);
        if (memento != null) {
            Integer zoomLevelRaw = memento.getInteger(WMTService.KEY_PROPERTY_ZOOM_LEVEL_VALUE);
            Boolean selectionAutomaticRaw = memento
                    .getBoolean(WMTService.KEY_PROPERTY_ZOOM_LEVEL_SELECTION_AUTOMATIC);

            if ((zoomLevelRaw != null) && (selectionAutomaticRaw != null)) {
                zoomLevel = zoomLevelRaw;
                selectionAutomatic = selectionAutomaticRaw;
View Full Code Here

        IMemento[] infos = memento.getChildren(IWorkbenchConstants.TAG_INFO);
        final Map mapIDtoPart = new HashMap(infos.length);

        for (int i = 0; i < infos.length; i++) {
            // Get the info details.
            IMemento childMem = infos[i];
            final String partID = childMem.getString(IWorkbenchConstants.TAG_PART);
            final String relativeID = childMem
                    .getString(IWorkbenchConstants.TAG_RELATIVE);
            int relationship = 0;
            int left = 0, right = 0;
            float ratio = 0.5f;
            if (relativeID != null) {
                relationship = childMem.getInteger(
                        IWorkbenchConstants.TAG_RELATIONSHIP).intValue();
                Float ratioFloat = childMem
                        .getFloat(IWorkbenchConstants.TAG_RATIO);
                Integer leftInt = childMem
                        .getInteger(IWorkbenchConstants.TAG_RATIO_LEFT);
                Integer rightInt = childMem
                        .getInteger(IWorkbenchConstants.TAG_RATIO_RIGHT);
                if (leftInt != null && rightInt != null) {
                    left = leftInt.intValue();
                    right = rightInt.intValue();
                } else if (ratioFloat != null) {
                    ratio = ratioFloat.floatValue();
                }
            }

            final EditorStack workbook [] = new EditorStack[1];
            StartupThreading.runWithoutExceptions(new StartupRunnable() {

        public void runWithException() throws Throwable {
          // Create the part.
                workbook[0] = EditorStack.newEditorWorkbook(EditorSashContainer.this, page);
                workbook[0].setID(partID);
                // 1FUN70C: ITPUI:WIN - Shouldn't set Container when not active
                workbook[0].setContainer(EditorSashContainer.this);
        }});
           

            IMemento workbookMemento = childMem
                    .getChild(IWorkbenchConstants.TAG_FOLDER);
            if (workbookMemento != null) {
                result.add(workbook[0].restoreState(workbookMemento));
            }
View Full Code Here

            //    private LayoutPart part;
            //     private int relationship;
            //     private float ratio;
            //     private LayoutPart relative;
            RelationshipInfo info = relationships[i];
            IMemento childMem = memento
                    .createChild(IWorkbenchConstants.TAG_INFO);
            childMem.putString(IWorkbenchConstants.TAG_PART, info.part.getID());

            EditorStack stack = (EditorStack) info.part;
            if (stack != null) {
                IMemento folderMem = childMem
                        .createChild(IWorkbenchConstants.TAG_FOLDER);
                result.add(stack.saveState(folderMem));
            }

            if (info.relative != null) {
View Full Code Here

     * @return the restoration status
     */
    public IStatus restorePresentationState(IMemento areaMem) {
        for (Iterator i = getEditorWorkbooks().iterator(); i.hasNext();) {
            final EditorStack workbook = (EditorStack) i.next();
            final IMemento memento = workbook.getSavedPresentationState();
            if (memento == null) {
        continue;
      }
            final PresentationSerializer serializer = new PresentationSerializer(
                    workbook.getPresentableParts());
View Full Code Here

   * @since 3.2
   */
  private void saveWorkingSetState(IMemento memento, List list) {
    for (Iterator i = list.iterator(); i.hasNext();) {
            IPersistableElement persistable = (IWorkingSet) i.next();
            IMemento workingSetMemento = memento
                    .createChild(IWorkbenchConstants.TAG_WORKING_SET);
            workingSetMemento.putString(IWorkbenchConstants.TAG_FACTORY_ID,
                    persistable.getFactoryId());
            persistable.saveState(workingSetMemento);
        }
  }
View Full Code Here

    protected void saveMruList(IMemento memento) {
        Iterator iterator = recentWorkingSets.iterator();

        while (iterator.hasNext()) {
            IWorkingSet workingSet = (IWorkingSet) iterator.next();
            IMemento mruMemento = memento
                    .createChild(IWorkbenchConstants.TAG_MRU_LIST);

            mruMemento.putString(IWorkbenchConstants.TAG_NAME, workingSet
                    .getName());
        }
    }
View Full Code Here

     * 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

TOP

Related Classes of org.eclipse.ui.IMemento

Copyright © 2018 www.massapicom. 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.