• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IContextMenuConstants类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.search.ui.IContextMenuConstants的典型用法代码示例。如果您正苦于以下问题:Java IContextMenuConstants类的具体用法?Java IContextMenuConstants怎么用?Java IContextMenuConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IContextMenuConstants类属于org.eclipse.search.ui包,在下文中一共展示了IContextMenuConstants类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
@Override
public void init(IPageSite site) {
	super.init(site);
	IMenuManager menuManager = site.getActionBars().getMenuManager();
	menuManager.insertBefore(IContextMenuConstants.GROUP_PROPERTIES, new Separator(GROUP_FILTERING));
	fActionGroup.fillActionBars(site.getActionBars());
	menuManager.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, new Action(SearchMessages.JavaSearchResultPage_preferences_label) {
		@Override
		public void run() {
			String pageId= "org.eclipse.search.preferences.SearchPreferencePage"; //$NON-NLS-1$
			String[] displayedPages= { pageId,
					"org.eclipse.ui.editors.preferencePages.Annotations", //$NON-NLS-1$
					"org.eclipse.ui.preferencePages.ColorsAndFonts" //$NON-NLS-1$
			};
			PreferencesUtil.createPreferenceDialogOn(JavaPlugin.getActiveWorkbenchShell(), pageId, displayedPages, null).open();
		}
	});
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:JavaSearchResultPage.java


示例2: init

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
@Override
public void init(final IPageSite pageSite)
{
  super.init(pageSite);
  final IMenuManager menuManager = pageSite.getActionBars().getMenuManager();
  menuManager.insertBefore(IContextMenuConstants.GROUP_PROPERTIES, new Separator(
      JiveSearchResultPage.LAYOUT_GROUP));
  menuManager.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, new Action("Preferences...")
    {
      @Override
      public void run()
      {
        final String pageId = "org.eclipse.search.preferences.SearchPreferencePage"; //$NON-NLS-1$
        final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
        PreferencesUtil.createPreferenceDialogOn(shell, pageId, null, null).open();
      }
    });
}
 
开发者ID:UBPL,项目名称:jive,代码行数:19,代码来源:JiveSearchResultPage.java


示例3: addOpenWithMenu

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
private void addOpenWithMenu(IMenuManager menu, IStructuredSelection selection) {
    if (selection == null) {
        return;
    }

    fOpenAction.selectionChanged(selection);
    if (fOpenAction.isEnabled()) {
        menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, fOpenAction);
    }

    if (selection.size() != 1) {
        return;
    }

    Object o = selection.getFirstElement();
    if (!(o instanceof IAdaptable)) {
        return;
    }

    // Create menu
    IMenuManager submenu = new MenuManager("Open Wit&h");
    submenu.add(new OpenWithMenu(fPage, (IAdaptable) o));

    // Add the submenu.
    menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:27,代码来源:NewTextSearchActionGroup.java


示例4: fillContextMenu

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
@Override
protected void fillContextMenu(IMenuManager mgr) {
    super.fillContextMenu(mgr);
    addSortActions(mgr);
    fActionGroup.setContext(new ActionContext(getSite().getSelectionProvider().getSelection()));
    fActionGroup.fillContextMenu(mgr);
    AbstractPythonSearchQuery query = (AbstractPythonSearchQuery) getInput().getQuery();
    if (query.getSearchString().length() > 0) {
        IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();
        if (!selection.isEmpty()) {
            ReplaceAction replaceSelection = new ReplaceAction(getSite().getShell(),
                    getInput(), selection.toArray(), true);
            replaceSelection.setText(SearchMessages.ReplaceAction_label_selected);
            mgr.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, replaceSelection);

        }
        ReplaceAction replaceAll = new ReplaceAction(getSite().getShell(), getInput(),
                null, true);
        replaceAll.setText(SearchMessages.ReplaceAction_label_all);
        mgr.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, replaceAll);
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:23,代码来源:FileSearchPage.java


