How to hide unwanted wizard and perspective? [message #506723] |
Fri, 08 January 2010 22:59 |
Charles Li Messages: 16 Registered: December 2009 |
Junior Member |
|
|
Hi, All:
I developed an RCP application and everything is fine. Now I am adding new functionalities and added the following two plugins in the Dependencies tab:
- org.eclipse.wst.xml.ui.
- org.eclipse.wst.sse.ui.
Now in my application,
(1) File > New Project... menu will bring up two more wizard options in the list - "XML>XML" and "Examples>Editing and validating XML files".
(2) Window > Open perspective... will bring up one more prespective in the list - "XML".
I don't need these wizards and perspectives in my application. how do I hide them?
Thanks a lot for all your help!
[Updated on: Fri, 08 January 2010 23:25] Report message to a moderator
|
|
|
|
|
Re: How to hide unwanted wizard and perspective? [message #507518 is a reply to message #506840] |
Wed, 13 January 2010 18:21 |
dwain Missing name Messages: 35 Registered: October 2009 |
Member |
|
|
I had a similar issue. It is easily resolved through activityPatternBindings. This is how I solved my issue.
1.) Open your Plugin.xml and go to the Extensions page.
2.) Add org.eclipse.ui.activities extension.
3.) Create an activity and call it disable or whatever you want really and give it an id.
4.) Add an enabledWhen to that activity.
5.) Then add a with to the enabledWhen with the variable true.
6.) Then add an equals to the with with the value false.
Now your activity should look like this in the plugin.xml...
<activity id="com.XXXXX.XXXX.common.activity.disable" name="disable">
<enabledWhen>
<with variable="true">
<equals value="false">
</equals>
</with>
</enabledWhen>
</activity>
7.) Now find the id's of the wizards you want to disable. You can easily do this by opening the Plugin-Registry view (Window->Show View->Plugin-Develpment). Then search in the plugin-registry view for the plugin you added, org.eclipse.wst.xml.ui. You can also open the wizard you want to disable and use the Plugin-Spy to find what plugin it is coing from, (ALT-SHFT-F1), and you can click the Contributing Plugin link which will open the Manifest editor. Find that package and expand the extensions. You will find the new wizard extensions there with their ids.
8.) Add a activityPatternBinding. Set the activityId to the id of your disable activity.
9.) Set the pattern to: .*/org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard You can also use a wildcard to disable a group since most groups will have a similar id(i.e. .*/org.eclipse.wst.xml.ui.internal.wizards.*) but you need to be careful since this can disable things you might want.
Now your plugin.xml should look like this:
<activity id="com.XXXXX.XXXX.common.activity.disable" name="disable">
<enabledWhen>
<with variable="true">
<equals value="false">
</equals>
</with>
</enabledWhen>
</activity>
<activityPatternBinding activityId="com.XXXXX.XXXX.common.activity.disable" pattern=".*/org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard">
</activityPatternBinding>
That should disable the XML Wizard. Then you should just follow the same steps to disable the rest of the unwanted wizards.
This binding will also disable the Editing and Validating Examples wizard...
<activityPatternBinding activityId="com.XXXXX.XXXX.common.activity.disable" pattern=".*/org.eclipse.wst.xml.ui.XMLExampleProjectCreationWizard">
</activityPatternBinding>
[Updated on: Wed, 13 January 2010 18:28] Report message to a moderator
|
|
|
|
|
|
Re: How to hide unwanted wizard and perspective? [message #507855 is a reply to message #507840] |
Thu, 14 January 2010 21:15 |
dwain Missing name Messages: 35 Registered: October 2009 |
Member |
|
|
Sorry. I don't know that much about the syntax other then what I have done and posted already. From what I understand though the pattern is the plugin id/the id your binding the activity to. Or you can use the .* wildcard to remove that id from all packages. Most of the patterns I have done are like:
.*/org.eclipse.debug.ui.DebugPerspective
.*/org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard
.*/org.eclipse.wst.css.ui.internal.wizard.NewCSSWizard
.*/org.eclipse.wst.xml.ui.XMLExampleProjectCreationWizard
You should be able to search around for a good tutorial on the patterns though. This is a pretty good blog about them.
http://www.vogella.de/blog/tag/activities/
[Updated on: Thu, 14 January 2010 21:16] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.05435 seconds