Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.ClassInstanceCreation


    protected void repairBug(ASTRewrite rewrite, CompilationUnit workingUnit, BugInstance bug) throws BugResolutionException {
        assert rewrite != null;
        assert workingUnit != null;
        assert bug != null;

        ClassInstanceCreation classLoaderCreation = findClassLoaderCreation(getASTNode(workingUnit,
                bug.getPrimarySourceLineAnnotation()));
        if (classLoaderCreation == null) {
            throw new BugResolutionException("No matching class loader creation found at the specified source line.");
        }
        updateVariableReferences(rewrite, classLoaderCreation);
View Full Code Here


    protected MethodInvocation createDoPrivilegedInvocation(ASTRewrite rewrite, ClassInstanceCreation classLoaderCreation) {
        AST ast = rewrite.getAST();

        MethodInvocation doPrivilegedInvocation = ast.newMethodInvocation();
        ClassInstanceCreation privilegedActionCreation = createPrivilegedActionCreation(rewrite, classLoaderCreation);
        List<Expression> arguments = checkedList(doPrivilegedInvocation.arguments());

        if (!isStaticImport()) {
            Name accessControllerName;
            if (isUpdateImports()) {
View Full Code Here

    }

    private ClassInstanceCreation createPrivilegedActionCreation(ASTRewrite rewrite, ClassInstanceCreation classLoaderCreation) {
        AST ast = rewrite.getAST();

        ClassInstanceCreation privilegedActionCreation = ast.newClassInstanceCreation();
        ParameterizedType privilegedActionType = createPrivilegedActionType(rewrite, classLoaderCreation);
        AnonymousClassDeclaration anonymousClassDeclaration = createAnonymousClassDeclaration(rewrite, classLoaderCreation);

        privilegedActionCreation.setType(privilegedActionType);
        privilegedActionCreation.setAnonymousClassDeclaration(anonymousClassDeclaration);

        return privilegedActionCreation;
    }
View Full Code Here

      String tagName) throws Exception {
    // visit constructor
    if (javaInfo.getCreationSupport() instanceof ConstructorCreationSupport) {
      ConstructorCreationSupport creationSupport =
          (ConstructorCreationSupport) javaInfo.getCreationSupport();
      ClassInstanceCreation creation = creationSupport.getCreation();
      ConstructorDescription constructorDescription = creationSupport.getDescription();
      List<Expression> arguments = DomGenerics.arguments(creation);
      for (ParameterDescription parameter : constructorDescription.getParameters()) {
        if (parameter.hasTrueTag(tagName)) {
          visitTaggedParameter(visitor, constructorDescription, arguments, parameter);
View Full Code Here

  /**
   * @return the {@link ArrayCreation} of columns in "ColumnModel".
   */
  private ArrayCreation getColumnsArray(boolean ensure) throws Exception {
    ClassInstanceCreation columnModelCreation = getColumnModelCreation(ensure);
    if (columnModelCreation == null) {
      return null;
    }
    // "columns" Array usage in "ColumnModel" creation
    Expression columnArray = DomGenerics.arguments(columnModelCreation).get(0);
View Full Code Here

   */
  private ClassInstanceCreation getColumnModelCreation(boolean ensure) throws Exception {
    // process constructor
    if (getCreationSupport() instanceof ConstructorCreationSupport) {
      ASTNode gridCreation = getCreationSupport().getNode();
      ClassInstanceCreation columnModelCreation = getColumnModelCreation0(gridCreation, ensure);
      if (columnModelCreation != null) {
        return columnModelCreation;
      }
    }
    // process setColumnModel invocation
    MethodInvocation setColumnModelInvocation =
        getMethodInvocation("setColumnModel(com.gwtext.client.widgets.grid.ColumnModel)");
    if (setColumnModelInvocation != null) {
      ClassInstanceCreation columnModelCreation =
          getColumnModelCreation0(setColumnModelInvocation, ensure);
      if (columnModelCreation != null) {
        return columnModelCreation;
      }
    } else {
View Full Code Here

  private void createChildMenu(JavaInfo child) throws Exception {
    // prepare "null" expression to replace with Slider
    Expression menuExpression;
    {
      ClassInstanceCreation fieldCreation =
          ((ConstructorCreationSupport) child.getCreationSupport()).getCreation();
      menuExpression = DomGenerics.arguments(fieldCreation).get(1);
    }
    // create new Menu
    JavaInfo menu =
View Full Code Here

            && getCreationSupport() instanceof ConstructorCreationSupport
            && getMethodInvocations().isEmpty()
            && getFieldAssignments().isEmpty()) {
          ConstructorCreationSupport creationSupport =
              (ConstructorCreationSupport) getCreationSupport();
          ClassInstanceCreation creation = creationSupport.getCreation();
          String signature = creationSupport.getDescription().getSignature();
          // prepare arguments
          List<Expression> arguments = DomGenerics.arguments(creation);
          if (!AstNodeUtils.areLiterals(arguments)) {
            return;
View Full Code Here

   * Replaces arguments of {@link ClassInstanceCreation} and updates
   * {@link ConstructorCreationSupport}.
   */
  private void replaceConstructorArguments(String args) throws Exception {
    ConstructorCreationSupport creationSupport = (ConstructorCreationSupport) getCreationSupport();
    ClassInstanceCreation creation = creationSupport.getCreation();
    getEditor().replaceCreationArguments(creation, ImmutableList.of(args));
    setCreationSupport(new ConstructorCreationSupport(creation));
  }
View Full Code Here

        Component comp = arch.getComponentByName(compName);
        if (comp != null && VIEW_COMPONENT_TYPE.equals(comp.getStyleType())) {
          List<?> constructions = resource.getTypedNodeList(typeDec, ASTNode.CLASS_INSTANCE_CREATION, true);
         
          for (Object constrObj : constructions) {
            ClassInstanceCreation constrInv = (ClassInstanceCreation) constrObj;
            Type type = constrInv.getType();
            ITypeBinding classBinding = type.resolveBinding();
           
            String createdClassCompName = mappingHelper.getComponentName(classBinding);
            if (createdClassCompName != null) {
              Component createdClassComp = arch.getComponentByName(createdClassCompName);
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.ClassInstanceCreation

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.