use of org.eclipse.jface.action.IToolBarManager in project linuxtools by eclipse.
the class ValgrindViewPart method createDynamicContent.
/**
* Returns a refreshable view specific of a Valgrind tool.
*
* @param description the content description
* @param toolID the Valgrind tool identifier
* @return the Valgrind tool view
* @throws CoreException the toolbar is disposed
*/
public IValgrindToolView createDynamicContent(String description, String toolID) throws CoreException {
setContentDescription(description);
// remove tool specific toolbar controls
IToolBarManager toolbar = getViewSite().getActionBars().getToolBarManager();
ToolBar tb = ((ToolBarManager) toolbar).getControl();
if (tb == null || tb.isDisposed()) {
// $NON-NLS-1$
throw new CoreException(new Status(IStatus.ERROR, ValgrindUIPlugin.PLUGIN_ID, "Toolbar is disposed"));
}
if (dynamicActions != null) {
for (ActionContributionItem item : dynamicActions) {
toolbar.remove(item);
}
}
// remove old view controls
if (dynamicView != null) {
dynamicView.dispose();
}
// remove old messages
if (messages != null) {
messagesViewer.getTreeViewer().setInput(null);
messages = null;
}
for (Control child : dynamicViewHolder.getChildren()) {
if (!child.isDisposed()) {
child.dispose();
}
}
if (toolID != null) {
dynamicView = ValgrindUIPlugin.getDefault().getToolView(toolID);
dynamicView.createPartControl(dynamicViewHolder);
// create toolbar items
IAction[] actions = dynamicView.getToolbarActions();
if (actions != null) {
dynamicActions = new ActionContributionItem[actions.length];
for (int i = 0; i < actions.length; i++) {
dynamicActions[i] = new ActionContributionItem(actions[i]);
toolbar.appendToGroup(TOOLBAR_LOC_GROUP_ID, dynamicActions[i]);
}
}
} else {
dynamicView = null;
}
// remove old menu items
IMenuManager menu = getViewSite().getActionBars().getMenuManager();
menu.removeAll();
// was content was created?
hasDynamicContent = dynamicViewHolder.getChildren().length > 0;
if (hasDynamicContent) {
menu.add(showCoreAction);
menu.add(showToolAction);
}
menu.update(true);
toolbar.update(true);
// Update to notify the workbench items have been changed
getViewSite().getActionBars().updateActionBars();
dynamicViewHolder.layout(true);
return dynamicView;
}
use of org.eclipse.jface.action.IToolBarManager in project bndtools by bndtools.
the class JPMBrowserView method createActions.
private void createActions() {
backAction = new Action("Back", backImg) {
@Override
public void run() {
browser.back();
}
};
forwardAction = new Action("Forward", forwardImg) {
@Override
public void run() {
browser.forward();
}
};
IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager();
tbm.add(backAction);
tbm.add(forwardAction);
}
use of org.eclipse.jface.action.IToolBarManager in project yamcs-studio by yamcs.
the class YamcsStudioActionBarAdvisor method fillCoolBar.
@Override
protected void fillCoolBar(ICoolBarManager coolbar) {
IToolBarManager appToolBar = new ToolBarManager(coolbar.getStyle());
coolbar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_APP));
coolbar.add(new ToolBarContributionItem(appToolBar, IWorkbenchActionConstants.TOOLBAR_FILE));
coolbar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
coolbar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_EDITOR));
fillAppToolBar(appToolBar);
// Doesn't seem to work...
coolbar.setLockLayout(true);
}
use of org.eclipse.jface.action.IToolBarManager in project translationstudio8 by heartsome.
the class MatchViewPart method createActions.
/**
* 创建视图工具栏的按钮。
*/
private void createActions() {
menuMgr = new MatchViewerBodyMenu(this);
gridTable.setMenu(menuMgr.getBodyMenu());
IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
toolBarManager.add(menuMgr.editAction);
toolBarManager.add(menuMgr.deleteAction);
toolBarManager.add(menuMgr.acceptMatchAction);
// toolBarManager.add(menuMgr.acceptMatchPureTextAction);
menuMgr.updateActionState();
}
use of org.eclipse.jface.action.IToolBarManager in project GT by Tencent.
the class SMAPSView method createLocalToolBar.
private void createLocalToolBar() {
IActionBars bars = getViewSite().getActionBars();
IToolBarManager manager = bars.getToolBarManager();
manager.add(openLogAction);
}
Aggregations