Java 类org.eclipse.ui.internal.registry.ActionSetRegistry 实例源码
项目:tmxeditor8
文件:ApplicationActionBarAdvisor.java
/**
* 移除无用的菜单项:<br/>
* File 菜单下的“open file...”和“Convert Line Delimiters To”
*/
private void removeUnusedAction() {
ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();
IActionSetDescriptor[] actionSets = reg.getActionSets();
List<String> actionSetIds = Arrays.asList("org.eclipse.ui.actionSet.openFiles",
"org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo",
"org.eclipse.ui.actions.showKeyAssistHandler", "org.eclipse.ui.edit.text.actionSet.navigation",
"org.eclipse.ui.edit.text.actionSet.annotationNavigation");
for (int i = 0; i < actionSets.length; i++) {
if (actionSetIds.contains(actionSets[i].getId())) {
IExtension ext = actionSets[i].getConfigurationElement().getDeclaringExtension();
reg.removeExtension(ext, new Object[] { actionSets[i] });
}
}
}
项目:yamcs-studio
文件:YamcsStudioActionBarAdvisor.java
private void removeActionById(String actionSetId) {
// Use of an internal API is required to remove actions that are provided
// by including Eclipse bundles.
ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();
IActionSetDescriptor[] actionSets = reg.getActionSets();
for (int i = 0; i < actionSets.length; i++) {
if (actionSets[i].getId().equals(actionSetId)) {
IExtension ext = actionSets[i].getConfigurationElement().getDeclaringExtension();
reg.removeExtension(ext, new Object[] { actionSets[i] });
return;
}
}
}
项目:translationstudio8
文件:ApplicationActionBarAdvisor.java
/**
* 移除无用的菜单项:<br/>
* File 菜单下的“open file...”和“Convert Line Delimiters To”
*/
private void removeUnusedAction() {
ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();
IActionSetDescriptor[] actionSets = reg.getActionSets();
List<String> actionSetIds = Arrays.asList("org.eclipse.ui.actionSet.openFiles",
"org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo",
"org.eclipse.ui.actions.showKeyAssistHandler");
for (int i = 0; i < actionSets.length; i++) {
if (actionSetIds.contains(actionSets[i].getId())) {
IExtension ext = actionSets[i].getConfigurationElement().getDeclaringExtension();
reg.removeExtension(ext, new Object[] { actionSets[i] });
}
}
}
项目:tmxeditor8
文件:ApplicationActionBarAdvisor.java
/**
* 移除无用的菜单项:<br/>
* File 菜单下的“open file...”和“Convert Line Delimiters To”
*/
private void removeUnusedAction() {
ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();
IActionSetDescriptor[] actionSets = reg.getActionSets();
List<String> actionSetIds = Arrays.asList("org.eclipse.ui.actionSet.openFiles",
"org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo",
"org.eclipse.ui.actions.showKeyAssistHandler");
for (int i = 0; i < actionSets.length; i++) {
if (actionSetIds.contains(actionSets[i].getId())) {
IExtension ext = actionSets[i].getConfigurationElement().getDeclaringExtension();
reg.removeExtension(ext, new Object[] { actionSets[i] });
}
}
}
项目:olca-app
文件:RcpActionBarAdvisor.java
private void removeActionSets() {
// currently we just remove the cheat-sheets here; see:
// http://random-eclipse-tips.blogspot.de/2009/02/eclipse-rcp-removing-unwanted_02.html
ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();
IActionSetDescriptor[] actionSets = reg.getActionSets();
for (int i = 0; i < actionSets.length; i++) {
if (Objects.equals(actionSets[i].getId(),
"org.eclipse.ui.cheatsheets.actionSet")) {
IExtension ext = actionSets[i].getConfigurationElement()
.getDeclaringExtension();
reg.removeExtension(ext, new Object[] { actionSets[i] });
}
}
}