@Test public void testMenuItemCommand() { final List<MenuItem> menus = menu.getMenuItems(); assertNotNull( menus ); assertEquals( 1, menus.size() ); final MenuItem mi = menus.get( 0 ); assertTrue( mi.isEnabled() ); assertTrue( mi instanceof MenuItemCommand ); final MenuItemCommand miu = (MenuItemCommand) mi; assertNotNull( miu.getCommand() ); miu.getCommand().execute(); verify( command, times( 1 ) ).execute(); }
public List<MenuItem> getMenuItems() { enableMenuItemsForContext(); return items; }
NewResourcesMenu implements WorkspaceProjectContextChangeHandler { public List<MenuItem> getMenuItems() { enableMenuItemsForContext(); return items; } }
NewResourcesMenu implements WorkspaceProjectContextChangeHandler { public List<MenuItem> getMenuItems() { enableMenuItemsForContext(); return items; } NewResourcesMenu(); @Inject  NewResourcesMenu( final SyncBeanManager iocBeanManager,
                             final NewResourcePresenter newResourcePresenter,
                             final WorkspaceProjectContext projectContext ); }
NewResourcesMenu implements WorkspaceProjectContextChangeHandler { public List<MenuItem> getMenuItems() { enableMenuItemsForContext(); return items; } NewResourcesMenu(); @Inject  NewResourcesMenu( final SyncBeanManager iocBeanManager,
                             final NewResourcePresenter newResourcePresenter,
                             final WorkspaceProjectContext projectContext ); @PostConstruct void setup(); List<MenuItem> getMenuItems(); List<MenuItem> getMenuItemsWithoutProject(); @Override void onChange(WorkspaceProjectContextChangeEvent previous, WorkspaceProjectContextChangeEvent current); }
NewResourcesMenu implements WorkspaceProjectContextChangeHandler { public List<MenuItem> getMenuItems() { enableMenuItemsForContext(); return items; } NewResourcesMenu(); @Inject  NewResourcesMenu( final SyncBeanManager iocBeanManager,
                             final NewResourcePresenter newResourcePresenter,
                             final WorkspaceProjectContext projectContext ); @PostConstruct void setup(); List<MenuItem> getMenuItems(); List<MenuItem> getMenuItemsWithoutProject(); @Override void onChange(WorkspaceProjectContextChangeEvent previous, WorkspaceProjectContextChangeEvent current);  }