本文整理汇总了Java中org.eclipse.ui.IWorkbenchActionConstants类的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchActionConstants类的具体用法?Java IWorkbenchActionConstants怎么用?Java IWorkbenchActionConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IWorkbenchActionConstants类属于org.eclipse.ui包,在下文中一共展示了IWorkbenchActionConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: contributeToMenu
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
@Override
public void contributeToMenu(IMenuManager menu) {
super.contributeToMenu(menu);
IMenuManager editMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
if (editMenu != null) {
editMenu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fContentAssist);
}
}
示例2: fillContextMenu
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
private void fillContextMenu(final IMenuManager manager) {
final TableViewer tableViewer = getFocusedTableViewer();
if (tableViewer != null) {
final boolean itemsSelected = ((IStructuredSelection) tableViewer.getSelection()).size() > 0;
final int[] boundaries = getSelectedRowBoundaries(tableViewer.getTable());
final QEQueryRowCollection rows = getRowCollection(tableViewer);
insertAction.setEnabled(true);
deleteAction.setEnabled(itemsSelected);
groupAction.setEnabled(itemsSelected && rows.getGrouping().canGroup(boundaries[0], boundaries[1]));
ungroupAction.setEnabled(itemsSelected && rows.getGrouping().canUngroup(boundaries[0], boundaries[1]));
manager.add(insertAction);
manager.add(deleteAction);
manager.add(groupAction);
manager.add(ungroupAction);
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
}
示例3: registerContextMenu
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
public void registerContextMenu(
final TeamExplorerContext context,
final Control control,
final ISelectionProvider provider) {
final MenuManager contextMenuManager = new MenuManager("#PopupMenu"); //$NON-NLS-1$
contextMenuManager.setRemoveAllWhenShown(false);
contextMenuManager.add(new Separator("group1")); //$NON-NLS-1$
contextMenuManager.add(new Separator("group2")); //$NON-NLS-1$
contextMenuManager.add(new Separator("group3")); //$NON-NLS-1$
contextMenuManager.add(new Separator("group4")); //$NON-NLS-1$
contextMenuManager.add(new Separator("group5")); //$NON-NLS-1$
contextMenuManager.add(new Separator("group6")); //$NON-NLS-1$
contextMenuManager.add(new Separator("group7")); //$NON-NLS-1$
contextMenuManager.add(new Separator("group8")); //$NON-NLS-1$
contextMenuManager.add(new Separator("group9")); //$NON-NLS-1$
contextMenuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
final Menu menu = contextMenuManager.createContextMenu(control);
control.setMenu(menu);
context.getWorkbenchPart().getSite().registerContextMenu(EXTENSION_POINT_ID, contextMenuManager, provider);
}
示例4: fillMenu
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
protected void fillMenu(final IMenuManager menuMgr) {
menuMgr.add(new Separator("group0")); //$NON-NLS-1$
menuMgr.add(new Separator("group1")); //$NON-NLS-1$
menuMgr.add(new Separator("group2")); //$NON-NLS-1$
menuMgr.add(new GroupMarker("group2.top")); //$NON-NLS-1$
menuMgr.add(new GroupMarker("group2.middle")); //$NON-NLS-1$
menuMgr.add(new GroupMarker("group2.bottom")); //$NON-NLS-1$
menuMgr.add(new Separator("group3")); //$NON-NLS-1$
menuMgr.add(new Separator("group4")); //$NON-NLS-1$
menuMgr.add(new Separator("group5")); //$NON-NLS-1$
menuMgr.add(new Separator("group6")); //$NON-NLS-1$
menuMgr.add(new Separator("group7")); //$NON-NLS-1$
menuMgr.add(new Separator("group8")); //$NON-NLS-1$
menuMgr.add(new Separator("group9")); //$NON-NLS-1$
menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
示例5: registerMenus
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
/**
* Create the menu extension points to allow plugins (including this one) to
* add menu items.
*/
private void registerMenus(final String menuId, final Control control, final ISelectionProvider selectionProvider) {
final MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(false);
menuMgr.add(new Separator("group0")); //$NON-NLS-1$
menuMgr.add(new Separator("group1")); //$NON-NLS-1$
menuMgr.add(new Separator("group2")); //$NON-NLS-1$
menuMgr.add(new Separator("group3")); //$NON-NLS-1$
menuMgr.add(new Separator("group4")); //$NON-NLS-1$
menuMgr.add(new Separator("group5")); //$NON-NLS-1$
menuMgr.add(new Separator("group6")); //$NON-NLS-1$
menuMgr.add(new Separator("group7")); //$NON-NLS-1$
menuMgr.add(new Separator("group8")); //$NON-NLS-1$
menuMgr.add(new Separator("group9")); //$NON-NLS-1$
menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
final Menu menu = menuMgr.createContextMenu(control);
control.setMenu(menu);
getSite().registerContextMenu(menuId, menuMgr, selectionProvider);
}
示例6: fillTableMenu
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
/**
* fill the popup menu for the table
*/
private void fillTableMenu(IMenuManager manager) {
manager.add(getRefreshAction());
Action action = getAddPropertyAction();
try {
if (resource != null)
action.setEnabled(resource.isManaged());
else
action.setEnabled(false);
} catch (SVNException e) {
action.setEnabled(false);
}
manager.add(action);
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
示例7: addRemoteBookmarksStoreActions
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
private void addRemoteBookmarksStoreActions(IMenuManager manager) {
for (IRemoteBookmarksStore store : BookmarksPlugin.getDefault().getRemoteBookmarksStoreManager()
.getRemoteBookmarksStores()) {
MenuManager subMenu = new MenuManager(store.getDescriptor().getLabel(),
ID + "." + store.getDescriptor().getId());
AddToRemoteBookmarksStoreAction addToStoreAction = new AddToRemoteBookmarksStoreAction(eventBroker,
bookmarksTreeViewer, store);
RemoveFromRemoteBookmarksStoreAction removeFromStoreAction = new RemoveFromRemoteBookmarksStoreAction(
eventBroker, bookmarksTreeViewer, store);
subMenu.add(addToStoreAction);
subMenu.add(removeFromStoreAction);
// Other plug-ins can contribute there actions here
subMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
manager.add(subMenu);
}
}
示例8: init
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
public void init(IActionBars bars) {
super.init(bars);
IMenuManager menuManager = bars.getMenuManager();
IMenuManager editMenu = menuManager
.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
if (editMenu != null) {
editMenu.add(new Separator());
editMenu.add(fContentAssistProposal);
editMenu.add(fContentFormat);
editMenu.add(fContentGotoLastEditPosition);
}
IToolBarManager toolBarManager = bars.getToolBarManager();
if (toolBarManager != null) {
toolBarManager.add(new Separator());
// toolBarManager.add(fTogglePresentation);
}
bars.getToolBarManager().remove(ITextEditorActionConstants.DELETE);
}
示例9: contributeToMenu
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
/**
* Just to make the zooming actions for the editor via the context menu.
*/
@Override
public void contributeToMenu(IMenuManager menuManager) {
// TODO Auto-generated method stub
super.contributeToMenu(menuManager);
// Adding the zooming to the workbench while our editor is active.
MenuManager zoomMenu = new MenuManager("Zoom");
IAction zoomInAction = getAction(GEFActionConstants.ZOOM_IN);
IAction zoomOutAction = getAction(GEFActionConstants.ZOOM_OUT);
if (zoomInAction != null && zoomOutAction != null) {
zoomMenu.add(zoomInAction);
zoomMenu.add(zoomOutAction);
menuManager.insertAfter(IWorkbenchActionConstants.M_EDIT,zoomMenu);
}
MenuManager mnu = new MenuManager ("view");
mnu.add(getAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY));
menuManager.insertAfter(IWorkbenchActionConstants.M_EDIT, mnu);
}
示例10: fillMenuBar
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
@Override
protected void fillMenuBar(final IMenuManager menubar) {
menubar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
IMenuManager windowMenu = new MenuManager("Window", IWorkbenchActionConstants.M_WINDOW);
menubar.add(windowMenu);
windowMenu.add(resetPerspectiveAction);
windowMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
windowMenu.add(new Separator());
windowMenu.add(preferencesAction);
// plugin.xml in css menu.app defines a non-brandable icon.
// through plugin.xml in this bundle, that help menu is hidden, and
// we replace it here with another one (shorter) version
IMenuManager helpMenu = new MenuManager("Help", "help-2");
menubar.add(helpMenu);
helpMenu.add(onlineHelpAction);
helpMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
helpMenu.add(new Separator());
helpMenu.add(raiseIssueAction);
helpMenu.add(new Separator());
helpMenu.add(aboutAction);
}
示例11: createFileMenu
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
/**
* Creates the 'File' menu. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected IMenuManager createFileMenu(IWorkbenchWindow window) {
IMenuManager menu = new MenuManager(getString("_UI_Menu_File_label"), IWorkbenchActionConstants.M_FILE);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
IMenuManager newMenu = new MenuManager(getString("_UI_Menu_New_label"), "new");
newMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(newMenu);
menu.add(new Separator());
menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.CLOSE.create(window));
addToMenuAndRegister(menu, ActionFactory.CLOSE_ALL.create(window));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.SAVE.create(window));
addToMenuAndRegister(menu, ActionFactory.SAVE_AS.create(window));
addToMenuAndRegister(menu, ActionFactory.SAVE_ALL.create(window));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.QUIT.create(window));
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}
示例12: createEditMenu
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
/**
* Creates the 'Edit' menu. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected IMenuManager createEditMenu(IWorkbenchWindow window) {
IMenuManager menu = new MenuManager(getString("_UI_Menu_Edit_label"), IWorkbenchActionConstants.M_EDIT);
menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));
addToMenuAndRegister(menu, ActionFactory.UNDO.create(window));
addToMenuAndRegister(menu, ActionFactory.REDO.create(window));
menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.CUT.create(window));
addToMenuAndRegister(menu, ActionFactory.COPY.create(window));
addToMenuAndRegister(menu, ActionFactory.PASTE.create(window));
menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.DELETE.create(window));
addToMenuAndRegister(menu, ActionFactory.SELECT_ALL.create(window));
menu.add(new Separator());
menu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));
menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
return menu;
}
示例13: fillContextMenu
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
private void fillContextMenu(IMenuManager manager) {
DockerContainerElement elem = getSelectedElement();
String status = null;
if(elem != null)
status = elem.getStatus();
startAction.setEnabled(status != null && status.startsWith("Exited"));
stopAction.setEnabled(status != null && status.startsWith("Up"));
unpauseAction.setEnabled(status != null && status.startsWith("Paused"));
pauseAction.setEnabled(status != null && status.startsWith("Up"));
showConsoleAction.setEnabled(status != null && status.startsWith("Up"));
showEnvAction.setEnabled(status != null && status.startsWith("Up"));
showLinkAction.setEnabled(status != null && status.startsWith("Up"));
manager.add(startAction);
manager.add(stopAction);
manager.add(unpauseAction);
manager.add(pauseAction);
manager.add(deleteAction);
manager.add(inspectAction);
manager.add(showConsoleAction);
manager.add(showEnvAction);
manager.add(showLinkAction);
manager.add(refreshAction);
// Other plug-ins can contribute there actions here
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
示例14: fillContextMenu
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
private void fillContextMenu(IMenuManager manager) {
if(viewer.getSelection() instanceof IStructuredSelection){
IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
if(selection.size() <1)
return;
Object obj = selection.getFirstElement();
System.out.println(obj);
if(obj instanceof DockerImageElement){
DockerImageElement elem = (DockerImageElement)obj;
}
}
manager.add(pullImageAction);
manager.add(pushmageAction);
manager.add(createImageAction);
manager.add(createContainerAction);
manager.add(deleteImageAction);
manager.add(inspectAction);
manager.add(refreshAction);
// Other plug-ins can contribute there actions here
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
示例15: createFileMenu
import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
/**
* Creates the 'File' menu.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IMenuManager createFileMenu(IWorkbenchWindow window) {
IMenuManager menu = new MenuManager(getString("_UI_Menu_File_label"),
IWorkbenchActionConstants.M_FILE);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
IMenuManager newMenu = new MenuManager(getString("_UI_Menu_New_label"), "new");
newMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(newMenu);
menu.add(new Separator());
menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.CLOSE.create(window));
addToMenuAndRegister(menu, ActionFactory.CLOSE_ALL.create(window));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.SAVE.create(window));
addToMenuAndRegister(menu, ActionFactory.SAVE_AS.create(window));
addToMenuAndRegister(menu, ActionFactory.SAVE_ALL.create(window));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.QUIT.create(window));
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}