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

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


    try {
      IPackageFragment newTypePackage = newType.getPackageFragment();
      ModuleDescription module = Utils.getSingleModule(newTypePackage);
      DefaultModuleProvider.modify(module, new ModuleModification() {
        public void modify(ModuleElement moduleElement) throws Exception {
          EntryPointElement entryPointElement = new EntryPointElement();
          moduleElement.addChild(entryPointElement);
          entryPointElement.setClassName(newType.getFullyQualifiedName());
        }
      });
    } catch (Throwable e) {
      DesignerPlugin.log(e);
    }
View Full Code Here


    final String oldTypeName = type.getFullyQualifiedName();
    return modifyModule(type, new DocumentModelVisitor() {
      @Override
      public void endVisit(DocumentElement element) {
        if (element instanceof EntryPointElement) {
          EntryPointElement entryPointElement = (EntryPointElement) element;
          if (entryPointElement.getClassName().equals(oldTypeName)) {
            entryPointElement.setClassName(newTypeName);
          }
        }
      }
    });
  }
View Full Code Here

    final String typeName = type.getFullyQualifiedName();
    return modifyModule(type, new DocumentModelVisitor() {
      @Override
      public void endVisit(DocumentElement element) {
        if (element instanceof EntryPointElement) {
          EntryPointElement entryPointElement = (EntryPointElement) element;
          if (entryPointElement.getClassName().equals(typeName)) {
            entryPointElement.remove();
          }
        }
      }
    });
  }
View Full Code Here

        "<module>",
        "  <entry-point class='some.class'/>",
        "</module>"});
    assertThat(m_module.getChildren()).hasSize(1);
    // prepare single "<entry-point>" element
    EntryPointElement entryPointElement;
    {
      List<EntryPointElement> entryPointElements = m_module.getEntryPointElements();
      assertThat(entryPointElements).hasSize(1);
      entryPointElement = entryPointElements.get(0);
    }
    // current "class" value
    assertEquals("some.class", entryPointElement.getClassName());
    // set new "class" value
    {
      entryPointElement.setClassName("new.class");
      assertUpdatedModuleFile(StringUtils.replace(m_moduleContent, "some.class", "new.class"));
    }
    // toString()
    assertEquals(
        getSourceDQ("<module>", "  <entry-point class='new.class'/>", "</module>"),
View Full Code Here

    // modify module file
    try {
      ModuleDescription module = Utils.getSingleModule(newType);
      DefaultModuleProvider.modify(module, new ModuleModification() {
        public void modify(ModuleElement moduleElement) throws Exception {
          EntryPointElement entryPointElement = new EntryPointElement();
          moduleElement.addChild(entryPointElement);
          entryPointElement.setClassName(newType.getFullyQualifiedName());
        }
      });
    } catch (Throwable e) {
      DesignerPlugin.log(e);
    }
View Full Code Here

TOP

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

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.