Package org.eclipse.ui

Examples of org.eclipse.ui.IMemento


        memento.putInteger(IWorkbenchConstants.TAG_FAST_VIEW_SIDE, getSide());

        Iterator iter = viewOrientation.keySet().iterator();
        while (iter.hasNext()) {
            String next = (String) iter.next();
            IMemento orientation = memento
                    .createChild(IWorkbenchConstants.TAG_FAST_VIEW_ORIENTATION);

            orientation.putString(IWorkbenchConstants.TAG_VIEW, next);
            orientation.putInteger(IWorkbenchConstants.TAG_POSITION,
                    ((Integer) viewOrientation.get(next)).intValue());
        }

    }
View Full Code Here


        }

        IMemento[] orientations = memento
                .getChildren(IWorkbenchConstants.TAG_FAST_VIEW_ORIENTATION);
        for (int i = 0; i < orientations.length; i++) {
            IMemento next = orientations[i];

            viewOrientation.put(next.getString(IWorkbenchConstants.TAG_VIEW),
                    next.getInteger(IWorkbenchConstants.TAG_POSITION));
        }
    }
View Full Code Here

    @Override
    public void init(IViewSite site, IMemento memento)
            throws PartInitException {

        if(memento != null) {
            IMemento etd = memento.getChild("encounterTrackerDetail");
            if(etd != null) {
                locked = etd.getBoolean("locked");

                selectedDisplayName = etd.getString("display");
            }
        }

        super.init(site, memento);
    }
View Full Code Here

     * @see org.eclipse.ui.part.ViewPart#saveState(org.eclipse.ui.IMemento)
     */
    @Override
    public void saveState(IMemento memento) {

        IMemento etd = memento.createChild("encounterTrackerDetail");
        etd.putBoolean("locked", locked);
        if(selectedDisplay != null) {
            etd.putString("display", selectedDisplayName);
        }
        if(encounterParticipant != null) {
            // etd.putString("encounterParticipant", encounterParticipant.)
        }

View Full Code Here

    memento.createChild("tsLocation", tsLocationText.getText());
    memento.createChild("documents");
    for (DocumentData documentData : documentList) {
      String docPath = documentData.getDocument().getAbsolutePath();
      String docName = "document";
      IMemento documentMemento = memento.getChild("documents");
      documentMemento.createChild(docName, docPath);
    }
  }
