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

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


        // prepare "new Slider()" source
        String sliderSource;
        {
          StatementTarget statementTarget =
              new StatementTarget(AstNodeUtils.getEnclosingStatement(sliderExpression), true);
          NodeTarget nodeTarget = new NodeTarget(statementTarget);
          sliderSource = slider.getCreationSupport().add_getSource(nodeTarget);
        }
        // replace "null" with "new Slider()"
        sliderExpression = getEditor().replaceExpression(sliderExpression, sliderSource);
        slider.setVariableSupport(new EmptyVariableSupport(slider, sliderExpression));
View Full Code Here


    // prepare added invocation
    MethodInvocation invocation = (MethodInvocation) item.getCreationSupport().getNode();
    item.setAssociation(new InvocationVoidAssociation(invocation));
    // configure Widget
    {
      NodeTarget target = new NodeTarget(new StatementTarget(invocation, true));
      Expression widgetExpression =
          editor.replaceInvocationArgument(
              invocation,
              0,
              widget.getCreationSupport().add_getSource(target));
View Full Code Here

          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

            nextColumn);
    addChild(column, nextColumn);
    // add source
    StatementTarget statementTarget =
        new StatementTarget(AstNodeUtils.getEnclosingStatement(columnsArray), true);
    String source = column.getCreationSupport().add_getSource(new NodeTarget(statementTarget));
    getCreateItemExpression(column, arrayInitializer, index, source);
    // set association
    column.setAssociation(new ArrayAssociation(columnsArray));
    // fire after event
    getBroadcastJava().addAfter(this, column);
View Full Code Here

      if (!(column.getVariableSupport() instanceof EmptyVariableSupport)) {
        StatementTarget statementTarget =
            new StatementTarget(AstNodeUtils.getEnclosingStatement(columnsArray), true);
        column.getVariableSupport().ensureInstanceReadyAt(statementTarget);
        source =
            column.getVariableSupport().getReferenceExpression(new NodeTarget(statementTarget));
      }
      Assert.isNotNull(source, "No source found for.");
      getCreateItemExpression(column, arrayInitializer, newIndex, source);
    }
    // set association
View Full Code Here

    // prepare "new Menu()" source
    String menuSource;
    {
      StatementTarget statementTarget =
          new StatementTarget(AstNodeUtils.getEnclosingStatement(menuExpression), true);
      NodeTarget nodeTarget = new NodeTarget(statementTarget);
      menuSource = menu.getCreationSupport().add_getSource(nodeTarget);
    }
    // replace "null" with "new Menu()"
    menuExpression = getEditor().replaceExpression(menuExpression, menuSource);
    menu.setVariableSupport(new EmptyVariableSupport(menu, menuExpression));
View Full Code Here

  // Utilities
  //
  ////////////////////////////////////////////////////////////////////////////
  private void prepareForAssignTo(JavaInfo component) throws Exception {
    // ensure that value component is accessible
    NodeTarget nodeTarget = JavaInfoUtils.getNodeTarget_afterCreation(component);
    if (JavaInfoUtils.isCreatedAtTarget(this, nodeTarget)) {
      return;
    }
    // try convert to "lazy"
    if (LazyVariableSupportUtils.canConvert(this)) {
View Full Code Here

            "}");
    WidgetInfo button = container.getWidgets().get(0);
    LayoutDataInfo layoutData = LayoutInfo.getLayoutData(button);
    // do materialize
    {
      NodeTarget target = getNodeStatementTarget(container, false, 1);
      assertEquals("rowData.", layoutData.getVariableSupport().getAccessExpression(target));
    }
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  private RowData rowData;",
View Full Code Here

      fail();
    } catch (IllegalStateException e) {
    }
    // materialize
    {
      NodeTarget target = getNodeStatementTarget(panel, false, 1, 1);
      assertEquals("rowLayoutData.", variable.getAccessExpression(target));
      assertHierarchy(
          "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/ /add(label, rowLayoutData)/}",
          "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}",
          "  {new: com.gwtext.client.widgets.form.Label} {local-unique: label} {/new Label()/ /add(label, rowLayoutData)/}",
View Full Code Here

            "}");
    LayoutInfo layout = panel.getLayout();
    assertInstanceOf(ImplicitLayoutCreationSupport.class, layout.getCreationSupport());
    // materialize by asking for expression
    {
      NodeTarget target = getNodeBlockTarget(panel, false);
      String accessExpression = layout.getVariableSupport().getAccessExpression(target);
      assertEquals("rowLayout.", accessExpression);
    }
    // check creation/variable/association
    assertInstanceOf(ImplicitLayoutCreationSupport.class, layout.getCreationSupport());
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.utils.ast.NodeTarget

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.