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

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


        "    }",
        "  }",
        "}");
    MenuBarInfo menuBar = getJavaInfoByName("menuBar");
    //
    MenuItemSeparatorInfo newSeparator =
        loadCreationTool("com.google.gwt.user.client.ui.MenuItemSeparator");
    canvas.moveTo(menuBar, 5, 0.5).click();
    assertEditor(
        "// filler filler filler filler filler",
        "public class Test extends FlowPanel {",
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.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);
        List<IMenuItemInfo> items = barObject.getItems();
        assertThat(items).hasSize(1);
        separatorObject = items.get(0);
      }
      // ask IMenuItemInfo directly
      assertNull(separator.getAdapter(List.class));
      assertSame(separatorObject, MenuObjectInfoUtils.getMenuItemInfo(separator));
      // model
      assertSame(separator, separatorObject.getModel());
      assertSame(separator, separatorObject.getToolkitModel());
      // presentation
View Full Code Here

    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
    MenuItemSeparatorInfo newSeparator =
        createJavaInfo("com.google.gwt.user.client.ui.MenuItemSeparator");
    assertTrue(barPolicy.validateCreate(newSeparator));
    barPolicy.commandCreate(newSeparator, null);
    assertEditor(
        "public class Test implements EntryPoint {",
View Full Code Here

        "      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

TOP

Related Classes of com.google.gdt.eclipse.designer.model.widgets.menu.MenuItemSeparatorInfo$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.