170171172173174175176177178
* @return this * @see TreeViewer#expandAll() * @see TreeViewer#collapseAll() */ public CommonToolBarBuilder enableTreeAction(TreeViewer viewer) { treeAction = new DropDownAction(new CollapseAllAction(viewer), new ExpandAllAction(viewer)); return this; }
3435363738394041
@Test public void testConstructor_defaultAction() { IAction action = new Action() { }; assertSame(action, new DropDownAction("text", SharedImages.BRUSH, action) .getDefaultAction()); }
40414243444546
.getDefaultAction()); } @Test(expected = NullPointerException.class) public void testConstructor_defaultAction_null() { new DropDownAction("text", SharedImages.BRUSH, null); }
4647484950515253
} @Test public void testConstructor_image() { ImageDescriptor image = SharedImages.BRUSH; assertEquals(image, new DropDownAction(null, image, new Action() { }).getImageDescriptor()); }
5556575859606162
@Test public void testConstructor_menuItems() { IAction[] actions = new IAction[] { new Action() { }, new Action() { } }; assertArrayEquals(actions, new DropDownAction(null, null, new Action() { }, actions).getMenuItemActions()); }
6263646566676869
} @Test public void testConstructor_text() { String text = "adfolij"; assertEquals(text, new DropDownAction(text, null, new Action() { }).getText()); }