Examples of EntryPointElement


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

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

    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

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

    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

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

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

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

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