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

Examples of org.eclipse.wb.internal.core.model.menu.IMenuPolicy


        "  }",
        "}");
    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));
    barPolicy.commandMove(separator, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    MenuBar bar = new MenuBar();",
View Full Code Here


        "    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
    MenuItemInfo newItem = createJavaInfo("com.google.gwt.user.client.ui.MenuItem");
    assertTrue(policy.validateCreate(newItem));
    policy.commandCreate(newItem, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    MenuBar bar = new MenuBar();",
View Full Code Here

        "    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();
      generationSettings.setVariable(FieldInitializerVariableDescription.INSTANCE);
    }
    // create new MenuItem
    MenuItemInfo newItem = createJavaInfo("com.google.gwt.user.client.ui.MenuItem", "withSubMenu");
    assertTrue(policy.validateCreate(newItem));
    policy.commandCreate(newItem, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  private final MenuBar bar = new MenuBar();",
        "  private MenuItem menuItem;",
        "  public void onModuleLoad() {",
View Full Code Here

        "    rootPanel.add(bar);",
        "  }",
        "}");
    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);
    }
    // create new MenuItem
    MenuItemInfo newItem =
        (MenuItemInfo) JavaInfoUtils.createJavaInfo(
            m_lastEditor,
            "com.google.gwt.user.client.ui.MenuItem",
            creationSupport);
    assertTrue(policy.validateCreate(newItem));
    policy.commandCreate(newItem, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    MenuBar bar = new MenuBar();",
View Full Code Here

        "    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
    MenuItemInfo newItem = createJavaInfo("com.google.gwt.user.client.ui.MenuItem", "withSubMenu");
    assertTrue(policy.validateCreate(newItem));
    policy.commandCreate(newItem, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    MenuBar bar = new MenuBar();",
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.model.menu.IMenuPolicy

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.