Examples of BodyDeclarationTarget


Examples of org.eclipse.wb.internal.core.utils.ast.BodyDeclarationTarget

            + fieldName
            + " = com.google.gwt.core.client.GWT.create("
            + fullClassName
            + ".class);";
    TypeDeclaration typeDeclaration = JavaInfoUtils.getTypeDeclaration(root);
    BodyDeclarationTarget target = new BodyDeclarationTarget(typeDeclaration, true);
    root.getEditor().addFieldDeclaration(code, target);
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.BodyDeclarationTarget

  private void addKey(String key) throws Exception {
    TypeDeclaration typeDeclaration =
        (TypeDeclaration) m_accessorEditor.getAstUnit().types().get(0);
    m_accessorEditor.addInterfaceMethodDeclaration(
        "String " + key + "()",
        new BodyDeclarationTarget(typeDeclaration, false));
    commitAccessorChanges();
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.BodyDeclarationTarget

                "private {0}<{1}> {2} = new {0}<{1}>(java.util.Collections.<{1}>emptyList());",
                "com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler",
                rowTypeName,
                listHandlerName);
        TypeDeclaration targetType = JavaInfoUtils.getTypeDeclaration(m_this);
        BodyDeclarationTarget target = new BodyDeclarationTarget(targetType, true);
        editor.addFieldDeclaration(source, target);
      }
      // add cellTable.addColumnSortHandler(sortHandler);
      getParentJava().addMethodInvocation(
          "addColumnSortHandler(com.google.gwt.user.cellview.client.ColumnSortEvent.Handler)",
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.BodyDeclarationTarget

          String bundleSource;
          {
            String className = source.substring(index + IMAGE_BUNDLE.length(), indexEnd);
            ImageBundleInfo bundle = getBundle(className);
            TypeDeclaration typeDeclaration = JavaInfoUtils.getTypeDeclaration(root);
            NodeTarget target = new NodeTarget(new BodyDeclarationTarget(typeDeclaration, false));
            bundleSource = bundle.getVariableSupport().getReferenceExpression(target);
          }
          // replace
          source = source.substring(0, index) + bundleSource + source.substring(indexEnd + 1);
        }
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.BodyDeclarationTarget

        if (method == null) {
          method =
              getEditor().addMethodDeclaration(
                  "protected void onButtonPressed(com.extjs.gxt.ui.client.widget.button.Button button)",
                  ImmutableList.of("super.onButtonPressed(button);"),
                  new BodyDeclarationTarget(typeDeclaration, false));
        }
      }
      // try to find exiting statement
      List<Statement> statements = DomGenerics.statements(method);
      for (Statement statement : statements) {
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.BodyDeclarationTarget

     */
    private void expose(boolean isPublic) throws Exception {
      AstEditor editor = getFormEditor();
      TypeDeclaration typeDeclaration = getFormTypeDeclaration();
      //
      BodyDeclarationTarget methodTarget = new BodyDeclarationTarget(typeDeclaration, false);
      String modifierSource = isPublic ? "public" : "protected";
      String name = NameSupport.ensureName(m_object);
      // getter
      {
        String header = modifierSource + " " + m_propertyTypeName + " " + m_exposedGetter + "()";
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.BodyDeclarationTarget

          "@com.google.gwt.uibinder.client.UiField "
              + ReflectionUtils.getCanonicalName(componentClass)
              + " "
              + name
              + ";";
      BodyDeclarationTarget target = getNewFieldTarget(typeDeclaration);
      editor.addFieldDeclaration(source, target);
    }
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.BodyDeclarationTarget

      String source = "@com.google.gwt.uibinder.client.UiField(provided=true) ";
      source += fieldTypeName + " " + name + " = " + initializer + ";";
      Collections.addAll(lines, StringUtils.split(source, '\n'));
    }
    // add field
    BodyDeclarationTarget target = getNewFieldTarget(typeDeclaration);
    editor.addFieldDeclaration(lines, target);
    // add new JField into "form" JType
    addFormJField(fieldClass, name);
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.BodyDeclarationTarget

        }
      }
    });
    // after last @UiField
    if (lastUiField[0] != null) {
      return new BodyDeclarationTarget(lastUiField[0], false);
    }
    // after GWT.create(Binder.class)
    if (binderCreate[0] != null) {
      return new BodyDeclarationTarget(binderCreate[0], false);
    }
    // at type end
    return new BodyDeclarationTarget(typeDeclaration, false);
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.utils.ast.BodyDeclarationTarget

    MethodDeclaration method =
        m_editor.addMethodDeclaration(
            ImmutableList.<String>of(uiHandlerAnnotation),
            header,
            ImmutableList.<String>of(),
            new BodyDeclarationTarget(m_typeDeclaration, false));
    // done
    return method;
  }
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.