本文整理汇总了Java中org.eclipse.ui.internal.presentations.SystemMenuRestore类的典型用法代码示例。如果您正苦于以下问题:Java SystemMenuRestore类的具体用法?Java SystemMenuRestore怎么用?Java SystemMenuRestore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SystemMenuRestore类属于org.eclipse.ui.internal.presentations包,在下文中一共展示了SystemMenuRestore类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StandardEditorSystemMenu
import org.eclipse.ui.internal.presentations.SystemMenuRestore; //导入依赖的package包/类
/**
* Create the standard view menu
*
* @param site the site to associate the view with
*/
public StandardEditorSystemMenu(IStackPresentationSite site) {
restore = new SystemMenuRestore(site);
move = new SystemMenuMove(site, getMoveMenuText(), false);
minimize = new SystemMenuMinimize(site);
maximize = new SystemMenuMaximize(site);
close = new SystemMenuClose(site);
closeOthers = new SystemMenuCloseOthers(site);
closeAll = new SystemMenuCloseAll(site);
{ // Initialize system menu
menuManager.add(new GroupMarker("misc")); //$NON-NLS-1$
menuManager.add(new GroupMarker("restore")); //$NON-NLS-1$
menuManager.add(new UpdatingActionContributionItem(restore));
menuManager.add(move);
menuManager.add(new GroupMarker("size")); //$NON-NLS-1$
menuManager.add(new GroupMarker("state")); //$NON-NLS-1$
menuManager.add(new UpdatingActionContributionItem(minimize));
menuManager.add(new UpdatingActionContributionItem(maximize));
menuManager.add(new Separator("close")); //$NON-NLS-1$
menuManager.add(close);
menuManager.add(closeOthers);
menuManager.add(closeAll);
site.addSystemActions(menuManager);
} // End of system menu initialization
}
示例2: StandardViewMenu
import org.eclipse.ui.internal.presentations.SystemMenuRestore; //导入依赖的package包/类
public StandardViewMenu(VSStackPresentation presentation, boolean addSystemActions) {
menuManager = new MenuManager();
IStackPresentationSite site = presentation.getSite();
restore = new SystemMenuRestore(site);
restore.setId("restore");
UIUtils.initAction(restore);
move = new SystemMenuMove(site, WorkbenchMessages.ViewPane_moveView, false);
minimize = new SystemMenuMinimize(site);
minimize.setId("minimize");
UIUtils.initAction(minimize);
maximize = new SystemMenuMaximize(site);
maximize.setId("maximize");
UIUtils.initAction(maximize);
close = new SystemMenuClose(presentation);
UIUtils.initAction(close);
SystemMenuToggleTabs toggleTabs = new SystemMenuToggleTabs(presentation, isViewMenu());
UIUtils.initAction(toggleTabs);
SystemMenuToggleToolbar toggleToolbar = null;
if(isViewMenu()){
toggleToolbar = new SystemMenuToggleToolbar(presentation);
UIUtils.initAction(toggleToolbar);
showView = new SystemMenuShowView(presentation);
}
{ // Initialize system menu
menuManager.add(new Separator("misc"));
menuManager.add(new Separator("restore"));
menuManager.add(new UpdatingActionContributionItem(restore));
menuManager.add(move);
menuManager.add(new GroupMarker("size"));
menuManager.add(new GroupMarker("state"));
menuManager.add(new UpdatingActionContributionItem(minimize));
menuManager.add(new UpdatingActionContributionItem(maximize));
menuManager.add(new Separator("toggle"));
menuManager.add(toggleTabs);
if(isViewMenu()){
menuManager.add(toggleToolbar);
}
if(isViewMenu()){
menuManager.add(showView);
}
menuManager.add(new Separator("list"));
menuManager.add(new Separator("close"));
menuManager.appendToGroup("close", close);
if(addSystemActions) {
site.addSystemActions(menuManager);
}
} // End of system menu initialization
if(isViewMenu()){
sortEditorList = new SystemMenuSortTabs(presentation);
UIUtils.initAction(sortEditorList);
menuManager.appendToGroup("list", sortEditorList);
}
}