Package org.eclipse.jdt.core.dom

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


      List<VariableDeclaration> astParameters = ((MethodDeclaration) methods.get(0).getInternal()).parameters();

      ParameterSource<O> param = null;
      for (VariableDeclaration declaration : astParameters)
      {
         VariableDeclaration copy = (VariableDeclaration) ASTNode.copySubtree(method.getAST(), declaration);
         method.parameters().add(copy);
         param = new ParameterImpl<O>(parent, copy);
      }
      return param;
   }
View Full Code Here


      List<VariableDeclaration> astParameters = ((MethodDeclaration) methods.get(0).getInternal()).parameters();

      method.parameters().clear();
      for (VariableDeclaration declaration : astParameters)
      {
         VariableDeclaration copy = (VariableDeclaration) ASTNode.copySubtree(method.getAST(), declaration);
         method.parameters().add(copy);
      }

      return this;
   }
View Full Code Here

      List<VariableDeclaration> astParameters = ((MethodDeclaration) methods.get(0).getInternal()).parameters();

      method.parameters().clear();
      for (VariableDeclaration declaration : astParameters)
      {
         VariableDeclaration copy = (VariableDeclaration) ASTNode.copySubtree(method.getAST(), declaration);
         method.parameters().add(copy);
      }

      return this;
   }
View Full Code Here

      List<VariableDeclaration> astParameters = ((MethodDeclaration) methods.get(0).getInternal()).parameters();

      ParameterSource<O> param = null;
      for (VariableDeclaration declaration : astParameters)
      {
         VariableDeclaration copy = (VariableDeclaration) ASTNode.copySubtree(method.getAST(), declaration);
         method.parameters().add(copy);
         param = new ParameterImpl<O>(parent, copy);
      }
      return param;
   }
View Full Code Here

        return (ArrayCreation) columnArray;
      }
      if (AstNodeUtils.isVariable(columnArray)) {
        ASTNode lastAssignment = ExecutionFlowUtils.getLastAssignment(flowDescription, columnArray);
        if (lastAssignment instanceof VariableDeclaration) {
          VariableDeclaration variableDeclaration = (VariableDeclaration) lastAssignment;
          columnArray = variableDeclaration.getInitializer();
          continue;
        }
      }
      if (ensure) {
        return (ArrayCreation) getEditor().replaceExpression(
View Full Code Here

          }
          if (AstNodeUtils.isVariable(argument)) {
            ASTNode lastAssignment =
                ExecutionFlowUtils.getLastAssignment(flowDescription, argument);
            if (lastAssignment instanceof VariableDeclaration) {
              VariableDeclaration variableDeclaration = (VariableDeclaration) lastAssignment;
              argument = variableDeclaration.getInitializer();
              continue;
            }
          }
          if (ensure) {
            return (ClassInstanceCreation) getEditor().replaceExpression(
View Full Code Here

          if (EventHandlerProperty.isObjectHandler(methodDeclaration, name)) {
            editor.removeBodyDeclaration(methodDeclaration);
          }
        }
        // remove field
        VariableDeclaration variable = getBinderField(typeDeclaration, name);
        FieldDeclaration field = AstNodeUtils.getEnclosingFieldDeclaration(variable);
        editor.removeBodyDeclaration(field);
      }
    }
  }
View Full Code Here

  private void setName(String name) throws Exception {
    AstEditor editor = getEditor();
    TypeDeclaration typeDeclaration = editor.getPrimaryType();
    // prepare "old" state
    String oldName = getName();
    VariableDeclaration oldVariable = getBinderField(typeDeclaration, oldName);
    // set "ui:field" attribute
    {
      String nameAttribute = getNameAttribute();
      m_object.setAttribute(nameAttribute, name);
    }
View Full Code Here

    // replace ui-field type
    AstEditor formEditor = newComponent.getContext().getFormEditor();
    if (!StringUtils.isEmpty(uiFieldName) && formEditor != null) {
      //NameSupport.setName(newComponent, uiFieldName);
      TypeDeclaration typeDeclaration = formEditor.getPrimaryType();
      VariableDeclaration variableDeclaration =
          NameSupport.getBinderField(typeDeclaration, uiFieldName);
      if (variableDeclaration != null) {
        formEditor.replaceVariableType(
            variableDeclaration,
            ReflectionUtils.getCanonicalName(newComponent.getDescription().getComponentClass()));
View Full Code Here

      List<VariableDeclaration> astParameters = ((MethodDeclaration) methods.get(0).getInternal()).parameters();

      method.parameters().clear();
      for (VariableDeclaration declaration : astParameters)
      {
         VariableDeclaration copy = (VariableDeclaration) ASTNode.copySubtree(method.getAST(), declaration);
         method.parameters().add(copy);
      }

      return this;
   }
View Full Code Here

TOP

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

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.