View Full Code Here

  public void restoreState(IMemento memento) {
    if (memento == null) {
      return;
    }
    IMemento inputDirectory = memento.getChild("inputDirectory");
    if (inputDirectory != null) {
      inputDirectoryText.setText(inputDirectory.getID());
    }
    IMemento testDirectory = memento.getChild("testDirectory");
    if (testDirectory != null) {
      testDirectoryText.setText(testDirectory.getID());
    }
    IMemento tsLocation = memento.getChild("tsLocation");
    if (tsLocation != null) {
      tsLocationText.setText(tsLocation.getID());
    }
    IMemento documents = memento.getChild("documents");
    if (documents != null) {
      for (IMemento document : documents.getChildren("document")) {
        DocumentData docData = new DocumentData(new File(document.getID()));
        documentList.add(docData);
      }
      tableViewer.setInput(documentList);
      tableViewer.refresh();
View Full Code Here

  }

  public void saveState(IMemento memento) {
    for (ConstraintData constraintData : constraintList) {
      if (constraintData.getConstraint() instanceof SimpleRutaRuleConstraint) {
        IMemento currentMemento = memento.createChild("constraint", "SimpleRutaConstraint");
        SimpleRutaRuleConstraint constraint = (SimpleRutaRuleConstraint) constraintData
                .getConstraint();
        currentMemento.createChild("Data", constraint.getData());
        currentMemento.createChild("Description", constraint.getDescription());
        currentMemento.createChild("Weight", "" + constraintData.getWeight());
      }

      if (constraintData.getConstraint() instanceof RutaRuleListConstraint) {
        IMemento currentMemento = memento.createChild("constraint", "ListRutaConstraint");
        RutaRuleListConstraint constraint = (RutaRuleListConstraint) constraintData.getConstraint();
        currentMemento.createChild("Data", constraint.getData());
        currentMemento.createChild("Description", constraint.getDescription());
        currentMemento.createChild("Weight", "" + constraintData.getWeight());
      }

      if (constraintData.getConstraint() instanceof RutaGEConstraint) {
        IMemento currentMemento = memento.createChild("constraint", "GEConstraint");
        RutaGEConstraint constraint = (RutaGEConstraint) constraintData.getConstraint();
        currentMemento.createChild("Data", constraint.getData());
        currentMemento.createChild("Description", constraint.getDescription());
        currentMemento.createChild("Weight", "" + constraintData.getWeight());
      }
    }
  }
View Full Code Here

  public void restoreState(IMemento memento) {
    if (memento == null)
      return;

    IMemento itm = memento.getChild("includedTypes");
    if (itm != null) {
      String id = itm.getID();
      String[] split = id.split("");
      List<String> l = new ArrayList<String>();
      for (String string : split) {
        if (!StringUtils.isBlank(string)) {
          l.add(string);
        }
      }
      setIncludedTypes(l);
    }

    IMemento etm = memento.getChild("excludedTypes");
    if (etm != null) {
      String id = etm.getID();
      String[] split = id.split("");
      List<String> l = new ArrayList<String>();
      for (String string : split) {
        if (!StringUtils.isBlank(string)) {
          l.add(string);
View Full Code Here

  public void restoreState(IMemento memento) {
    if (memento == null)
      return;

    IMemento dir = memento.getChild("documentSource");
    if (dir != null) {
      String id = dir.getID();
      documentSource.setText(id);
    }

    IMemento dir2 = memento.getChild("documentSink");
    if (dir2 != null) {
      String id = dir2.getID();
      documentSink.setText(id);
    }

    IMemento tsName = memento.getChild("typeSystem");
    if (tsName != null) {
      String id = tsName.getID();
      pathToTypeSystem.setText(id);
    }

    IMemento selectedTypes = memento.getChild("typesToCheck");
    if (selectedTypes != null) {
      typesToCheck = new HashMap<String, Set<String>>();
      for (IMemento mementoTypesToCheck : selectedTypes.getChildren(selectedTypes.getID())) {
        String typeName = mementoTypesToCheck.getID();
        Set<String> features = new HashSet<String>();
        for (IMemento mementoFeature : mementoTypesToCheck.getChildren("feature")) {
          features.add(mementoFeature.getID());
        }
        typesToCheck.put(typeName, features);
      }
    }
    IMemento uncheckedTypes = memento.getChild("typesToTransferUnchecked");
    if (uncheckedTypes != null) {
      typesToTransferUnchecked = new HashSet<String>();
      for (IMemento mementoUnchecked : uncheckedTypes.getChildren(uncheckedTypes.getID())) {
        String typeName = mementoUnchecked.getID();
        typesToTransferUnchecked.add(typeName);
      }
    }
View Full Code Here

  public void saveState(IMemento memento) {
    memento.createChild("documentSource", documentSource.getText());
    memento.createChild("documentSink", documentSink.getText());
    memento.createChild("typeSystem", pathToTypeSystem.getText());

    IMemento selectedTypesMemento = memento.createChild("typesToCheck", "type");
    for (Entry<String, Set<String>> checkedTypeEntry : typesToCheck.entrySet()) {
      IMemento selectedTypeMemento = selectedTypesMemento.createChild("type",
              checkedTypeEntry.getKey());
      for (String feature : checkedTypeEntry.getValue()) {
        selectedTypeMemento.createChild("feature", feature);
      }
    }

    IMemento uncheckTypesMemento = memento.createChild("typesToTransferUnchecked", "unchecked");
    for (String uncheckedTypeName : typesToTransferUnchecked) {
      uncheckTypesMemento.createChild("unchecked", uncheckedTypeName);
    }

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