activities and filter out GUI [message #334080] |
Mon, 19 January 2009 16:35 |
Stella Levin Messages: 89 Registered: July 2009 |
Member |
|
|
Hi,
I use activities extension point to filter out menus and toolbars.
I define it in the plugin.xml as below. But I still get
"Edit","Navigate","Project" menus. My application don't need to edit or
build. It is not editable.
<extension
point="org.eclipse.ui.activities">
<category
name="Filter GUI Category"
id="org.myorg.category.excludeFromGUI">
</category>
<categoryActivityBinding
activityId="org.myorg.activity.excludeFromGUI"
categoryId="org.myorg.category.excludeFromGUI">
</categoryActivityBinding>
<activity
name = "Exclude GUI"
description="Exclude GUI"
id="org.myorg.activity.excludeFromGUI">
</activity>
<activityPatternBinding
activityId="org.myorg.activity.excludeFromGUI"
pattern=".*/org\.eclipse\.ui\.examples\.*">
</activityPatternBinding>
<activityPatternBinding
activityId="org.myorg.activity.excludeFromGUI"
pattern=".*/org.eclipse.search.menu.*">
</activityPatternBinding>
<activityPatternBinding
activityId="org.myorg.activity.excludeFromGUI"
pattern=".*/org.eclipse.edit.menu.*">
</activityPatternBinding>
</extension>
1) How may I detect the ids of different menu items in order to define
them in activity binding, for example:
Project->Build Working Set, Build Automatically
Edit->Undo,Redo,Cut,Copy,Paste
2) Is it possible to remove all the menus and tool bars and add my owns ?
When I tried to define as following - I still get some menus
<activityPatternBinding
activityId="org.myorg.activity.excludeFromGUI"
pattern=".*/.*">
</activityPatternBinding>
Thanks a lot.
Stella
|
|
|
|
Re: activities and filter out GUI [message #493554 is a reply to message #334080] |
Mon, 26 October 2009 19:39 |
|
I'd like to remove the Run menu completely. I've got all of the menu items removed with activities but I'm unable to remove the empty Run menu. My activity is:
<activity description="Hide Run menu" id="activity.runMenu" name="RunMenu activity"
</activity>
<activityPatternBinding activityId="activity.runMenu" pattern=".*/org.eclipse.ui.run">
<activityPatternBinding>
Could the problem be groupMarkers left in the menu? If so, they have no id so do I use a matcher for their name? Or is there something else to this?
Any help greatly appreciated.
Craig
|
|
|
|
|
|
Re: activities and filter out GUI [message #493645 is a reply to message #493610] |
Tue, 27 October 2009 13:03 |
|
Stella wrote on Tue, 27 October 2009 04:57 |
------------------------------------------------------------ --------------------------
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
// Actions to remove
private String actionId = "org.eclipse.ui.edit.text.actionSet.convertLineDelim
itersTo";
ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegis
try();
IActionSetDescriptor[] actionSets = reg.getActionSets();
for (int i = 0; i <actionSets.length; i++) {
if (!actionSets[i].getId().equals(actionId)) continue;
IExtension ext = actionSets[i].getConfigurationElement()
.getDeclaringExtension();
reg.removeExtension(ext, new Object[] { actionSets[i] });
}
------------------------------------------------------------ --------------------------
|
Just a note ... this is not guaranteed to exist from one release to the next (even between 3.5.0 and 3.5.1 for example) and it definitely won't work reliably within one session (if there's any dynamic content going on).
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07045 seconds