Package com.google.gdt.eclipse.designer.util.DefaultModuleProvider

Examples of com.google.gdt.eclipse.designer.util.DefaultModuleProvider.ModuleModification


            "mvp/ClientFactoryImpl.java",
            variables);
    // add definition for factory to xxx.gwt.xml
    {
      ModuleDescription moduleDescription = Utils.getSingleModule(packageFragment);
      DefaultModuleProvider.modify(moduleDescription, new ModuleModification() {
        public void modify(ModuleElement moduleElement) throws Exception {
          AbstractModuleElement replaceElement = new AbstractModuleElement("replace-with");
          moduleElement.addChild(replaceElement);
          replaceElement.setAttribute("class", packageName + "." + className + "Impl");
          //
View Full Code Here


    }
    // add new entry-point definition
    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());
        }
View Full Code Here

    }
    // ensure com.google.gwt.junit.JUnit import
    try {
      IPackageFragment newTypePackage = newType.getPackageFragment();
      ModuleDescription module = Utils.getSingleModule(newTypePackage);
      DefaultModuleProvider.modify(module, new ModuleModification() {
        public void modify(ModuleElement moduleElement) throws Exception {
          if (moduleElement.getInheritsElement("com.google.gwt.junit.JUnit") == null) {
            moduleElement.addInheritsElement("com.google.gwt.junit.JUnit");
          }
        }
View Full Code Here

      File resourceTargetDir = new File(webDir, "ExtGWT");
      FileUtils.copyDirectory(resourcesSourceDir, resourceTargetDir);
      webFolder.refreshLocal(IResource.DEPTH_INFINITE, null);
    }
    // add elements into module
    DefaultModuleProvider.modify(m_module, new ModuleModification() {
      public void modify(ModuleElement moduleElement) throws Exception {
        moduleElement.addInheritsElement("com.extjs.gxt.ui.GXT");
      }
    });
    // add "stylesheet" into HTML
View Full Code Here

    assertFalse(Utils.inheritsModule(module, "second.MyModule"));
    // create "second", still not inherited
    GTestUtils.createModule(m_testProject, "second.MyModule");
    assertFalse(Utils.inheritsModule(module, "second.MyModule"));
    // add elements into module
    DefaultModuleProvider.modify(module, new ModuleModification() {
      public void modify(ModuleElement moduleElement) throws Exception {
        moduleElement.addInheritsElement("second.MyModule");
      }
    });
    // yes, inherits
View Full Code Here

   */
  @DisposeProjectAfter
  public void test_parse_whenRenameTo() throws Exception {
    dontUseSharedGWTState();
    // update module file to use "rename-to"
    DefaultModuleProvider.modify(getTestModuleDescription(), new ModuleModification() {
      public void modify(ModuleElement moduleElement) throws Exception {
        moduleElement.setAttribute("rename-to", "myModuleName");
      }
    });
    waitForAutoBuild();
View Full Code Here

    public void run(final IMarker marker) {
      ExecutionUtils.runLog(new RunnableEx() {
        public void run() throws Exception {
          ModuleDescription moduleDescription = Utils.getSingleModule(marker.getResource());
          DefaultModuleProvider.modify(moduleDescription, new ModuleModification() {
            public void modify(ModuleElement moduleElement) throws Exception {
              InheritsElement inheritsElement = new InheritsElement();
              moduleElement.addChild(inheritsElement);
              inheritsElement.setName(m_moduleNameToImport);
            }
View Full Code Here

   * Ensures that module for given compilation unit contains import for module
   * "com.google.gwt.i18n.I18N".
   */
  private static void ensureI18NModule(JavaInfo root) throws Exception {
    ModuleDescription module = getModule(root);
    DefaultModuleProvider.modify(module, new ModuleModification() {
      public void modify(ModuleElement moduleElement) throws Exception {
        // check, may be already import for I18N
        for (InheritsElement inheritsElement : moduleElement.getInheritsElements()) {
          if (inheritsElement.getName().equals(I18N_MODULE)) {
            return;
View Full Code Here

    if (locale.isDefault()) {
      return;
    }
    //
    ModuleDescription module = getModule(m_root);
    DefaultModuleProvider.modify(module, new ModuleModification() {
      public void modify(ModuleElement moduleElement) throws Exception {
        // build list of locales in <extent-property name='locale'> elements, remove these elements
        List<String> locales = Lists.newArrayList();
        for (ExtendPropertyElement extendPropertyElement : moduleElement.getExtendPropertyElements()) {
          if (extendPropertyElement.getName().equals("locale")) {
View Full Code Here

            ""));
    waitForAutoBuild();
    // add sub/My.css into module
    {
      ModuleDescription module = Utils.getModule(m_javaProject, "test.Module");
      DefaultModuleProvider.modify(module, new ModuleModification() {
        public void modify(ModuleElement moduleElement) throws Exception {
          moduleElement.addStylesheetElement("sub/My.css");
        }
      });
    }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.util.DefaultModuleProvider.ModuleModification

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.