Package org.eclipse.ui

Examples of org.eclipse.ui.XMLMemento.save()


        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


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

    saveWorkingSetState(memento);
    saveMruList(memento);
 
    FileOutputStream stream = new FileOutputStream(stateFile);
    OutputStreamWriter writer = new OutputStreamWriter(stream, "utf-8"); //$NON-NLS-1$
    memento.save(writer);
    writer.close();
 
  }
 
  /* (non-Javadoc)
 
View Full Code Here

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

            // save the state of the style
            XMLMemento memento = XMLMemento.createWriteRoot("styleEntry"); //$NON-NLS-1$
            styleContent.save(memento, style);

            StringWriter writer = new StringWriter();
            memento.save(writer);
            se.setMemento(writer.getBuffer().toString());

            writer.close();
        } catch (IOException e) {
            e.printStackTrace();
View Full Code Here

        writer.getBuffer().append(printer.getExtensionPointID());
        writer.getBuffer().append(SPLIT);
        writer.getBuffer().append(printer.getClass().getName());
        writer.getBuffer().append(SPLIT);
        try {
            memento.save(writer);
        } catch (IOException e) {
            return "<boxPrinter></boxPrinter>"; //$NON-NLS-1$
        }

        return writer.getBuffer().toString();
View Full Code Here

                XMLMemento memento = XMLMemento.createWriteRoot("blackboardContent"); //$NON-NLS-1$
                persister.save(value, memento);
                memento.putString("internalObjectClassStorage", entry.getObjectClass().getName()); //$NON-NLS-1$

                StringWriter writer = new StringWriter();
                memento.save(writer);
                entry.setMemento(writer.getBuffer().toString());
            } else {
                // this is a "real" object that cannot be shared between runs
            }
        } catch (Exception e) {
View Full Code Here

        XMLMemento memento;
        out=new StringWriter();
        memento=XMLMemento.createWriteRoot("root"); //$NON-NLS-1$
        issue.save(memento);
        try {
            memento.save(out);
        } catch (IOException e) {
            IssuesActivator.log("", e); //$NON-NLS-1$
        }
        return out.toString();
    }
View Full Code Here

    protected String createViewMemento( IIssue issue ) {
        StringWriter out=new StringWriter();
        XMLMemento memento=XMLMemento.createWriteRoot("root"); //$NON-NLS-1$
        issue.getViewMemento(memento);
        try {
            memento.save(out);
        } catch (IOException e) {
            IssuesActivator.log("", e); //$NON-NLS-1$
        }
       return out.toString();
    }
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.