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

Bug 311077

Summary: [Compatibility] Ctrl+C doesn't work in 'Package Explorer'
Product: [Eclipse Project] e4 Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact: Paul Webster <pwebster>
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: 1.0 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
ActionBars patch v1 none

Description Remy Suen CLA 2010-04-29 13:54:09 EDT
In 3.x, we have an ActionHandler. In e4, we're in an WidgetMethodHandler.

Thread [main] (Suspended)	
	CopyToClipboardAction.run(IStructuredSelection) line: 112	
	CopyToClipboardAction(SelectionDispatchAction).dispatchRun(ISelection) line: 274	
	CopyToClipboardAction(SelectionDispatchAction).run() line: 250	
	CopyToClipboardAction(Action).runWithEvent(Event) line: 498	
	ActionHandler.execute(ExecutionEvent) line: 119	
	Command.executeWithChecks(ExecutionEvent) line: 476	
	ParameterizedCommand.executeWithChecks(Object, Object) line: 508	
	HandlerService.executeCommand(ParameterizedCommand, Event) line: 169	
	WorkbenchKeyboard.executeCommand(Binding, Event) line: 468	
	WorkbenchKeyboard.press(List, Event) line: 786	
	WorkbenchKeyboard.processKeyEvent(List, Event) line: 885	
	WorkbenchKeyboard.filterKeySequenceBindings(Event) line: 567	
	WorkbenchKeyboard.access$3(WorkbenchKeyboard, Event) line: 508	
	WorkbenchKeyboard$KeyDownFilter.handleEvent(Event) line: 123	
	EventTable.sendEvent(Event) line: 84	
	Display.filterEvent(Event) line: 1253

Thread [main] (Suspended)	
	WidgetMethodHandler.execute(ExecutionEvent) line: 157	
	HandlerProxy.execute(ExecutionEvent) line: 293	
	E4HandlerProxy.execute(IEclipseContext) line: 55	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 48	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 37	
	Method.invoke(Object, Object...) line: 600	
	MethodRequestor.callMethod(Method, Object[]) line: 57	
	MethodRequestor.execute() line: 32	
	InjectorImpl.invokeUsingClass(Object, Class<?>, Class<Annotation>, Object, AbstractObjectSupplier, boolean) line: 180	
	InjectorImpl.invoke(Object, Class<Annotation>, Object, AbstractObjectSupplier) line: 161	
	ContextInjectionFactory.invoke(Object, Class<Annotation>, IEclipseContext, Object) line: 104	
	HandlerServiceImpl.executeHandler(ParameterizedCommand) line: 114	
	KeyBindingDispatcher.executeCommand(ParameterizedCommand, Event) line: 260	
	KeyBindingDispatcher.press(List, Event) line: 456	
	KeyBindingDispatcher.processKeyEvent(List, Event) line: 506	
	KeyBindingDispatcher.filterKeySequenceBindings(Event) line: 339	
	KeyBindingDispatcher.access$0(KeyBindingDispatcher, Event) line: 285	
	KeyBindingDispatcher$KeyDownFilter.handleEvent(Event) line: 74	
	EventTable.sendEvent(Event) line: 84	
	Display.filterEvent(Event) line: 1253
Comment 1 Remy Suen CLA 2010-04-29 14:25:18 EDT
We're also using a WMH for the 'Navigator' view.
Comment 2 Paul Webster CLA 2010-04-29 14:27:44 EDT
We aren't adding the CopyToClipboardAction as a handler in the correct place.  That probably means our setGlobalActionHandler(*) isn't using the correct incantation to make it available to the new command framework.

PW
Comment 3 Remy Suen CLA 2010-04-29 15:51:25 EDT
(In reply to comment #2)
> We aren't adding the CopyToClipboardAction as a handler in the correct place. 
> That probably means our setGlobalActionHandler(*) isn't using the correct
> incantation to make it available to the new command framework.

public void setGlobalActionHandler(String actionId, IAction handler) {
  // FIXME compat setGlobalActionHandler: needs to actually register
  // handlers
  actions.put(actionId, handler);
}

Well, this looks suspect.
Comment 4 Remy Suen CLA 2010-04-29 16:05:11 EDT
Created attachment 166566 [details]
ActionBars patch v1

The code was there but it was being incorrectly overridden it seems.
Comment 5 Paul Webster CLA 2010-04-29 19:53:33 EDT
(In reply to comment #3)
>   // FIXME compat setGlobalActionHandler: needs to actually register
>   // handlers
> 
> Well, this looks suspect.

That would definitely be the incorrect way of registering them ...

PW
Comment 6 Remy Suen CLA 2010-05-03 13:30:03 EDT
(In reply to comment #4)
> Created an attachment (id=166566) [details]
> ActionBars patch v1

Fix released to HEAD.