Package org.eclipse.wb.internal.core.utils.xml

Examples of org.eclipse.wb.internal.core.utils.xml.DocumentModelVisitor


   *         name.
   */
  public static Change module_replaceEntryPoint(IType type, final String newTypeName)
      throws Exception {
    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)) {
View Full Code Here


   * @return {@link Change} for changing servlet from existing {@link IType} to type with new name.
   */
  public static Change module_replaceServletClass(IType type, final String newTypeName)
      throws Exception {
    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)) {
View Full Code Here

   */
  public static Change module_replaceServletPath(IType type,
      final String oldPath,
      final String newPath) throws Exception {
    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)
View Full Code Here

  /**
   * @return {@link Change} for removing servlet with given {@link IType}.
   */
  public static Change module_removeServlet(IType type) throws Exception {
    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)) {
View Full Code Here

  /**
   * @return {@link Change} for removing <code>EntryPoint</code> with given {@link IType}.
   */
  public static Change module_removeEntryPoint(IType type) throws Exception {
    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)) {
View Full Code Here

   * @return {@link Change} for changing servlet from existing {@link IType} to type with new name.
   */
  public static Change web_replaceServletClass(IType type, final String newTypeName)
      throws Exception {
    final String oldTypeName = type.getFullyQualifiedName();
    return modifyWeb(type, new DocumentModelVisitor() {
      @Override
      public void endVisit(DocumentElement element) {
        if (element instanceof com.google.gdt.eclipse.designer.model.web.ServletElement) {
          com.google.gdt.eclipse.designer.model.web.ServletElement servlet =
              (com.google.gdt.eclipse.designer.model.web.ServletElement) element;
View Full Code Here

  /**
   * @return {@link Change} for changing name of servlet in "servlet" element.
   */
  public static Change web_replaceServletPath(IType type, final String oldName, final String newName)
      throws Exception {
    return modifyWeb(type, new DocumentModelVisitor() {
      @Override
      public void endVisit(DocumentElement element) {
        if (element instanceof com.google.gdt.eclipse.designer.model.web.ServletElement) {
          com.google.gdt.eclipse.designer.model.web.ServletElement servlet =
              (com.google.gdt.eclipse.designer.model.web.ServletElement) element;
View Full Code Here

  /**
   * @return {@link Change} for removing servlet with given {@link IType}.
   */
  public static Change web_removeServlet(IType type) throws Exception {
    final String typeName = type.getFullyQualifiedName();
    return modifyWeb(type, new DocumentModelVisitor() {
      Map<String, com.google.gdt.eclipse.designer.model.web.ServletMappingElement> mappingElements =
          Maps.newTreeMap();
      String servletNameToRemove;

      @Override
View Full Code Here

  /**
   * Visits all {@link DocumentElement}s and remembers all of them with path.
   */
  private void fillMap_pathToElement() {
    m_context.getRootElement().accept(new DocumentModelVisitor() {
      @Override
      public void endVisit(DocumentElement element) {
        m_pathToElementMap.put(getPath(element), element);
      }
    });
View Full Code Here

    // field from not UiBinder unit
    if (uiFile == null) {
      return null;
    }
    // prepare change
    return RefactoringUtils.modifyXML(uiFile, new DocumentModelVisitor() {
      @Override
      public void visit(DocumentAttribute attribute) {
        if (attribute.getName().endsWith(":field") && attribute.getValue().equals(m_oldName)) {
          attribute.setValue(m_newName);
        }
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.utils.xml.DocumentModelVisitor

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.