Package org.eclipse.ui

Examples of org.eclipse.ui.XMLMemento


            updateWorkingSetList()
            _table.refresh();
        }
    });
   
    XMLMemento memento = null;
    // TODO rebuild memento for whole plugin?
    try {
        File mementoFile = getWorkingSetMemento();
        if (mementoFile.exists()) {
            FileReader reader = new FileReader(mementoFile);
View Full Code Here


                }

            }
        }

        XMLMemento memento = XMLMemento.createWriteRoot("runTimeViewSelectedWorkingSet");
        _actionGroup.saveState(memento);
        saveMementoToFile(memento);
       
        if (_actionGroup != null) {
            _table.setInput(WGADesignerPlugin.getAllRuntimes(_projectsInWorkingSet));
View Full Code Here

    @Override
    protected void storeDialog(final IDialogSettings settings) {
        super.storeDialog(settings);

        final XMLMemento memento = XMLMemento.createWriteRoot("workingSet"); //$NON-NLS-1$
        workingSetFilterActionGroup.saveState(memento);
        workingSetFilterActionGroup.dispose();
        final StringWriter writer = new StringWriter();
        try {
            memento.save(writer);
            settings.put(WORKINGS_SET_SETTINGS, writer.getBuffer().toString());
        } catch (final IOException e) {
            StatusManager.getManager().handle(
                    new Status(IStatus.ERROR, ErlideUIPlugin.PLUGIN_ID, IStatus.ERROR,
                            "", e)); //$NON-NLS-1$
View Full Code Here

    }

        StringReader reader = new StringReader(xmlString);

        // Restore the editor input
        XMLMemento memento = XMLMemento.createReadRoot(reader);

        IElementFactory factory = PlatformUI.getWorkbench().getElementFactory(
                factoryId);

        if (factory != null) {
View Full Code Here

        dataOut.writeUTF(editorInputData.editorId);

        //write the information needed to recreate the editor input
        if (editorInputData.input != null) {
            // Capture the editor information
            XMLMemento memento = XMLMemento.createWriteRoot("IEditorInput");//$NON-NLS-1$

            IPersistableElement element = editorInputData.input
                    .getPersistable();
            if (element != null) {
                //get the IEditorInput to save its state
                element.saveState(memento);

                //convert memento to String
                StringWriter writer = new StringWriter();
                memento.save(writer);
                writer.close();

                //write the factor ID and state information
                dataOut.writeUTF(element.getFactoryId());
                dataOut.writeUTF(writer.toString());
View Full Code Here

   *
   * @param stateFile
   * @throws IOException
   */
  public void saveState(File stateFile) throws IOException {
    XMLMemento memento = XMLMemento
        .createWriteRoot(IWorkbenchConstants.TAG_WORKING_SET_MANAGER);
    saveWorkingSetState(memento);
    saveMruList(memento);
 
    FileOutputStream stream = new FileOutputStream(stateFile);
    OutputStreamWriter writer = new OutputStreamWriter(stream, "utf-8"); //$NON-NLS-1$
    memento.save(writer);
    writer.close();
 
  }
View Full Code Here

     * @param memento
     *            memento from which the history will be retrieved
     */
    public void load(IMemento memento) {

      XMLMemento historyMemento = (XMLMemento) memento
          .getChild(rootNodeName);

      if (historyMemento == null) {
        return;
      }

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

   *            settings used to store dialog
   */
  protected void storeDialog(IDialogSettings settings) {
    settings.put(SHOW_STATUS_LINE, toggleStatusLineAction.isChecked());

    XMLMemento memento = XMLMemento.createWriteRoot(HISTORY_SETTINGS);
    this.contentProvider.saveHistory(memento);
    StringWriter writer = new StringWriter();
    try {
      memento.save(writer);
      settings.put(HISTORY_SETTINGS, writer.getBuffer().toString());
    } catch (IOException e) {
      // Simply don't store the settings
      StatusManager
          .getManager()
View Full Code Here

    // Write the simple preference key to the UI preference store.
    writeActiveScheme(activeScheme);

    // Build the XML block for writing the bindings and active scheme.
    final XMLMemento xmlMemento = XMLMemento
        .createWriteRoot(EXTENSION_COMMANDS);
    if (activeScheme != null) {
      writeActiveSchemeToPreferences(xmlMemento, activeScheme);
    }
    if (bindings != null) {
      final int bindingsLength = bindings.length;
      for (int i = 0; i < bindingsLength; i++) {
        final Binding binding = bindings[i];
        if (binding.getType() == Binding.USER) {
          writeBindingToPreferences(xmlMemento, binding);
        }
      }
    }

    // Write the XML block to the workbench preference store.
    final IPreferenceStore preferenceStore = WorkbenchPlugin.getDefault()
        .getPreferenceStore();
    final Writer writer = new StringWriter();
    try {
      xmlMemento.save(writer);
      preferenceStore.setValue(EXTENSION_COMMANDS, writer.toString());
    } finally {
      writer.close();
    }
  }
View Full Code Here

        if (isDisposed()) {
            return;
        }

        {// Save the presentation's state before disposing it
            XMLMemento memento = XMLMemento
                    .createWriteRoot(IWorkbenchConstants.TAG_PRESENTATION);
            memento.putString(IWorkbenchConstants.TAG_ID, getFactory().getId());

            PresentationSerializer serializer = new PresentationSerializer(
                    getPresentableParts());

            getPresentation().saveState(serializer, memento);
View Full Code Here

TOP

Related Classes of org.eclipse.ui.XMLMemento

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.