Package org.eclipse.jdt.core.dom

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


        ensureColumnsAsArray();
        arrayInfo.command_MOVE(column, nextColumn);
      }

      void ensureColumnsAsArray() throws Exception {
        ClassInstanceCreation columnModelCreation = getColumnModelCreation(true);
        // "columns" List usage in "ColumnModel" creation
        List<Expression> columnModelArguments = DomGenerics.arguments(columnModelCreation);
        Expression columnsList = columnModelArguments.get(0);
        if (columnsList instanceof MethodInvocation) {
          MethodInvocation invocation = (MethodInvocation) columnsList;
View Full Code Here


                "com.gwtext.client.widgets.Panel",
                new ConstructorCreationSupport());
        // set CreationSupport
        Expression expression;
        {
          ClassInstanceCreation creation =
              ((ConstructorCreationSupport) getCreationSupport()).getCreation();
          expression = DomGenerics.arguments(creation).get(0);
          String contentSource = content.getCreationSupport().add_getSource(null);
          expression = editor.replaceExpression(expression, contentSource);
          content.getCreationSupport().add_setSourceExpression(expression);
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  public Object getAnchor() throws Exception {
    if (getCreationSupport() instanceof ConstructorCreationSupport) {
      ConstructorCreationSupport creationSupport =
          (ConstructorCreationSupport) getCreationSupport();
      ClassInstanceCreation creation = creationSupport.getCreation();
      Expression anchorExpression = DomGenerics.arguments(creation).get(0);
      return JavaInfoEvaluationHelper.getValue(anchorExpression);
    }
    return Property.UNKNOWN_VALUE;
  }
View Full Code Here

    super.on_setPropertyExpression(property);
    if (getCreationSupport() instanceof ConstructorCreationSupport
        && property.getTitle().equals("size")) {
      ConstructorCreationSupport creationSupport =
          (ConstructorCreationSupport) getCreationSupport();
      ClassInstanceCreation creation = creationSupport.getCreation();
      String signature = creationSupport.getDescription().getSignature();
      if ("<init>(com.extjs.gxt.ui.client.Style.LayoutRegion)".equals(signature)) {
        getEditor().addCreationArgument(creation, 1, "0.0f");
        setCreationSupport(new ConstructorCreationSupport(creation));
      }
View Full Code Here

  private void replaceConstructorArgument(String requiredSignature, String constructorArgument)
      throws Exception {
    if (getCreationSupport() instanceof ConstructorCreationSupport) {
      ConstructorCreationSupport creationSupport =
          (ConstructorCreationSupport) getCreationSupport();
      ClassInstanceCreation creation = creationSupport.getCreation();
      String signature = AstNodeUtils.getCreationSignature(creation);
      if (requiredSignature.equals(signature)) {
        getEditor().replaceCreationArguments(creation, ImmutableList.of(constructorArgument));
        setCreationSupport(new ConstructorCreationSupport(creation));
      }
View Full Code Here

      private void createChildSlider(JavaInfo child) throws Exception {
        // prepare "null" expression to replace with Slider
        Expression sliderExpression;
        {
          ClassInstanceCreation fieldCreation =
              ((ConstructorCreationSupport) child.getCreationSupport()).getCreation();
          sliderExpression = DomGenerics.arguments(fieldCreation).get(0);
        }
        // create new Slider
        SliderInfo slider =
View Full Code Here

  public Object parseValue(Object oldValue, List args) {
    if (oldValue != null && !(oldValue instanceof ResourceIcon)) {
      Icon icon = (Icon) oldValue;
      Expression arg = (Expression) args.get(0);
      if (arg instanceof ClassInstanceCreation) {
        ClassInstanceCreation instanceCreation = (ClassInstanceCreation) arg;
        args = instanceCreation.arguments();
        arg = (Expression) args.get(0);
        if (arg instanceof MethodInvocation) {
          MethodInvocation mi = (MethodInvocation) arg;
          args = mi.arguments();
          arg = (Expression) args.get(0);
View Full Code Here

     * define the return value
     */
    SimpleName returnValueName = ast.newSimpleName("newGXTBean");
    VariableDeclarationFragment fragment = ast.newVariableDeclarationFragment();
    fragment.setName(returnValueName);
    ClassInstanceCreation newClassInstance = ast.newClassInstanceCreation();
    newClassInstance.setType((Type)returnType.copySubtree(ast, returnType));
    fragment.setInitializer(newClassInstance);
    VariableDeclarationStatement returnValue = ast.newVariableDeclarationStatement(fragment);
    returnValue.setType((Type)returnType.copySubtree(ast, returnType));
    block.statements().add(returnValue);
    /*
 
View Full Code Here

     */
    private void _refactor(ClassInstanceCreation node, TypeAnalyzerState state) {
        AST ast = node.getAST();
        CompilationUnit root = (CompilationUnit) node.getRoot();
        Type type = Type.getType(node);
        ClassInstanceCreation newNode = (ClassInstanceCreation) ASTNode
                .copySubtree(ast, node);

        if (SPECIAL_TYPE_MAPPING.containsKey(type.getName())) {
            type = Type.createType(SPECIAL_TYPE_MAPPING.get(type.getName()));
            Name newName = createName(ast, getClassName(type.getName(), state,
                    root));
            newNode.setType(ast.newSimpleType(newName));
            Type.setType(node, type);
        }

        String setCheckpointName = SET_CHECKPOINT_NAME;
        MethodInvocation extraSetCheckpoint = ast.newMethodInvocation();
View Full Code Here

        VariableDeclarationFragment fragment = ast
                .newVariableDeclarationFragment();
        fragment.setName(ast.newSimpleName(CHECKPOINT_NAME));

        ClassInstanceCreation checkpoint = ast.newClassInstanceCreation();
        String typeName = getClassName(Checkpoint.class, state, root);
        checkpoint.setType(ast.newSimpleType(createName(ast, typeName)));
        checkpoint.arguments().add(ast.newThisExpression());
        fragment.setInitializer(checkpoint);

        FieldDeclaration checkpointField = ast.newFieldDeclaration(fragment);
        checkpointField.setType(createType(ast, typeName));
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.