/** * Tests the initial enablement of the zoom toolbar entry. See Bugzilla 110815. * * @throws Exception */ public void testZoomToolbarEnablement() throws Exception { getTestFixture().openDiagram(); IContributionItem[] items = ((IEditorSite) getDiagramWorkbenchPart().getSite()) .getActionBars() .getToolBarManager() .getItems(); boolean foundIt = false; for (int i = 0; i < items.length; i++) { IContributionItem item = items[i]; if (item instanceof ZoomContributionItem) { foundIt = true; assertTrue(item.isEnabled()); } } assertTrue(foundIt); }
/** @see IContributionItem#isEnabled() */ @Override public boolean isEnabled() { return item.isEnabled(); }