Package org.eclipse.ui

Examples of org.eclipse.ui.IMemento


        }
        return list;
    }

    public IMemento createChild( String type, String id ) {
        IMemento found = findChild(type, id);
        if (found == null) {
            found = createChild(type);
            found.putString(TAG_ID, id);
        }
        return found;
    }
View Full Code Here


        return found;
    }

    public IMemento findChild( String type, String id ) {
        IMemento[] children = getChildren(type);
        IMemento found = null;
        for( IMemento memento : children ) {
            if( id==null){
                if(memento.getID()==null){
                    found = memento;
                    break;
View Full Code Here

            boolean isValid = true;
            //check the required keys
            IConfigurationElement[] requiredKeys = element.getChildren(ATT_REQKEY);
            for (IConfigurationElement key : requiredKeys) {
                String expectedKey = key.getAttribute(ATT_KEY);
                IMemento value = fixerMemento.getChild(expectedKey);
                String value2 = fixerMemento.getString(expectedKey);
                Integer value3 = fixerMemento.getInteger(expectedKey);
                if (value == null && value2 == null && value3 == null) { //failure!
                    isValid = false;
                    break;
View Full Code Here

                Browser browser = (Browser)control;
                if(!browser.isDisposed()) {
                    CTabItem item = this.tabMap.get(browser);
                    String listener = this.listenerMap.get(browser);
                    if(item != null && !item.isDisposed() ) {
                        IMemento child = memento.createChild(BROWSER_TYPE);
                        child.putString(BROWSER_NAME, item.getText());
                        child.putString(BROWSER_URL, browser.getUrl());
                        child.putString(BROWSER_LISTENER, listener);
                    }
                }
            }
        }
    }
View Full Code Here

    private void assertMementoEquals( UdigMemento memento, UdigMemento readIn, boolean textValNotNull ) {
        assertEquals(2, readIn.getChildren(TYPE).length);
        assertEquals(1, readIn.getChildren(null).length);
        assertEquals(0, readIn.getChildren("boog").length);
       
        IMemento childNoId = readIn.findChild(TYPE, null);
        IMemento childID = readIn.findChild(TYPE, ID1);
        IMemento childNullType = readIn.findChild(null,null);
       
        assertNotNull(childNoId);
        assertNotNull(childID);
        assertNotNull(childNullType);
View Full Code Here

   */
  public void save() throws IOException {
    XMLMemento memento = XMLMemento.createWriteRoot(Messages.IssuesListPersister_xmlRootElement);
    for (IIssue issue : this.list) {
      try {
        IMemento child = memento.createChild(MEMENTO_CHILD_TYPE, issue
            .getId());

        child.putString(GROUP_ID, issue.getGroupId());
        child.putString(EXTENSION_ID, issue.getExtensionID());
        child.putString(DESCRIPTION, issue.getDescription());
        child.putString(PRIORITY, issue.getPriority().name());
        child.putString(RESOLUTION, issue.getResolution().name());

        // persist bounds
        ReferencedEnvelope bounds = issue.getBounds();
        child.putString(MIN_X, Double.toString(bounds.getMinX()));
        child.putString(MAX_X, Double.toString(bounds.getMaxX()));
        child.putString(MIN_Y, Double.toString(bounds.getMinY()));
        child.putString(MAX_Y, Double.toString(bounds.getMaxY()));
        child.putString(CRS, bounds.getCoordinateReferenceSystem()
            .toWKT());

        issue.getViewMemento(child.createChild(MEMENTO_VIEW_DATA));
        issue.save(child.createChild(MEMENTO_ISSUE_DATA));
      } catch (Throwable e) {
        IssuesActivator.log("error when daving issue", e); //$NON-NLS-1$
      }
    }
    FileWriter fileWriter = new FileWriter(getLocalIssuesFile());
View Full Code Here

          IIssue issue = IssuesListUtil.createIssue(issueMemento
              .getString(EXTENSION_ID));
          if (issue == null) {
            continue;
          }
          IMemento dataMemento = issueMemento
              .getChild(MEMENTO_ISSUE_DATA);
          IMemento viewMemento = issueMemento
              .getChild(MEMENTO_VIEW_DATA);
          String issueId = issueMemento.getID();
          String groupId = issueMemento.getString(GROUP_ID);

          double minX = Double.parseDouble(issueMemento
View Full Code Here

                StructuredSelection structuredSelection = (StructuredSelection) paletteTable.getSelection();
                BrewerPalette pal = (BrewerPalette) structuredSelection.getFirstElement();
                if (pal == null) {
                    // get it from the last memento used
                    StyleBlackboard bb = getSelectedLayer().getStyleBlackboard();
                    IMemento memento = (IMemento) bb.get(DialogSettingsStyleContent.EXTENSION_ID);
                    String paletteName = memento.getString(PALETTE_KEY);
                    pal = getBrewer().getPalette(paletteName);
                }
                String paletteName = pal.getName();
                Combo combo = getCombo(COMBO_CLASSES);
                int numClasses = new Integer(combo.getText()).intValue();
View Full Code Here

        return ovrIcon.createImage();
    }

    public void gotFocus() {
        StyleBlackboard bb = getSelectedLayer().getStyleBlackboard();
        IMemento memento = (IMemento) bb
                .get(DialogSettingsStyleContent.EXTENSION_ID);
        if (memento != null) {
            setComboSelectionInt(memento, COMBO_OPACITY, OPACITY_KEY);
            setComboSelectionString(memento, COMBO_ATTRIBUTES, ATTRIBUTE_KEY);
            setComboSelectionInt(memento, COMBO_CLASSES, CLASSES_KEY);
View Full Code Here

      }
  };
   
    public boolean performApply() {
      StyleBlackboard bb = getSelectedLayer().getStyleBlackboard();
      IMemento memento = (IMemento) bb.get(DialogSettingsStyleContent.EXTENSION_ID);
      if(memento == null ){
        memento = XMLMemento.createWriteRoot("ThemeingData");
      }

      putIntFromCombo(memento, OPACITY_KEY, COMBO_OPACITY);
      putStringFromCombo(memento, ATTRIBUTE_KEY, COMBO_ATTRIBUTES);
      putIntFromCombo(memento, CLASSES_KEY, COMBO_CLASSES);
      putStringFromCombo(memento, BREAK_KEY, COMBO_BREAKTYPE);
      putStringFromCombo(memento, NORMALIZE_KEY, COMBO_NORMALIZE);
      memento.putInteger(ELSE_KEY, getCombo(COMBO_ELSE).getSelectionIndex());
        putStringFromCombo(memento, PALETTE_CATEGORY_KEY, COMBO_PALETTES);

        putButton(memento, BUTTON_COLORBLIND, COLOR_BLIND_KEY);
        putButton(memento, BUTTON_CRT, CRT_KEY);
        putButton(memento, BUTTON_PROJECTOR, PROJECTOR_KEY);
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.