Package com.google.gdt.eclipse.designer.model.module

Examples of com.google.gdt.eclipse.designer.model.module.GwtDocumentEditContext


  public static void modify(ModuleDescription moduleDescription, ModuleModification modification)
      throws Exception {
    if (moduleDescription instanceof DefaultModuleDescription) {
      IFile moduleFile = ((DefaultModuleDescription) moduleDescription).getFile();
      GwtDocumentEditContext context = new GwtDocumentEditContext(moduleFile);
      try {
        ModuleElement moduleElement = context.getModuleElement();
        modification.modify(moduleElement);
        context.commit();
      } finally {
        context.disconnect();
      }
    }
  }
View Full Code Here


   */
  private static Change modifyModule(IType type, DocumentModelVisitor visitor) throws Exception {
    ModuleDescription moduleDescription = Utils.getSingleModule(type);
    if (moduleDescription instanceof DefaultModuleDescription) {
      IFile moduleFile = ((DefaultModuleDescription) moduleDescription).getFile();
      GwtDocumentEditContext context = new GwtDocumentEditContext(moduleFile);
      return modifyXML(moduleFile, visitor, context);
    }
    return null;
  }
View Full Code Here

      m_moduleContent = getSource(lines);
      ByteArrayInputStream input = new ByteArrayInputStream(m_moduleContent.getBytes());
      m_moduleFile.setContents(input, true, false, null);
    }
    // prepare new edit context
    m_editContext = new GwtDocumentEditContext(m_moduleFile);
    // prepare module element
    m_module = m_editContext.getModuleElement();
    m_module.setId(m_moduleDescription.getId());
    m_module.finalizeLoading();
  }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.module.GwtDocumentEditContext

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.