Package org.eclipse.ui

Examples of org.eclipse.ui.XMLMemento$DOMWriter


          attributeType[5]=schema.getDescriptor(getAttributeMapper().getMemento());
          attributeType[6]=schema.getDescriptor(getAttributeMapper().getPriority());
          attributeType[7]=schema.getDescriptor(getAttributeMapper().getResolution());
          attributeType[8]=schema.getDescriptor(getAttributeMapper().getViewMemento());
         
          XMLMemento memento=XMLMemento.createWriteRoot("memento"); //$NON-NLS-1$
          XMLMemento viewMemento=XMLMemento.createWriteRoot("viewMemento"); //$NON-NLS-1$
         
          issue.save(memento);
          issue.getViewMemento(viewMemento);
         
          GeometryFactory geometryFactory = new GeometryFactory();
View Full Code Here


    }
   

    protected String createIssueMemento( IIssue issue ) {
        StringWriter out;
        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

        return out.toString();
    }

    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

                    if (config != null) {
                        IssuesListConfigurator configurator = (IssuesListConfigurator) element
                                .createExecutableExtension("configurator"); //$NON-NLS-1$
                        String data = preferenceStore.getString(IssuesPreferencePage.PREFERENCE_ID
                                + "/" + listID); //$NON-NLS-1$
                        XMLMemento memento = XMLMemento.createReadRoot(new StringReader(data));
                        configurator.initConfiguration(issuesList, memento);
                    }
                    break;
                } catch (CoreException e) {
                    issuesList = null;
View Full Code Here

   *
   * @throws IOException
   *             Thrown if there is a failure writing the output file.
   */
  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());
    try {
      memento.save(fileWriter);
    } finally {
      fileWriter.close();
    }
  }
View Full Code Here

   *             what the XMLMemento expects
   */
  public void load() throws IOException, WorkbenchException {
    if (getLocalIssuesFile().exists()) {
      FileReader reader = new FileReader(getLocalIssuesFile());
      XMLMemento memento = XMLMemento.createReadRoot(reader);
      IMemento[] children = memento.getChildren(MEMENTO_CHILD_TYPE);
      for (IMemento issueMemento : children) {
        try {
          IIssue issue = IssuesListUtil.createIssue(issueMemento
              .getString(EXTENSION_ID));
          if (issue == null) {
View Full Code Here

    protected String getXMLConfiguration() throws IOException {
        if( issuesList==null || issuesList.configurator==null || issuesList.configurator==ERROR_CONFIG )
            return null;
           
        XMLMemento memento=XMLMemento.createWriteRoot("configuration"); //$NON-NLS-1$
        issuesList.configurator.getConfiguration(memento);
        StringWriter stringWriter=new StringWriter();
        memento.save(stringWriter);
        String configuration = stringWriter.toString();
        stringWriter.close();
        return configuration;
    }
View Full Code Here

    }

    @Test
    public void testStyleContentTestNulls() throws Exception {
        ViewStyleContent content = new ViewStyleContent();
        XMLMemento memento = XMLMemento.createWriteRoot("root");
        DefaultQuery start = new DefaultQuery();
        content.save(memento, start);
        Query loaded = (Query) content.load(memento);
        assertEquals(start, loaded);
    }
View Full Code Here

    }

    @Test
    public void testStyleContentAllNoneFilters() throws Exception {
        ViewStyleContent content = new ViewStyleContent();
        XMLMemento memento = XMLMemento.createWriteRoot("root");
        DefaultQuery start = new DefaultQuery("Feature", Filter.EXCLUDE);
        content.save(memento, start);
        Query loaded = (Query) content.load(memento);
        assertEquals(start, loaded);
View Full Code Here

    }

    @Ignore
    @Test
    public void testStyleContentFullQuery() throws Exception {
        XMLMemento memento = XMLMemento.createWriteRoot("root");
        DefaultQuery start = new DefaultQuery("type", new URI(
                "http://localhost"), filter, 27, new String[] { "att" },
                "handle");
        ViewStyleContent content = new ViewStyleContent();
        content.save(memento, start);
View Full Code Here

TOP

Related Classes of org.eclipse.ui.XMLMemento$DOMWriter

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.