本文整理汇总了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;未经允许,请勿转载。 |
请发表评论