示例5: addOpenWithMenu

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
private void addOpenWithMenu(IMenuManager menu, IStructuredSelection selection) {
    if (selection == null) {
        return;
    }

    fOpenAction.selectionChanged(selection);
    if (fOpenAction.isEnabled()) {
        menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, fOpenAction);
    }

    if (selection.size() != 1) {
        return;
    }

    Object o = selection.getFirstElement();
    if (!(o instanceof IAdaptable)) {
        return;
    }

    // Create menu
    IMenuManager submenu = new MenuManager(SearchMessages.OpenWithMenu_label);
    submenu.add(new OpenWithMenu(fPage, (IAdaptable) o));

    // Add the submenu.
    menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:27,代码来源:NewTextSearchActionGroup.java


示例6: addSortActions

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
private void addSortActions(IMenuManager mgr) {
	if (getLayout() != FLAG_LAYOUT_FLAT)
		return;
	MenuManager sortMenu= new MenuManager(SearchMessages.FileSearchPage_sort_by_label);
	sortMenu.add(fSortByNameAction);
	sortMenu.add(fSortByPathAction);

	fSortByNameAction.setChecked(fCurrentSortOrder == fSortByNameAction.getSortOrder());
	fSortByPathAction.setChecked(fCurrentSortOrder == fSortByPathAction.getSortOrder());

	mgr.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, sortMenu);
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:13,代码来源:TypeScriptSearchResultPage.java


示例7: fillToolbar

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
protected void fillToolbar(IToolBarManager tbm) {
	tbm.appendToGroup(IContextMenuConstants.GROUP_SHOW, showNextAction);
	tbm.appendToGroup(IContextMenuConstants.GROUP_SHOW, showPreviousAction);
	IActionBars actionBars = getSite().getActionBars();
	if (actionBars != null) {
		actionBars.setGlobalActionHandler(ActionFactory.NEXT.getId(), showNextAction);
		actionBars.setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), showPreviousAction);
	}
	tbm.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, expandAllAction);
	tbm.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, collapseAllAction);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:12,代码来源:ReferenceSearchViewPage.java


示例8: fillContextMenu

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
@Override
protected void fillContextMenu(IMenuManager mgr) {
	super.fillContextMenu(mgr);
	addSortActions(mgr);

	mgr.appendToGroup(IContextMenuConstants.GROUP_EDIT, getCopyQualifiedNameAction());

	fActionGroup.setContext(new ActionContext(getSite().getSelectionProvider().getSelection()));
	fActionGroup.fillContextMenu(mgr);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:JavaSearchResultPage.java


示例9: addSortActions

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
private void addSortActions(IMenuManager mgr) {
	if (getLayout() != FLAG_LAYOUT_FLAT)
		return;
	MenuManager sortMenu= new MenuManager(SearchMessages.JavaSearchResultPage_sortBylabel);
	sortMenu.add(fSortByNameAction);
	sortMenu.add(fSortByPathAction);
	sortMenu.add(fSortByParentName);

	fSortByNameAction.setChecked(fCurrentSortOrder == fSortByNameAction.getSortOrder());
	fSortByPathAction.setChecked(fCurrentSortOrder == fSortByPathAction.getSortOrder());
	fSortByParentName.setChecked(fCurrentSortOrder == fSortByParentName.getSortOrder());

	mgr.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, sortMenu);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:JavaSearchResultPage.java


示例10: addGroupActions

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
private void addGroupActions(IToolBarManager mgr) {
	mgr.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, new Separator(GROUP_GROUPING));
	mgr.appendToGroup(GROUP_GROUPING, fGroupProjectAction);
	mgr.appendToGroup(GROUP_GROUPING, fGroupPackageAction);
	mgr.appendToGroup(GROUP_GROUPING, fGroupFileAction);
	mgr.appendToGroup(GROUP_GROUPING, fGroupTypeAction);

	updateGroupingActions();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:JavaSearchResultPage.java


示例11: fillContextMenu

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
@Override
public void fillContextMenu(IMenuManager menu) {
    // view must exist if we create a context menu for it.

    ISelection selection = getContext().getSelection();
    if (selection instanceof IStructuredSelection) {
        addOpenWithMenu(menu, (IStructuredSelection) selection);
        if (fOpenPropertiesDialog != null && fOpenPropertiesDialog.isEnabled()
                && fOpenPropertiesDialog.isApplicableForSelection((IStructuredSelection) selection)) {
            menu.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, fOpenPropertiesDialog);
        }
    }

}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:15,代码来源:NewTextSearchActionGroup.java


