Package com.google.gdt.eclipse.designer.smart.model

Examples of com.google.gdt.eclipse.designer.smart.model.CanvasInfo


    MenuItemInfo item = items.get(0);
    assertThat(item.getSubmenu()).isNull();
  }

  public void test_item_CREATE() throws Exception {
    CanvasInfo canvas =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    Canvas canvas = new Canvas();",
            "    Menu menu = new Menu();",
            "    canvas.setContextMenu(menu);",
            "    canvas.draw();",
            "  }",
            "}"});
    canvas.refresh();
    MenuInfo menu = canvas.getChildren(MenuInfo.class).get(0);
    // create new MenuItem
    MenuItemInfo newItem = createJavaInfo("com.smartgwt.client.widgets.menu.MenuItem");
    {
      FlowContainer flowContainer = new FlowContainerFactory(menu, false).get().get(0);
      assertTrue(flowContainer.validateComponent(newItem));
View Full Code Here


        "  }",
        "}");
  }

  public void test_item_MOVE() throws Exception {
    CanvasInfo canvas =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    Canvas canvas = new Canvas();",
            "    Menu menu = new Menu();",
            "    MenuItem menuItem = new MenuItem('MenuItem');",
            "    menu.setItems(menuItem, new MenuItemSeparator());",
            "    canvas.setContextMenu(menu);",
            "    canvas.draw();",
            "  }",
            "}"});
    canvas.refresh();
    MenuInfo menu = canvas.getChildren(MenuInfo.class).get(0);
    //
    List<MenuItemInfo> items = menu.getItems();
    assertThat(items.size()).isEqualTo(2);
    MenuItemInfo item = items.get(0);
    MenuItemInfo separator = items.get(1);
View Full Code Here

        "    rootPanel.add(tabSet, 10, 10);",
        "    tabSet.setSize('250px', '200px');",
        "  }",
        "}");
    // place Button on Tab
    CanvasInfo newButton = createJavaInfo("com.smartgwt.client.widgets.Button");
    {
      SimpleContainer simpleContainer = new SimpleContainerFactory(newTab, false).get().get(1);
      assertTrue(simpleContainer.validateComponent(newButton));
      simpleContainer.command_CREATE(newButton);
    }
View Full Code Here

    rootPanel.refresh();
    //
    TabSetInfo tabSet = (TabSetInfo) rootPanel.getChildrenWidgets().get(0);
    assertThat(tabSet.getChildrenJava()).isEmpty();
    // create new Tab
    CanvasInfo newCanvas = createJavaInfo("com.smartgwt.client.widgets.Button");
    {
      FlowContainer flowContainer = new FlowContainerFactory(tabSet, false).get().get(1);
      assertTrue(flowContainer.validateComponent(newCanvas));
      flowContainer.command_CREATE(newCanvas, null);
    }
View Full Code Here

        "  }",
        "}");
  }

  public void test_canvas_MOVE() throws Exception {
    CanvasInfo canvas =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    Canvas canvas = new Canvas();",
            "    TabSet tabSet = new TabSet();",
            "    {",
            "      Tab tab = new Tab('newTab');",
            "      Button button = new Button('New Button');",
            "      tab.setPane(button);",
            "      tabSet.addTab(tab);",
            "    }",
            "    canvas.addChild(tabSet);",
            "    com.smartgwt.client.widgets.Label label = new com.smartgwt.client.widgets.Label();",
            "    canvas.addChild(label);",
            "    canvas.draw();",
            "  }",
            "}");
    canvas.refresh();
    List<CanvasInfo> children = canvas.getChildren(CanvasInfo.class);
    //
    TabSetInfo tabSet = (TabSetInfo) children.get(0);
    assertThat(tabSet.getTabs().size()).isEqualTo(1);
    CanvasInfo label = children.get(1);
    // add label to TabSet
    tabSet.command_MOVE(label, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
View Full Code Here

  //
  // Test {@link Tab_Info} bounds.
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_tabBounds_top() throws Exception {
    CanvasInfo canvas =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    Canvas canvas = new Canvas();",
            "    TabSet tabSet = new TabSet();",
            "    tabSet.addTab(new Tab('Tab_1'));",
            "    canvas.addChild(tabSet);",
            "    tabSet.moveTo(30, 20);",
            "    canvas.draw();",
            "  }",
            "}"});
    canvas.refresh();
    //
    TabSetInfo tabSet = canvas.getChildren(TabSetInfo.class).get(0);
    // check bounds
    Insets insets = tabSet.getTabInsets();
    int barThickness = tabSet.getTabBarThickness();
    TabInfo selectedTab = tabSet.getSelectedTab();
    Rectangle tabSetBounds = tabSet.getModelBounds();
