Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326056

Summary: [Compatibility] Java search menu is disabled
Product: [Eclipse Project] Platform Reporter: Olivier Thomann <Olivier_Thomann>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Remy Suen <remy.suen>
Severity: major    
Priority: P3 CC: daniel_megert, Mike_Wilson, remy.suen
Version: 4.1   
Target Milestone: 4.1.1   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 350264    
Attachments:
Description Flags
WorkbenchPage patch v1 none

Description Olivier Thomann CLA 2010-09-23 09:42:27 EDT
Using I20100922-0843, I don't have a java search menu I can use in the Java perspective.
The java search menu is always disabled.
I need to use Ctrl + H in order to open the search dialog.
Comment 1 Remy Suen CLA 2010-09-23 11:01:42 EDT
It seems that the menu item is disabled because the handler service has deemed that the command cannot be executed.

Thread [main] (Suspended (breakpoint at line 258 in ItemImpl))	
	HandledMenuItemImpl(ItemImpl).setEnabled(boolean) line: 258	
	HandledMenuItemRenderer.setEnabled(MHandledMenuItem, MenuItem) line: 92	
	HandledMenuItemRenderer.createWidget(MUIElement, Object) line: 78	
	PartRenderingEngine.createWidget(MUIElement, Object) line: 572	
	PartRenderingEngine.createGui(MUIElement, Object, IEclipseContext) line: 414	
	PartRenderingEngine.createGui(MUIElement) line: 490	
	PartRenderingEngine$3.handleEvent(Event) line: 188	
	UIEventHandler.handleEvent(Event) line: 41	
	EventHandlerWrapper.handleEvent(Event, Permission) line: 188	
	EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 198	
	EventManager.dispatchEvent(Set<Entry<K,V>>, EventDispatcher<K,V,E>, int, E) line: 230	
	ListenerQueue<K,V,E>.dispatchEventSynchronous(int, E) line: 148	
	EventAdminImpl.dispatchEvent(Event, boolean) line: 139	
	EventAdminImpl.sendEvent(Event) line: 78	
	EventComponent.sendEvent(Event) line: 39	
	EventBroker.send(String, Object) line: 73	
	UIEventPublisher.notifyChanged(Notification) line: 58	
	MenuImpl(BasicNotifierImpl).eNotify(Notification) line: 380	
	EObjectContainmentWithInverseEList<E>(EcoreEList<E>).dispatchNotification(Notification) line: 255	
	EObjectContainmentWithInverseEList<E>(NotifyingListImpl<E>).addUnique(int, E) line: 362	
	EObjectContainmentWithInverseEList<E>(AbstractEList<E>).add(int, E) line: 345	
	ContributionsAnalyzer.processAddition(MMenu, ArrayList<MMenuElement>, MMenuContribution, HashSet<String>, HashSet<String>) line: 217	
	ContributionsAnalyzer.addMenuContributions(MMenu, ArrayList<MMenuContribution>, ArrayList<MMenuElement>) line: 184	
	MenuServiceFilter.showMenu(Event, Menu, MMenu) line: 171	
	MenuServiceFilter.handleMenu(Event, Menu, MMenu) line: 145	
	MenuServiceFilter.safeHandleEvent(Event) line: 131	
	MenuServiceFilter.access$1(MenuServiceFilter, Event) line: 113	
	MenuServiceFilter$1.run() line: 108	
	SafeRunner.run(ISafeRunnable) line: 42	
	MenuServiceFilter.handleEvent(Event) line: 94	
	EventTable.sendEvent(Event) line: 84	
	Display.filterEvent(Event) line: 1253
Comment 2 Remy Suen CLA 2010-11-17 07:31:15 EST
The 'org.eclipse.jdt.ui.SearchActionSet' context does not appear to be activated.
Comment 3 Remy Suen CLA 2010-11-17 07:45:55 EST
(In reply to comment #2)
> The 'org.eclipse.jdt.ui.SearchActionSet' context does not appear to be
> activated.

Actually, this action set isn't added to the perspective in 3.x so perhaps there is something else that is missing.
Comment 4 Remy Suen CLA 2011-03-11 09:03:27 EST
The 'Search > Java...' menu in the window's main menu bar is now enabled on I20110310-2200. Is this the menu item you are referring to in comment 0, Olivier?
Comment 5 Olivier Thomann CLA 2011-03-11 09:05:38 EST
(In reply to comment #4)
> The 'Search > Java...' menu in the window's main menu bar is now enabled on
> I20110310-2200. Is this the menu item you are referring to in comment 0,
> Olivier?
yes. Thanks.
Comment 6 Remy Suen CLA 2011-03-11 09:08:54 EST
(In reply to comment #5)
> (In reply to comment #4)
> > The 'Search > Java...' menu in the window's main menu bar is now enabled on
> > I20110310-2200. Is this the menu item you are referring to in comment 0,
> > Olivier?
> yes. Thanks.

Great, I'm going to resolve this bug then. Please let us know if the problem comes back.
Comment 7 Dani Megert CLA 2011-03-15 08:05:32 EDT
This is not fixed:
1. download 4.1 M6 (I20110312-1300)
2. start new workspace
3. paste "class C{}" into Package Explorer
5. main menu > Search
==> "Java..." is disabled
Comment 8 Dani Megert CLA 2011-03-15 08:13:48 EDT
(In reply to comment #7)
> This is not fixed:
> 1. download 4.1 M6 (I20110312-1300)
> 2. start new workspace
> 3. paste "class C{}" into Package Explorer
> 5. main menu > Search
> ==> "Java..." is disabled

Forgot step 4: close the editor.
Comment 9 Remy Suen CLA 2011-06-20 16:10:00 EDT
(In reply to comment #8)
> (In reply to comment #7)
> > This is not fixed:
> > 1. download 4.1 M6 (I20110312-1300)
> > 2. start new workspace
> > 3. paste "class C{}" into Package Explorer
> > 5. main menu > Search
> > ==> "Java..." is disabled
> 
> Forgot step 4: close the editor.

Cannot reproduce with I20110617-1015 on Windows XP.
Comment 10 Dani Megert CLA 2011-06-21 02:49:33 EDT
I can easily reproduce on Windows 7 using the steps from comment 8. Actually, I cannot find a way to get Search > Java... enabled when the the Package Explorer is active.
Comment 11 Paul Webster CLA 2011-06-21 10:50:07 EDT
I can reproduce on I20110620-1631.

We must have tied its enabled state to the editor.

PW
Comment 12 Dani Megert CLA 2011-06-21 10:52:05 EDT
Note that it should also not be tied to the selection i.e. the menu should also be enabled when the PE is active and no selection in it.
Comment 13 Remy Suen CLA 2011-06-24 09:14:53 EDT
Created attachment 198530 [details]
WorkbenchPage patch v1

The closed editor was incorrectly disabling action sets that were still relevant. We should update the information about the state of the current workbench page based on the active part if there are no active editors.
Comment 14 Remy Suen CLA 2011-06-24 09:16:31 EDT
(In reply to comment #13)
> Created attachment 198530 [details]
> WorkbenchPage patch v1

Patch released to R4_1_maintenance.
Comment 15 Dani Megert CLA 2011-07-27 08:22:45 EDT
Verified in M20110721-1600.