org.uberfire.workbench.model.menu.MenuItem.getCaption()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中org.uberfire.workbench.model.menu.MenuItem.getCaption()方法的一些代码示例,展示了MenuItem.getCaption()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MenuItem.getCaption()方法的具体详情如下:
包路径:org.uberfire.workbench.model.menu.MenuItem
类名称:MenuItem
方法名:getCaption

暂无

代码示例

代码示例来源:origin: org.kie.workbench.widgets/kie-wb-common-ui

@Override
  public int compare( final MenuItem o1,
            final MenuItem o2 ) {
    return o1.getCaption().compareToIgnoreCase( o2.getCaption() );
  }
} );

代码示例来源:origin: org.kie.workbench.widgets/kie-wb-common-ui

@Override
  public int compare( final MenuItem o1,
            final MenuItem o2 ) {
    return o1.getCaption().compareToIgnoreCase( o2.getCaption() );
  }
} );

代码示例来源:origin: kiegroup/appformer

private String getMenuItemId(final MenuItem menuItem) {
  return menuItem.getIdentifier() == null ? menuItem.getCaption() : menuItem.getIdentifier();
}

代码示例来源:origin: kiegroup/appformer

public static String getMenuItemId(final MenuItem menuItem) {
    return menuItem.getIdentifier() == null ? menuItem.getCaption() : menuItem.getIdentifier();
  }
}

代码示例来源:origin: kiegroup/appformer

