|
Lines 18-27
Link Here
|
| 18 |
import org.eclipse.jface.action.ICoolBarManager; |
18 |
import org.eclipse.jface.action.ICoolBarManager; |
| 19 |
import org.eclipse.jface.action.IToolBarManager; |
19 |
import org.eclipse.jface.action.IToolBarManager; |
| 20 |
import org.eclipse.jface.action.Separator; |
20 |
import org.eclipse.jface.action.Separator; |
|
|
21 |
import org.eclipse.jface.action.SubCoolBarManager; |
| 21 |
import org.eclipse.jface.action.ToolBarContributionItem; |
22 |
import org.eclipse.jface.action.ToolBarContributionItem; |
| 22 |
import org.eclipse.jface.action.ToolBarManager; |
23 |
import org.eclipse.jface.action.ToolBarManager; |
| 23 |
import org.eclipse.swt.widgets.ToolBar; |
24 |
import org.eclipse.swt.widgets.ToolBar; |
| 24 |
import org.eclipse.swt.widgets.ToolItem; |
25 |
import org.eclipse.swt.widgets.ToolItem; |
|
|
26 |
import org.eclipse.ui.IActionBars2; |
| 25 |
import org.eclipse.ui.IWorkbenchPage; |
27 |
import org.eclipse.ui.IWorkbenchPage; |
| 26 |
import org.eclipse.ui.IWorkbenchWindow; |
28 |
import org.eclipse.ui.IWorkbenchWindow; |
| 27 |
import org.eclipse.ui.internal.WorkbenchWindow; |
29 |
import org.eclipse.ui.internal.WorkbenchWindow; |
|
Lines 113-118
Link Here
|
| 113 |
fPage.activate(editor); |
115 |
fPage.activate(editor); |
| 114 |
verifyToolItemState(contributor, true); |
116 |
verifyToolItemState(contributor, true); |
| 115 |
} |
117 |
} |
|
|
118 |
|
| 119 |
public void testCoolBarContribution() throws Throwable { |
| 120 |
|
| 121 |
MockEditorPart editor = openEditor(fPage, "3"); |
| 122 |
MockEditorActionBarContributor contributor = (MockEditorActionBarContributor) editor |
| 123 |
.getEditorSite().getActionBarContributor(); |
| 124 |
|
| 125 |
assertTrue(contributor.getActionBars() instanceof IActionBars2); |
| 126 |
IActionBars2 actionBars = (IActionBars2) contributor.getActionBars(); |
| 127 |
|
| 128 |
assertTrue(actionBars.getCoolBarManager() instanceof SubCoolBarManager); |
| 129 |
SubCoolBarManager coolBarManager = (SubCoolBarManager) actionBars.getCoolBarManager(); |
| 130 |
assertTrue("Coolbar should be visible", coolBarManager.isVisible()); |
| 131 |
} |
| 132 |
|
| 133 |
|
| 116 |
|
134 |
|
| 117 |
/** |
135 |
/** |
| 118 |
* Open a test editor. |
136 |
* Open a test editor. |