Package com.google.gdt.eclipse.designer.model.widgets.menu

Examples of com.google.gdt.eclipse.designer.model.widgets.menu.MenuItemInfo$MenuItemImpl


        "    }",
        "  }",
        "}");
    MenuBarInfo menuBar = getJavaInfoByName("menuBar");
    //
    MenuItemInfo newItem = loadCreationTool("com.google.gwt.user.client.ui.MenuItem");
    canvas.moveTo(menuBar, 5, 0.5).click();
    assertEditor(
        "// filler filler filler filler filler",
        "public class Test extends FlowPanel {",
        "  public Test() {",
View Full Code Here


        "        menuBar.addItem(subMenuItem);",
        "      }",
        "    }",
        "  }",
        "}");
    MenuItemInfo subMenuItem = getJavaInfoByName("subMenuItem");
    MenuBarInfo subMenu = getJavaInfoByName("subMenu");
    //
    loadCreationTool("com.google.gwt.user.client.ui.MenuItem");
    // initially no EditPart for "subMenu"
    canvas.assertNullEditPart(subMenu);
View Full Code Here

        configure(editPart, widget);
      }
    }
    // policies for MenuItem
    if (editPart.getModel() instanceof MenuItemInfo) {
      MenuItemInfo item = (MenuItemInfo) editPart.getModel();
      editPart.installEditPolicy(new OpenMenuItemCommandEditPolicy(item));
    }
  }
View Full Code Here

            "    }",
            "  }",
            "}");
    refresh();
    MenuBarInfo bar = getJavaInfoByName("bar");
    final MenuItemInfo item = bar.getItems().get(0);
    //
    RunnableEx runnable = new RunnableEx() {
      public void run() throws Exception {
        IAction action = findChildAction(getContextMenu(item), "Open Command");
        assertNotNull(action);
View Full Code Here

            "    }",
            "  }",
            "}");
    refresh();
    MenuBarInfo bar = getJavaInfoByName("bar");
    MenuItemInfo item = bar.getItems().get(0);
    // set mock for DesignPageSite
    IDesignPageSite pageSite;
    Capture<Integer> openSourcePosition = new Capture<Integer>();
    {
      pageSite = EasyMock.createStrictMock(IDesignPageSite.class);
      pageSite.openSourcePosition(capture(openSourcePosition));
      EasyMock.replay(pageSite);
      // do set
      DesignPageSite.Helper.setSite(frame, pageSite);
    }
    // open Command
    item.openCommand();
    waitEventLoop(0);
    EasyMock.verify(pageSite);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
View Full Code Here

    assertHierarchy(
        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(bar)/}",
        "  {new: com.google.gwt.user.client.ui.MenuBar} {local-unique: bar} {/new MenuBar()/ /rootPanel.add(bar)/ /bar.addItem(menuItem)/}",
        "    {new: com.google.gwt.user.client.ui.MenuItem} {local-unique: menuItem} {/new MenuItem('A', (Command) null)/ /bar.addItem(menuItem)/}");
    MenuBarInfo bar = getJavaInfoByName("bar");
    MenuItemInfo item = bar.getItems().get(0);
    // association
    assertInstanceOf(InvocationChildAssociation.class, item.getAssociation());
    // only item in "bar"
    assertThat(bar.getAllItems()).containsOnly(item);
    // check "Constructor" property
    {
      assertNotNull(PropertyUtils.getByPath(item, "Constructor/text"));
      assertNotNull(PropertyUtils.getByPath(item, "Constructor/cmd"));
    }
    // check "text" property
    Property textProperty = item.getPropertyByTitle("text");
    assertEquals("A", textProperty.getValue());
    textProperty.setValue("B");
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
View Full Code Here

    assertHierarchy(
        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(bar)/}",
        "  {new: com.google.gwt.user.client.ui.MenuBar} {local-unique: bar} {/new MenuBar()/ /rootPanel.add(bar)/ /bar.addItem('A', (Command) null)/}",
        "    {implicit-factory} {empty} {/bar.addItem('A', (Command) null)/}");
    MenuBarInfo bar = getJavaInfoByName("bar");
    MenuItemInfo item = bar.getItems().get(0);
    // association
    assertInstanceOf(InvocationVoidAssociation.class, item.getAssociation());
    // only item in "bar"
    assertThat(bar.getAllItems()).containsOnly(item);
    // check "Factory" property
    {
      assertNotNull(PropertyUtils.getByPath(item, "Factory/text"));
      assertNotNull(PropertyUtils.getByPath(item, "Factory/cmd"));
    }
    // check "text" property
    Property textProperty = item.getPropertyByTitle("text");
    assertEquals("A", textProperty.getValue());
    textProperty.setValue("B");
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
View Full Code Here

        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(bar)/}",
        "  {new: com.google.gwt.user.client.ui.MenuBar} {local-unique: bar} {/new MenuBar()/ /rootPanel.add(bar)/ /bar.addItem('Sub', subMenu)/}",
        "    {implicit-factory} {empty} {/bar.addItem('Sub', subMenu)/}",
        "      {new: com.google.gwt.user.client.ui.MenuBar} {local-unique: subMenu} {/new MenuBar(false)/ /bar.addItem('Sub', subMenu)/}");
    MenuBarInfo bar = getJavaInfoByName("bar");
    MenuItemInfo item = bar.getItems().get(0);
    MenuBarInfo subMenu = item.getSubMenu();
    assertThat(subMenu.getAssociation()).isInstanceOf(ImplicitFactoryArgumentAssociation.class);
    // clipboard
    assertClipboardSource(
        item,
        "%parent%.addItem(\"Sub\", (com.google.gwt.user.client.ui.MenuBar) null)");
View Full Code Here

        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(bar)/}",
        "  {new: com.google.gwt.user.client.ui.MenuBar} {local-unique: bar} {/new MenuBar()/ /rootPanel.add(bar)/ /bar.addItem(menuItem)/}",
        "    {new: com.google.gwt.user.client.ui.MenuItem} {local-unique: menuItem} {/new MenuItem('Sub', subMenu)/ /bar.addItem(menuItem)/}",
        "      {new: com.google.gwt.user.client.ui.MenuBar} {local-unique: subMenu} {/new MenuBar(false)/ /new MenuItem('Sub', subMenu)/}");
    MenuBarInfo bar = getJavaInfoByName("bar");
    MenuItemInfo item = bar.getItems().get(0);
    MenuBarInfo subMenu = item.getSubMenu();
    assertThat(item.getAssociation()).isInstanceOf(InvocationChildAssociation.class);
    assertThat(subMenu.getAssociation()).isInstanceOf(ConstructorChildAssociation.class);
    // clipboard
    assertClipboardSource(
        item,
        "new com.google.gwt.user.client.ui.MenuItem(\"Sub\", (com.google.gwt.user.client.ui.MenuBar) null)");
View Full Code Here

            "    bar.addItem('Separate item', (Command) null);",
            "  }",
            "}");
    refresh();
    MenuBarInfo menu = (MenuBarInfo) frame.getChildrenWidgets().get(0);
    MenuItemInfo item_1 = menu.getItems().get(0);
    MenuItemInfo item_2 = menu.getItems().get(1);
    MenuBarInfo subMenu = item_1.getSubMenu();
    MenuItemInfo subMenuItem_1 = subMenu.getItems().get(0);
    MenuItemInfo subMenuItem_2 = subMenu.getItems().get(1);
    // bad adapters
    {
      assertNull(menu.getAdapter(List.class));
      assertNull(item_1.getAdapter(List.class));
    }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.widgets.menu.MenuItemInfo$MenuItemImpl

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.