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

Examples of com.google.gdt.eclipse.designer.model.widgets.menu.MenuBarInfo$MenuAbstractImpl


    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('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


    refresh();
    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.addSeparator(separator)/}",
        "    {new: com.google.gwt.user.client.ui.MenuItemSeparator} {local-unique: separator} {/new MenuItemSeparator()/ /bar.addSeparator(separator)/}");
    MenuBarInfo bar = getJavaInfoByName("bar");
    MenuItemSeparatorInfo separator = (MenuItemSeparatorInfo) bar.getAllItems().get(0);
    // association
    assertInstanceOf(InvocationChildAssociation.class, separator.getAssociation());
    // only item in "bar"
    assertThat(bar.getAllItems()).containsOnly(separator);
    // IMenuItemInfo
    {
      IMenuItemInfo separatorObject;
      {
        IMenuInfo barObject = MenuObjectInfoUtils.getMenuInfo(bar);
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

    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('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 subMenu = getJavaInfoByName("subMenu");
    // delete "subMenu", should delete also "item"
    subMenu.delete();
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    MenuBar bar = new MenuBar();",
View Full Code Here

        "      MenuBar subMenu = new MenuBar(false);",
        "      bar.addItem('Sub', subMenu);",
        "    }",
        "  }",
        "}");
    MenuBarInfo bar = getJavaInfoByName("bar");
    // delete "bar" fully
    bar.delete();
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "  }",
View Full Code Here

        "    RootPanel rootPanel = RootPanel.get();",
        "    MenuBar bar = new MenuBar();",
        "    rootPanel.add(bar);",
        "  }",
        "}");
    MenuBarInfo bar = getJavaInfoByName("bar");
    IMenuInfo barObject = MenuObjectInfoUtils.getMenuInfo(bar);
    IMenuPolicy barPolicy = barObject.getPolicy();
    // don't accept something other than MenuItem or MenuItemSeparator
    assertFalse(barPolicy.validateCreate(new Object()));
    // create new MenuItemSeparator
View Full Code Here

        "      MenuItem menuItem = new MenuItem('Item', false, (Command) null);",
        "      bar.addItem(menuItem);",
        "    }",
        "  }",
        "}");
    MenuBarInfo bar = getJavaInfoByName("bar");
    MenuItemSeparatorInfo separator = (MenuItemSeparatorInfo) bar.getAllItems().get(0);
    IMenuInfo barObject = MenuObjectInfoUtils.getMenuInfo(bar);
    IMenuPolicy barPolicy = barObject.getPolicy();
    // don't accept something other than MenuItem or MenuItemSeparator
    assertFalse(barPolicy.validateMove(new Object()));
    assertTrue(barPolicy.validateMove(separator));
View Full Code Here

        "    RootPanel rootPanel = RootPanel.get();",
        "    MenuBar bar = new MenuBar();",
        "    rootPanel.add(bar);",
        "  }",
        "}");
    MenuBarInfo bar = getJavaInfoByName("bar");
    IMenuInfo barObject = MenuObjectInfoUtils.getMenuInfo(bar);
    IMenuPolicy policy = barObject.getPolicy();
    // don't accept something other than MenuItem
    assertFalse(policy.validateCreate(new Object()));
    // create new MenuItem
View Full Code Here

        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    rootPanel.add(bar);",
        "  }",
        "}");
    MenuBarInfo bar = getJavaInfoByName("bar");
    IMenuPolicy policy = MenuObjectInfoUtils.getMenuInfo(bar).getPolicy();
    // use "field initializer"
    {
      GenerationSettings generationSettings =
          GwtToolkitDescription.INSTANCE.getGenerationSettings();
View Full Code Here

        "    RootPanel rootPanel = RootPanel.get();",
        "    MenuBar bar = new MenuBar();",
        "    rootPanel.add(bar);",
        "  }",
        "}");
    MenuBarInfo bar = getJavaInfoByName("bar");
    IMenuInfo barObject = MenuObjectInfoUtils.getMenuInfo(bar);
    IMenuPolicy policy = barObject.getPolicy();
    // prepare CreationSupport
    CreationSupport creationSupport;
    {
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.widgets.menu.MenuBarInfo$MenuAbstractImpl

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.