示例12: fillContextMenu

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
@Override
protected void fillContextMenu(IMenuManager mgr) {
    super.fillContextMenu(mgr);
    fActionGroup.setContext(new ActionContext(getSite().getSelectionProvider().getSelection()));
    fActionGroup.fillContextMenu(mgr);
    AbstractSearchIndexQuery query = (AbstractSearchIndexQuery) getInput().getQuery();
    if (query.getSearchString().length() > 0) {
        IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();
        if (!selection.isEmpty()) {
            ReplaceAction replaceSelection = new ReplaceAction(getSite().getShell(), getInput(),
                    selection.toArray(), true);
            replaceSelection.setText(SearchMessages.ReplaceAction_label_selected);
            mgr.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, replaceSelection);

        }
        ICallback<Boolean, Match> skipMatch = new ICallback<Boolean, Match>() {

            @Override
            public Boolean call(Match match) {
                StructuredViewer viewer = getViewer();
                ViewerFilter[] filters = viewer.getFilters();
                if (filters == null || filters.length == 0) {
                    return false;
                }
                for (ViewerFilter viewerFilter : filters) {
                    if (viewerFilter instanceof AbstractSearchResultsViewerFilter) {
                        AbstractSearchResultsViewerFilter searchResultsViewerFilter = (AbstractSearchResultsViewerFilter) viewerFilter;
                        if (searchResultsViewerFilter.isLeafMatch(viewer, match)) {
                            return false;
                        }
                    }
                }
                return true;
            }
        };
        ReplaceAction replaceAll = new ReplaceAction(getSite().getShell(), getInput(), null, true, skipMatch);
        replaceAll.setText(SearchMessages.ReplaceAction_label_all);
        mgr.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, replaceAll);
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:41,代码来源:AbstractSearchIndexResultPage.java


示例13: fillToolbar

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
@Override
protected void fillToolbar(IToolBarManager tbm) {
    super.fillToolbar(tbm);
    for (Action a : fGroupByActions) {
        String id = IContextMenuConstants.GROUP_PROPERTIES + "." + a.hashCode();
        a.setId(id);
        tbm.add(a);
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:10,代码来源:AbstractSearchIndexResultPage.java


示例14: addSortActions

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
private void addSortActions(IMenuManager mgr) {
    if (getLayout() != FLAG_LAYOUT_FLAT) {
        return;
    }
    MenuManager sortMenu = new MenuManager(SearchMessages.FileSearchPage_sort_by_label);
    sortMenu.add(fSortByNameAction);
    sortMenu.add(fSortByPathAction);

    fSortByNameAction.setChecked(fCurrentSortOrder == fSortByNameAction.getSortOrder());
    fSortByPathAction.setChecked(fCurrentSortOrder == fSortByPathAction.getSortOrder());

    mgr.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, sortMenu);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:14,代码来源:FileSearchPage.java


示例15: init

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
public void init(IPageSite site) {
	super.init(site);
	IMenuManager menuManager = site.getActionBars().getMenuManager();
	menuManager.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, new OpenSearchPreferencesAction());
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:6,代码来源:TypeScriptSearchResultPage.java


示例16: init

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
@Override
public void init(IPageSite site) {
	super.init(site);
	IMenuManager menuManager = site.getActionBars().getMenuManager();
	menuManager.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, new OpenSearchPreferencesAction());
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:7,代码来源:PlanSearchResultPage.java


示例17: init

import org.eclipse.search.ui.IContextMenuConstants; //导入依赖的package包/类
@Override
public void init(IPageSite site) {
    super.init(site);
    IMenuManager menuManager = site.getActionBars().getMenuManager();
    menuManager.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, new OpenSearchPreferencesAction());
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:7,代码来源:FileSearchPage.java



注:本文中的org.eclipse.search.ui.IContextMenuConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LanguagePath类代码示例发布时间:2022-05-23
下一篇:
Java ClassTreeNode类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap