Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Search menu trouble(I need to disable the search menu until I am logged in and always have the file search disabled)
Search menu trouble [message #491791] Thu, 15 October 2009 20:59 Go to next message
dwain Missing name is currently offline dwain Missing nameFriend
Messages: 35
Registered: October 2009
Member
I am creating a plugin and I need to be able to disable the search menu item. I am using the search plugin which works great, except that in the login perspective, I don't want the search menu to show. However I do want it to show once they are logged in but I don't want them to be able to see the File search option. I am able to do either of these things alone but not together. I can disable the search menu item through an activityPatternBinding:
.*/org.eclipse.search.*

And tie that to an enabledWhen activity and that works great. Or I can disable the file search with an activityPattern Binding:
.*/org.eclipse.search.internal.ui.text.TextSearchPage

and tie that to an activity that is never enabled and that removes the ability to do a file search. However when I put both of them in the ./org.eclipse.search.* enables the text search page, even with the other activityPatternBinding saying that that part is disabled, along with the rest of the search functionality. Is there a way to use an activityPatternBinding to just disable the search menu and toolbar button without disabling the rest of org.eclipse.search? Am I going about this the wrong way? Any suggestions on what I can do to make this work?

Thank you.
Dwain
Re: Search menu trouble [message #491893 is a reply to message #491791] Fri, 16 October 2009 12:52 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You can disable the search actionSet if you can find it ... I usually look in the Plug-in Registry view under org.eclipse.ui/Extension Points/org.eclipse.ui.actionSets.

But you cannot disable just one action from an actionSet (i.e. if File and Java both came from the same actionSet, you can get both but not one without the other)

PW


Re: Search menu trouble [message #492302 is a reply to message #491893] Mon, 19 October 2009 21:04 Go to previous messageGo to next message
dwain Missing name is currently offline dwain Missing nameFriend
Messages: 35
Registered: October 2009
Member
Thank you Paul, that Plugin-Registry View helped immensely. I was able to remove the Search actions on my login perspective with:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().hideActionSet( "org.eclipse.search.searchActionSet");

Then I was able to remove the unwanted search actions and pages through activityPatternBindings on the ids:
.*/org.eclipse.search.TextSearchWorkingSet
.*/org.eclipse.search.TextSearchWorkspace
.*/org.eclipse.search.TextSearchProject
.*/org.eclipse.search.OpenFileSearchPage
.*/org.eclipse.search.TextSearchFile


It works great now and thanks for the pointer of the Plugin-Registry view, made finding the appropriate ID's so much easier.
Re: Search menu trouble [message #496407 is a reply to message #492302] Mon, 09 November 2009 22:11 Go to previous message
No real name is currently offline No real nameFriend
Messages: 1
Registered: November 2009
Junior Member
On the same lines... If I would like to hide the menu option on Help which says "Software Updates", what would be the pattern to use in plugin.xml
I used plugin spy to find this on Eclipse 3.5, but was unsuccessful. Need help from you experts.

thanks,
Alka.
Previous Topic:Email through "Program.launch"
Next Topic:Error while tryng to run uitestapplicaton
Goto Forum:
  


Current Time: Sun Dec 21 10:50:53 GMT 2014

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

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