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

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


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


    final String oldTypeName = type.getFullyQualifiedName();
    return modifyModule(type, new DocumentModelVisitor() {
      @Override
      public void endVisit(DocumentElement element) {
        if (element instanceof ServletElement) {
          ServletElement servletElement = (ServletElement) element;
          if (servletElement.getClassName().equals(oldTypeName)
              && servletElement.getPath().equals(oldPath)) {
            servletElement.setPath(newPath);
          }
        }
      }
    });
  }
View Full Code Here

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

        "<module>",
        "  <servlet path='some.path' class='some.class'/>",
        "</module>"});
    assertThat(m_module.getChildren()).hasSize(1);
    // prepare single "<servlet>" element
    ServletElement servletElement;
    {
      List<ServletElement> servletElements = m_module.getServletElements();
      assertThat(servletElements).hasSize(1);
      servletElement = servletElements.get(0);
    }
    // current values
    assertEquals("some.path", servletElement.getPath());
    assertEquals("some.class", servletElement.getClassName());
    // set new values
    {
      servletElement.setPath("new.path");
      servletElement.setClassName("new.class");
      String expected = StringUtils.replace(m_moduleContent, "some.path", "new.path");
      expected = StringUtils.replace(expected, "some.class", "new.class");
      assertUpdatedModuleFile(expected);
    }
  }
View Full Code Here

TOP

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

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.