Package org.eclipse.ui

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


     
    }
    try {
      StringWriter w = new StringWriter();
      // Save to byte buffer first
      rootElem.save(w);
      // Update log resource
      log.configure(OPTION_NAMED_FILTERS, w.toString());
    } catch (IOException e) {
      // Unexpected exception; wrap with CoreException
      throw new CoreException(new Status(IStatus.ERROR, UIPlugin.PLUGIN_ID,
View Full Code Here


        XMLMemento memento = XMLMemento.createWriteRoot("workingSet"); //$NON-NLS-1$
        workingSetFilterActionGroup.saveState(memento);
        workingSetFilterActionGroup.dispose();
        StringWriter writer = new StringWriter();
        try {
            memento.save(writer);
            settings.put(WORKINGS_SET_SETTINGS, writer.getBuffer().toString());
        } catch (IOException e) {
            StatusManager.getManager().handle(
                    new Status(IStatus.ERROR, AnalysisPlugin.getPluginID(), IStatus.ERROR, "", e)); //$NON-NLS-1$
            // don't do anything. Simply don't store the settings
View Full Code Here

          break;
      }
    }
    StringWriter writer = new StringWriter();
    try {
      memento.save(writer);
      getPreferenceStore().setValue(
          UIPreferences.COMMIT_DIALOG_HISTORY_MESSAGES,
          writer.toString());
    } catch (IOException e) {
      org.eclipse.egit.ui.Activator.logError(
View Full Code Here

        try
        {
            final StringWriter sw = new StringWriter();
            final XMLMemento m = XMLMemento.createWriteRoot(memento.getType());
            m.putMemento(memento);
            m.save(sw);
            return new Persister().read(clazz, new StringReader(sw.toString()));
        }
        catch (Exception e)
        {
            throw ExceptionUtils.wrapAs(IOException.class, e);
View Full Code Here

      }
    }

    try {
      StringWriter writer = new StringWriter();
      rootMemento.save(writer);
      mementoString = writer.getBuffer().toString();
      prefStore.setValue(prefStoreKey, mementoString);
    }
    catch (IOException e) {
      StatusHandler.log(new Status(IStatus.ERROR, MetadataPlugin.PLUGIN_ID,
View Full Code Here

    }
    memento.putInteger(KEY_PAGE_INDEX, newPageIndex);

    try {
      StringWriter writer = new StringWriter();
      memento.save(writer);
      xml = writer.getBuffer().toString();
      prefStore.setValue(activePageKey, xml);
    }
    catch (IOException e) {
      StatusHandler.log(new Status(IStatus.ERROR, ConfigUiPlugin.PLUGIN_ID, Messages
View Full Code Here

    // save memento to default map file
    Writer writer = null;
    try {
      writer = new FileWriter(defaultFile.toFile());
      memento.save(writer);
    }
    catch (IOException e) {
    }
    finally {
      if (writer != null) {
View Full Code Here

      boundsMemento.putInteger(KEY_BOUNDS_WIDTH, bounds.width);
    }

    try {
      StringWriter writer = new StringWriter();
      memento.save(writer);
      xml = writer.getBuffer().toString();
      getPreferenceLocation().putString(getGraphCoordsKey(), xml);
    }
    catch (IOException e) {
      StatusHandler.log(new Status(IStatus.ERROR, ConfigGraphPlugin.PLUGIN_ID,
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.