Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 164316 - [Menus] "Show Annotation" and "Show History" commands disabled after opening Synchronize view
Summary: [Menus] "Show Annotation" and "Show History" commands disabled after opening ...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-13 09:19 EST by Markus Keller CLA
Modified: 2007-05-01 10:06 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2006-11-13 09:19:27 EST
I20061108-1600

- assign keyboard shortcut Alt+Shift+H to "CVS > Show History"
- open an editor for a file from CVS
- press Alt+Shift+H
=> action runs, everything OK

- choose editor context menu > Team > Synchronize with Repositoy
- click No (do not switch perspective)
- click into editor
- press Alt+Shift+H
=> nothing happens. From now on, Alt+Shift+H never works again in this session.

The same problem happens for "CVS > Show Annotation". It looks like the retargetable actions' enablement state gets confused when the Synchronize view is opened.
Comment 1 Michael Valenta CLA 2006-11-27 12:26:11 EST
Do you have the CVS action set enabled in your perspective (i.e. is there a CVS main menu)?
Comment 2 Markus Keller CLA 2006-11-27 12:44:12 EST
I currently have it enabled, but I had the same problem also without the CVS menu (but back then, I had no clue what was the trigger for the disablement).
Comment 3 Michael Valenta CLA 2006-11-27 13:01:10 EST
Actually, I asked because the CVS keybindings should only work when the action set is on but, in the past, they have worked intermittently when the action set is off (due to a workbench bug). If you have the problem with the action set on, then it is most likely a CVS problem.
Comment 4 Markus Keller CLA 2006-11-27 13:21:25 EST
> Actually, I asked because the CVS keybindings should only work when the action
> set is on [..]

Really? I would expect that they work as soon as the command is reachable from the context menu (where the menu item also shows the keybinding).
Comment 5 Michael Valenta CLA 2006-11-27 13:33:07 EST
No, it is not that easy since the context menu is not built until the user right-clicks but the handlers must be known before then for keybindings to work. This is only an issue for menu items that are contributed using the popupmenu/objectContribution.
Comment 6 Michael Valenta CLA 2006-12-20 13:00:36 EST

*** This bug has been marked as a duplicate of bug 69650 ***
Comment 7 Markus Keller CLA 2007-02-08 07:19:31 EST
This is not a dup of bug 69650. There, the focus is completely lost. Here, The "Show Annotation" keybinding just stops working -- everything else is still OK.
Comment 8 Michael Valenta CLA 2007-02-27 12:33:01 EST
I've debugged this a bit and it appears that, after the Synchronize command is performed, the command no longer is enabled. Here's the trace of where the failure occurs. The CommandLegacyActionWrapper.isEnabledDisregardingCommand is set to false. The enablement of the action is fine in the main menu so I assume the issue lies somewhere in the legacy wrapper code.

Thread [main] (Suspended)	
	CommandLegacyActionWrapper.isEnabledDisregardingCommand() line: 305	
	ActionDelegateHandlerProxy.isEnabled() line: 420	
	Command.isEnabled() line: 827	
	WorkbenchKeyboard.executeCommand(Binding, Event) line: 453	
	WorkbenchKeyboard.press(List, Event) line: 791	
	WorkbenchKeyboard.processKeyEvent(List, Event) line: 838	
	WorkbenchKeyboard.filterKeySequenceBindings(Event) line: 565	
	WorkbenchKeyboard.access$3(WorkbenchKeyboard, Event) line: 507	
	WorkbenchKeyboard$KeyDownFilter.handleEvent(Event) line: 124	
	EventTable.sendEvent(Event) line: 66	
	Display.filterEvent(Event) line: 1139	
	StyledText(Widget).sendEvent(Event) line: 937	
	StyledText(Widget).sendEvent(int, Event, boolean) line: 962	
	StyledText(Widget).sendEvent(int, Event) line: 947	
	StyledText(Control).traverse(Event) line: 3219	
	StyledText(Control).translateMnemonic(MSG) line: 3081	
	Display.translateMnemonic(MSG, Control) line: 4143	
	Display.filterMessage(MSG) line: 1153	
	Display.readAndDispatch() line: 3249	
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2286	
	Workbench.runUI() line: 2250	
	Workbench.access$4(Workbench) line: 2125	
	Workbench$4.run() line: 459	
	Realm.runWithDefault(Realm, Runnable) line: 289	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 454	
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149	
	IDEApplication.start(IApplicationContext) line: 101	
	EclipseAppHandle.run(Object) line: 146	
	EclipseAppLauncher.runApplication(Object) line: 106	
	EclipseAppLauncher.start(Object) line: 76	
	EclipseStarter.run(Object) line: 354	
	EclipseStarter.run(String[], Runnable) line: 169	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 85	
	NativeMethodAccessorImpl.invoke(Method, Object, Object[]) line: 58	
	DelegatingMethodAccessorImpl.invoke(Method, Object, Object[]) line: 60	
	Method.invoke(Object, Object[]) line: 391	
	Main.invokeFramework(String[], URL[]) line: 476	
	Main.basicRun(String[]) line: 416	
	Main.run(String[]) line: 1124	
	Main.main(String[]) line: 1099	
	Main.main(String[]) line: 1099	
	Main.main(String[]) line: 1099	
Comment 9 Paul Webster CLA 2007-04-24 18:38:13 EDT
This was fixed as part of bug 171319.

An IActionDelegate keybindings would work until the first time it disabled its IAction (CommandLegacyActionWrapper).  After that, isEnabled() always returned false, so the selectionChanged(*) method was never called again.

I updated isEnabled to refresh the enablement before return true or false.

I am no longer able to reproduce the problem.

PW
Comment 10 Paul Webster CLA 2007-05-01 10:06:08 EDT
In I20070501-0010
PW