protected AnchorListItem createListItem(final MenuItem menuItem,
                    final HasMenuItems hasMenuItems) {
  final AnchorListItem option = GWT.create(AnchorListItem.class);
  option.setText(menuItem.getCaption());
  setupEnableDisable(menuItem,
            option);
  hasMenuItems.addMenuItem(menuItem.getPosition(),
               option);
  return option;
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-bs2

Widget makeNavLink( final MenuItem item ) {
  final NavLink gwtItem = new NavLink( item.getCaption() ) {{
    setDisabled( !item.isEnabled() );
  }};
  item.addEnabledStateChangeListener( new EnabledStateChangeListener() {
    @Override
    public void enabledStateChanged( final boolean enabled ) {
      gwtItem.setDisabled( !enabled );
    }
  } );
  return gwtItem;
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly

protected AnchorListItem createListItem(final MenuItem menuItem,
                    final HasMenuItems hasMenuItems) {
  final AnchorListItem option = GWT.create(AnchorListItem.class);
  option.setText(menuItem.getCaption());
  setupEnableDisable(menuItem,
            option);
  hasMenuItems.addMenuItem(menuItem.getPosition(),
               option);
  return option;
}

代码示例来源:origin: kiegroup/drools-wb

private boolean getMenuState(final Menus menus,
               final MenuItems menuItem) {
  return menus.getItems().stream().filter(m -> m.getIdentifier() != null).filter(m -> m.getCaption().toLowerCase().equals(menuItem.name().toLowerCase())).findFirst().get().isEnabled();
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-workbench-client

@Test
public void getAuthoringViewsTest() {
  List<? extends MenuItem> authoringMenuItems = menusHelper.getAuthoringViews();
  assertEquals(3,
         authoringMenuItems.size());
  assertEquals(menusHelper.constants.ProjectAuthoring(),
         authoringMenuItems.get(0).getCaption());
  assertEquals(menusHelper.constants.ArtifactRepository(),
         authoringMenuItems.get(1).getCaption());
  assertEquals(menusHelper.constants.Administration(),
         authoringMenuItems.get(2).getCaption());
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-workbench-client

@Test
public void getExtensionsViewsTest() {
  List<? extends MenuItem> extensionsMenuItems = menusHelper.getExtensionsViews();
  assertEquals(4,
         extensionsMenuItems.size());
  assertEquals(menusHelper.constants.Plugins(),
         extensionsMenuItems.get(0).getCaption());
  assertEquals(menusHelper.constants.Apps(),
         extensionsMenuItems.get(1).getCaption());
  assertEquals(menusHelper.constants.DataSets(),
         extensionsMenuItems.get(2).getCaption());
  assertEquals(menusHelper.constants.DataSources(),
         extensionsMenuItems.get(3).getCaption());
}

代码示例来源:origin: kiegroup/jbpm-wb

@Test
public void getAuthoringViewsTest() {
  List<? extends MenuItem> authoringMenuItems = showcaseEntryPoint.getAuthoringViews();
  assertEquals(3,
         authoringMenuItems.size());
  assertEquals(showcaseEntryPoint.constants.Project_Authoring(),
         authoringMenuItems.get(0).getCaption());
  assertEquals(showcaseEntryPoint.constants.artifactRepository(),
         authoringMenuItems.get(1).getCaption());
  assertEquals(showcaseEntryPoint.constants.Administration(),
         authoringMenuItems.get(2).getCaption());
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-workbench-client

@Test
public void getHomeViewsWithSocial() {
  final boolean socialEnabled = true;
  List<? extends MenuItem> homeMenuItems = menusHelper.getHomeViews(socialEnabled);
  assertEquals(4,
         homeMenuItems.size());
  assertEquals(menusHelper.constants.HomePage(),
         homeMenuItems.get(0).getCaption());
  assertEquals(menusHelper.constants.Admin(),
         homeMenuItems.get(1).getCaption());
  assertEquals(menusHelper.constants.Timeline(),
         homeMenuItems.get(2).getCaption());
  assertEquals(menusHelper.constants.People(),
         homeMenuItems.get(3).getCaption());
}

代码示例来源:origin: kiegroup/jbpm-wb

@Test
public void getWorkViewsTest() {
  List<? extends MenuItem> workMenuItems = showcaseEntryPoint.getWorkViews();
  assertEquals(3,
         workMenuItems.size());
  assertEquals(showcaseEntryPoint.commonConstants.Task_Inbox(),
         workMenuItems.get(0).getCaption());
  assertEquals(showcaseEntryPoint.constants.Tasks_List_Admin(),
         workMenuItems.get(1).getCaption());
  assertEquals(showcaseEntryPoint.constants.Data_Sets(),
         workMenuItems.get(2).getCaption());
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-workbench-client

private void checkIfMenuContainsRole(final List<Menus> menusList,
                   String role) {
  assertContains(menusList,
          (menus) -> contains(((Menus) menus).getItems(),
                    (menuItem) -> ((MenuItem) menuItem)
                        .getCaption().equals(role)
          )
  );
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-workbench-client

@Test
public void getProcessManagementViewsTest() {
  List<? extends MenuItem> processManagementMenuItems = menusHelper.getProcessManagementViews();
  assertEquals(2,
         processManagementMenuItems.size());
  assertEquals(menusHelper.constants.ProcessDefinitions(),
         processManagementMenuItems.get(0).getCaption());
  assertEquals(menusHelper.constants.ProcessInstances(),
         processManagementMenuItems.get(1).getCaption());
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-workbench-client

@Test
public void getHomeViewsWithoutSocial() {
  final boolean socialEnabled = false;
  List<? extends MenuItem> homeMenuItems = menusHelper.getHomeViews(socialEnabled);
  assertEquals(2,
         homeMenuItems.size());
  assertEquals(menusHelper.constants.HomePage(),
         homeMenuItems.get(0).getCaption());
  assertEquals(menusHelper.constants.Admin(),
         homeMenuItems.get(1).getCaption());
}

代码示例来源:origin: kiegroup/jbpm-wb

@Test
public void getDeploymentViewsTest() {
  List<? extends MenuItem> deploymentMenuItems = showcaseEntryPoint.getDeploymentViews();
  assertEquals(2,
         deploymentMenuItems.size());
  assertEquals(showcaseEntryPoint.constants.Execution_Servers(),
         deploymentMenuItems.get(0).getCaption());
  assertEquals(showcaseEntryPoint.commonConstants.Jobs(),
         deploymentMenuItems.get(1).getCaption());
}

代码示例来源:origin: kiegroup/jbpm-wb

@Test
public void getProcessManagementViewsTest() {
  List<? extends MenuItem> processManagementMenuItems = showcaseEntryPoint.getProcessManagementViews();
  assertEquals(5,
         processManagementMenuItems.size());
  assertEquals(showcaseEntryPoint.commonConstants.Process_Definitions(),
         processManagementMenuItems.get(0).getCaption());
  assertEquals(showcaseEntryPoint.commonConstants.Process_Instances(),
         processManagementMenuItems.get(1).getCaption());
  assertEquals(showcaseEntryPoint.constants.Process_Instances_Admin(),
         processManagementMenuItems.get(2).getCaption());
  assertEquals(showcaseEntryPoint.commonConstants.Tasks(),
         processManagementMenuItems.get(3).getCaption());
  assertEquals(showcaseEntryPoint.commonConstants.ExecutionErrors(),
         processManagementMenuItems.get(4).getCaption());
}

代码示例来源:origin: kiegroup/jbpm-wb

@Test
public void getDashboardsViewsTest() {
  List<? extends MenuItem> dashboardsMenuItems = showcaseEntryPoint.getDashboardsViews();
  assertEquals(2,
         dashboardsMenuItems.size());
  assertEquals(showcaseEntryPoint.constants.Process_Reports(),
         dashboardsMenuItems.get(0).getCaption());
  assertEquals(showcaseEntryPoint.constants.Task_Reports(),
         dashboardsMenuItems.get(1).getCaption());
}

代码示例来源:origin: kiegroup/jbpm-wb

@Test
public void setupMenuTest() {
  showcaseEntryPoint.setupMenu();
  ArgumentCaptor<Menus> menusCaptor = ArgumentCaptor.forClass(Menus.class);
  verify(menuBar).addMenus(menusCaptor.capture());
  Menus menus = menusCaptor.getValue();
  assertEquals(6,
         menus.getItems().size());
  assertEquals(showcaseEntryPoint.constants.Authoring(),
         menus.getItems().get(0).getCaption());
  assertEquals(showcaseEntryPoint.constants.Deploy(),
         menus.getItems().get(1).getCaption());
  assertEquals(showcaseEntryPoint.constants.Process_Management(),
         menus.getItems().get(2).getCaption());
  assertEquals(showcaseEntryPoint.constants.Work(),
         menus.getItems().get(3).getCaption());
  assertEquals(showcaseEntryPoint.constants.Dashboards(),
         menus.getItems().get(4).getCaption());
  assertEquals(showcaseEntryPoint.constants.Extensions(),
         menus.getItems().get(5).getCaption());
  verify(menusHelper).addRolesMenuItems();
  verify(menusHelper).addGroupsMenuItems();
  verify(menusHelper).addWorkbenchConfigurationMenuItem();
  verify(menusHelper).addUtilitiesMenuItems();
}

相关文章