Package org.eclipse.wb.internal.core.model.creation

Examples of org.eclipse.wb.internal.core.model.creation.CreationSupport


  private void createVirtualLayoutData(WidgetInfo widget) throws Exception {
    Object dataObject = getDefaultVirtualDataObject(widget);
    // create model
    JavaInfo layoutData;
    {
      CreationSupport creationSupport = new VirtualLayoutDataCreationSupport(widget, dataObject);
      layoutData =
          JavaInfoUtils.createJavaInfo(getEditor(), getLayoutDataClass(widget), creationSupport);
    }
    // configure
    layoutData.setVariableSupport(new VirtualLayoutDataVariableSupport(layoutData));
View Full Code Here


    if (hasLayout()) {
      AstEditor editor = getEditor();
      Object layout = ReflectionUtils.invokeMethod(getObject(), "getLayout()");
      // create implicit layout model
      LayoutInfo implicitLayout;
      CreationSupport creationSupport = new ImplicitLayoutCreationSupport(this);
      if (layout == null) {
        implicitLayout = createDefaultImplicitLayout(creationSupport);
      } else {
        implicitLayout =
            (LayoutInfo) JavaInfoUtils.createJavaInfo(editor, layout.getClass(), creationSupport);
View Full Code Here

      if (initialize_removeImplicitLayout(layout)) {
        return;
      }
      // create layout model
      LayoutInfo implicitLayout;
      CreationSupport creationSupport = new ImplicitLayoutCreationSupport(this);
      if (layout == null) {
        implicitLayout = createDefaultImplicitLayout(editor, creationSupport);
      } else {
        Class<?> layoutClass = layout.getClass();
        implicitLayout =
View Full Code Here

        "    }",
        "  }",
        "}");
    // permissions
    {
      CreationSupport creationSupport = newImage.getCreationSupport();
      assertTrue(creationSupport.canReorder());
      assertTrue(creationSupport.canReparent());
      assertTrue(creationSupport.canDelete());
    }
    // assert that "image" is bound to AST
    {
      ASTNode node = getNode("image = ");
      assertTrue(newImage.isRepresentedBy(node));
View Full Code Here

            "  }",
            "}");
    frame.refresh();
    ImageInfo image = (ImageInfo) frame.getChildrenWidgets().get(0);
    //
    CreationSupport creationSupport = image.getCreationSupport();
    // permissions
    assertTrue(creationSupport.canReorder());
    assertTrue(creationSupport.canReparent());
    // delete
    assertTrue(creationSupport.canDelete());
    image.delete();
    assertEditor(
        "public class Test implements EntryPoint {",
        "  private static final MyImageBundle m_myBundle = GWT.create(MyImageBundle.class);",
        "  public void onModuleLoad() {",
View Full Code Here

      Class<?> componentClass = getClass(editor, typeBinding);
      if (componentClass == null) {
        return null;
      }
      // create JavaInfo
      CreationSupport creationSupport = new ConstructorCreationSupport(creation);
      return JavaInfoUtils.createJavaInfo(editor, componentClass, creationSupport);
    }
    // unknown class
    return null;
  }
View Full Code Here

  }

  static void command_CREATE_Widget(JavaInfo host, WidgetInfo widget) throws Exception {
    AstEditor editor = host.getEditor();
    // prepare CreationSupport for TreeItem
    CreationSupport creationSupport;
    {
      String signature = "addItem(com.google.gwt.user.client.ui.Widget)";
      String source = "addItem((com.google.gwt.user.client.ui.Widget) null)";
      creationSupport = new ImplicitFactoryCreationSupport(host, signature, source);
    }
View Full Code Here

    Object dataObject = getDefaultVirtualDataObject();
    // create model
    JavaInfo layoutData;
    {
      AstEditor editor = getContainer().getEditor();
      CreationSupport creationSupport = new VirtualLayoutDataCreationSupport(widget, dataObject);
      layoutData = JavaInfoUtils.createJavaInfo(editor, getLayoutDataClass(), creationSupport);
    }
    // configure
    layoutData.setVariableSupport(new VirtualLayoutDataVariableSupport(layoutData));
    layoutData.setAssociation(new EmptyAssociation());
View Full Code Here

        "    {virtual-layout_data: com.extjs.gxt.ui.client.widget.layout.RowData} {virtual-layout-data} {}");
    WidgetInfo button = container.getWidgets().get(0);
    LayoutDataInfo layoutData = LayoutInfo.getLayoutData(button);
    // CreationSupport
    {
      CreationSupport creationSupport = layoutData.getCreationSupport();
      assertInstanceOf(VirtualLayoutDataCreationSupport.class, creationSupport);
      assertEquals(
          "virtual-layout_data: com.extjs.gxt.ui.client.widget.layout.RowData",
          creationSupport.toString());
      assertFalse(creationSupport.isJavaInfo(null));
      assertEquals(null, creationSupport.getNode());
      assertEquals(null, ((IImplicitCreationSupport) creationSupport).getImplicitClipboard());
    }
    // VariableSupport
    {
      VariableSupport variableSupport = layoutData.getVariableSupport();
View Full Code Here

        "}");
    MenuBarInfo bar = getJavaInfoByName("bar");
    IMenuInfo barObject = MenuObjectInfoUtils.getMenuInfo(bar);
    IMenuPolicy policy = barObject.getPolicy();
    // prepare CreationSupport
    CreationSupport creationSupport;
    {
      String signature = "addItem(java.lang.String,boolean,com.google.gwt.user.client.Command)";
      String source = "addItem(\"New item\", false, (com.google.gwt.user.client.Command) null)";
      creationSupport = new ImplicitFactoryCreationSupport(signature, source);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.model.creation.CreationSupport

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.