View Full Code Here

        new Rectangle(insets.left, barThickness + insets.right, tabSetBounds.width
            - insets.getWidth(), tabSetBounds.height - barThickness - insets.getHeight()));
  }

  public void test_tabBounds_left() throws Exception {
    CanvasInfo canvas =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    Canvas canvas = new Canvas();",
            "    TabSet tabSet = new TabSet();",
            "    tabSet.setTabBarPosition(Side.LEFT);",
            "    tabSet.addTab(new Tab('Tab_1'));",
            "    canvas.addChild(tabSet);",
            "    tabSet.moveTo(30, 20);",
            "    canvas.draw();",
            "  }",
            "}"});
    canvas.refresh();
    //
    TabSetInfo tabSet = canvas.getChildren(TabSetInfo.class).get(0);
    // check bounds
    Insets insets = tabSet.getTabInsets();
    int barThickness = tabSet.getTabBarThickness();
    TabInfo selectedTab = tabSet.getSelectedTab();
    Rectangle tabSetBounds = tabSet.getModelBounds();
View Full Code Here

            - barThickness
            - insets.getWidth(), tabSetBounds.height - insets.getHeight()));
  }

  public void test_tabBounds_bottom() throws Exception {
    CanvasInfo canvas =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    Canvas canvas = new Canvas();",
            "    TabSet tabSet = new TabSet();",
            "    tabSet.setTabBarPosition(Side.BOTTOM);",
            "    tabSet.addTab(new Tab('Tab_1'));",
            "    canvas.addChild(tabSet);",
            "    tabSet.moveTo(30, 20);",
            "    canvas.draw();",
            "  }",
            "}"});
    canvas.refresh();
    //
    TabSetInfo tabSet = canvas.getChildren(TabSetInfo.class).get(0);
    // check bounds
    Insets insets = tabSet.getTabInsets();
    int barThickness = tabSet.getTabBarThickness();
    TabInfo selectedTab = tabSet.getSelectedTab();
    Rectangle tabSetBounds = tabSet.getModelBounds();
View Full Code Here

            tabSetBounds.width - insets.getWidth(),
            tabSetBounds.height - barThickness - insets.getHeight()));
  }

  public void test_tabBounds_right() throws Exception {
    CanvasInfo canvas =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    Canvas canvas = new Canvas();",
            "    TabSet tabSet = new TabSet();",
            "    tabSet.setTabBarPosition(Side.RIGHT);",
            "    tabSet.addTab(new Tab('Tab_1'));",
            "    canvas.addChild(tabSet);",
            "    tabSet.moveTo(30, 20);",
            "    canvas.draw();",
            "  }",
            "}"});
    canvas.refresh();
    //
    TabSetInfo tabSet = canvas.getChildren(TabSetInfo.class).get(0);
    // check bounds
    Insets insets = tabSet.getTabInsets();
    int barThickness = tabSet.getTabBarThickness();
    TabInfo selectedTab = tabSet.getSelectedTab();
    Rectangle tabSetBounds = tabSet.getModelBounds();
View Full Code Here

            - barThickness
            - insets.getWidth(), tabSetBounds.height - insets.getHeight()));
  }

  public void test_tabBounds_button() throws Exception {
    CanvasInfo canvas =
        parseJavaInfo(new String[]{
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    Canvas canvas = new Canvas();",
            "    TabSet tabSet = new TabSet();",
            "    Tab tab = new Tab('Tab');",
            "    tab.setPane(new Button('Button'));",
            "    tabSet.addTab(tab);",
            "    canvas.addChild(tabSet);",
            "    tabSet.moveTo(30, 20);",
            "    canvas.draw();",
            "  }",
            "}"});
    canvas.refresh();
    //
    TabSetInfo tabSet = canvas.getChildren(TabSetInfo.class).get(0);
    // check bounds
    Rectangle tabSetBounds = tabSet.getModelBounds();
    Insets insets = tabSet.getTabInsets();
    int barThickness = tabSet.getTabBarThickness();
    TabInfo selectedTab = tabSet.getSelectedTab();
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.smart.model.CanvasInfo

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.