Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to hide unwanted wizard and perspective?
How to hide unwanted wizard and perspective? [message #506723] Fri, 08 January 2010 22:59 Go to next message
Charles Li is currently offline Charles LiFriend
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 #506734 is a reply to message #506723] Sat, 09 January 2010 09:55 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

I think that you can try to take a look at org.eclipse.ui.perspectiveExtensions

Regards,

Aurelien Pupier


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: How to hide unwanted wizard and perspective? [message #506840 is a reply to message #506734] Sun, 10 January 2010 21:51 Go to previous messageGo to next message
Charles Li is currently offline Charles LiFriend
Messages: 16
Registered: December 2009
Junior Member
Aurelien:

Thank you for your response!

I understand how to use perspectiveExtensions to add my new Perspective. But can you show me how to use it to hide the perspectives that I don't want?

Thanks again!
Re: How to hide unwanted wizard and perspective? [message #507518 is a reply to message #506840] Wed, 13 January 2010 18:21 Go to previous messageGo to next message
dwain Missing name is currently offline dwain Missing nameFriend
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 #507811 is a reply to message #507518] Thu, 14 January 2010 18:08 Go to previous messageGo to next message
Charles Li is currently offline Charles LiFriend
Messages: 16
Registered: December 2009
Junior Member
I definitely appreciate the detailed instructions!!!

1. Opening the Plugin-Registry view (Window->Show View->Plugin-Develpment) made my Eclipse freeze (3 times) and the Registry view never came up.

2. Tried (ALT-SHFT-F1) and there is no "Contributing plugin" link. I am using Eclispe Gallelio 3.5. Do I need to do some install to get Plugin Spy?

3. Menwhile I created another perspective, and even more unwanted showed up.

Thanks a lot!
Re: How to hide unwanted wizard and perspective? [message #507836 is a reply to message #507811] Thu, 14 January 2010 20:10 Go to previous messageGo to next message
dwain Missing name is currently offline dwain Missing nameFriend
Messages: 35
Registered: October 2009
Member
I had a similar issue with the Plugin-Registry view. If you let it load completely before you try to use it that seems to work. Just watch for the little progress bar in the bottom right hand corner. I am also using 3.5 and my plugin-spy looks like:

http://farm5.static.flickr.com/4004/4274991300_59b38ab64d.jpg

You have to have the wizard you want to block open then open the plugin-spy with the shortcut ALT-SHFT-F1 or whatever that shortcut is set to in your key preferences. Then there should be a link just like the one I highlighted in the picture.
Re: How to hide unwanted wizard and perspective? [message #507840 is a reply to message #507836] Thu, 14 January 2010 20:26 Go to previous messageGo to next message
Charles Li is currently offline Charles LiFriend
Messages: 16
Registered: December 2009
Junior Member
Many Thanks!

Now question on the syntax for the pattern: I see some people uses "\" before every "." while others don't. Any rules around the pattern that you can point me to read?

Thanks again!

[Updated on: Thu, 14 January 2010 21:00]

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 Go to previous messageGo to next message
dwain Missing name is currently offline dwain Missing nameFriend
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

Re: How to hide unwanted wizard and perspective? [message #655350 is a reply to message #506723] Sat, 19 February 2011 18:12 Go to previous message
Endre  ovács is currently offline Endre ovácsFriend
Messages: 3
Registered: February 2011
Junior Member
for another, programmatical approach check my reply:
http://www.eclipse.org/forums/index.php?t=msg&goto=65534 9&S=6410ca96e014ce030a5b50dc08085115#msg_655349
Previous Topic:Tying Editor & View
Next Topic:Turn on splash screen for debugging RCP
Goto Forum:
  


Current Time: Tue Mar 19 11:11:12 GMT 2024

Powered by FUDForum. Page generated in 0.03372 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top