@Test public void getMenuItemsSynchronizesEnabledState() { when(projectContext.getActiveModule()).thenReturn(Optional.of(mock(KieModule.class))); final List<MenuItem> menus = menu.getMenuItems(); assertTrue(menus.get(0).isEnabled()); assertTrue(menus.get(1).isEnabled()); }
public List<MenuItem> getMenuItems() { enableToolsMenuItems((KieModule) context.getActiveModule().orElse(null)); ArrayList<MenuItem> menuItems = new ArrayList<>(); menuItems.add(projectScreen); menuItems.add(projectStructureScreen); return menuItems; }
ProjectMenu { public List<MenuItem> getMenuItems() { enableToolsMenuItems((KieModule) context.getActiveModule().orElse(null)); ArrayList<MenuItem> menuItems = new ArrayList<>(); menuItems.add(projectScreen); menuItems.add(projectStructureScreen); return menuItems; } }
ProjectMenu { public List<MenuItem> getMenuItems() { enableToolsMenuItems((KieModule) context.getActiveModule().orElse(null)); ArrayList<MenuItem> menuItems = new ArrayList<>(); menuItems.add(projectScreen); menuItems.add(projectStructureScreen); return menuItems; } ProjectMenu(); @Inject  ProjectMenu(final PlaceManager placeManager,
                       final WorkspaceProjectContext context); }
ProjectMenu { public List<MenuItem> getMenuItems() { enableToolsMenuItems((KieModule) context.getActiveModule().orElse(null)); ArrayList<MenuItem> menuItems = new ArrayList<>(); menuItems.add(projectScreen); menuItems.add(projectStructureScreen); return menuItems; } ProjectMenu(); @Inject  ProjectMenu(final PlaceManager placeManager,
                       final WorkspaceProjectContext context); List<MenuItem> getMenuItems(); void onWorkspaceProjectContextChanged(@Observes final WorkspaceProjectContextChangeEvent event); }
ProjectMenu { public List<MenuItem> getMenuItems() { enableToolsMenuItems((KieModule) context.getActiveModule().orElse(null)); ArrayList<MenuItem> menuItems = new ArrayList<>(); menuItems.add(projectScreen); menuItems.add(projectStructureScreen); return menuItems; } ProjectMenu(); @Inject  ProjectMenu(final PlaceManager placeManager,
                       final WorkspaceProjectContext context); List<MenuItem> getMenuItems(); void onWorkspaceProjectContextChanged(@Observes final WorkspaceProjectContextChangeEvent event);  }