Examples of IMemento


Examples of net.jmesnil.jmx.core.IMemento

  protected void loadConnections() {
    String filename = JMXActivator.getDefault().getStateLocation().append(STORE_FILE).toOSString();
    HashMap<String, DefaultConnectionWrapper> map = new HashMap<String, DefaultConnectionWrapper>();
    if( new File(filename).exists()) {
      try {
        IMemento root = XMLMemento.loadMemento(filename);
        IMemento[] child = root.getChildren(CONNECTION);
        for( int i = 0; i < child.length; i++ ) {
          String id = child[i].getString(ID);
          String url = child[i].getString(URL);
          String username = child[i].getString(USERNAME);
          String password = child[i].getString(PASSWORD);
View Full Code Here

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

Examples of org.eclipse.ui.IMemento

    @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

Examples of org.eclipse.ui.IMemento

    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

Examples of org.eclipse.ui.IMemento

        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

Examples of org.eclipse.ui.IMemento

        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

Examples of org.eclipse.ui.IMemento

            //    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

Examples of org.eclipse.ui.IMemento

     * @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

Examples of org.eclipse.ui.IMemento

   * @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

Examples of org.eclipse.ui.IMemento

    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
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.