| Summary: | [e4] install more connectors button not functional | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Steffen Pingel <steffen.pingel> | ||||||
| Component: | Mylyn | Assignee: | Steffen Pingel <steffen.pingel> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | emoffatt, greensopinion, pwebster, remy.suen | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 3.5 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 321278, 336432 | ||||||||
| Attachments: |
|
||||||||
|
Description
Steffen Pingel
The code that runs the command looks roughly like this:
IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
Command discoveryWizardCommand = service.getCommand("org.eclipse.mylyn.discovery.ui.discoveryWizardCommand");
discoveryWizardCommand.executeWithChecks(createExecutionEvent(discoveryWizardCommand, handlerService));
It ends up in Workbench.MakeHandlersGo.execute() which seems to do nothing at the moment. I can execute the command manually through Ctrl+3.
Is there a forward/backwards compatible way to programmatically invoking a command?
(In reply to comment #1) > It ends up in Workbench.MakeHandlersGo.execute() which seems to do nothing at > the moment. I can execute the command manually through Ctrl+3. This probably means we're not enabling/disabling your handler(s) correctly then. > Is there a forward/backwards compatible way to programmatically invoking a > command? You can try executing with the IHandlerService instead and see if that gets you anywhere. CommandProvider's execute() method might be of use to you. http://dev.eclipse.org/viewcvs/index.cgi/e4/org.eclipse.e4.compatibility/bundles/org.eclipse.ui.workbench/Eclipse%20UI/org/eclipse/ui/internal/quickaccess/CommandElement.java?view=markup Created attachment 181147 [details]
fix
Created attachment 181148 [details]
mylyn/context/zip
Thanks, that works. Should I file a bug against e4? Seems like the behavior has changed slightly. I have committed the attached patch. David, could you take a look. You wrote the original command execution code. (In reply to comment #5) > Thanks, that works. Should I file a bug against e4? Seems like the behavior has > changed slightly. Yes, please do, Steffen. Is everything of interest in the *.tasks.ui bundle? It would help us if we could know where to check for relevant code and plugin.xml extension point definitions. Thanks! <rcjsuen> paulweb515: yesterday night Steffen CC'd me on a Mylyn bug, apparently command.execute... didn't work <rcjsuen> i told him to use IHandlerS instead <rcjsuen> and that worked <rcjsuen> he said it went inside MakeHnadlersGo <rcjsuen> so i said it was probably bcuz we weren't "enabling/disabling" his handlers correctly <rcjsuen> i mean, when he called command.executeWithChecks it went inside MHG <rcjsuen> but using IHS to execute worked for him <paulweb515> rcjsuen: cmd.execute(*) doesn't work <rcjsuen> oh ok <paulweb515> at all in 4.1 <paulweb515> The protocol is wrong <rcjsuen> so it's intentional? <paulweb515> yes <rcjsuen> paulweb515: so we'll just tell everyone to use IHS execute instead? <paulweb515> but I set all commands to MakeHandlerGo otherwise the Command isHandled() returns false ... and nothing in 3.x works <paulweb515> rcjsuen: they're supposed to do that already, using the 3.x IHandlerService <rcjsuen> oic <rcjsuen> ok <rcjsuen> i'll just copy/paste our convo here to there then <paulweb515> That's not to say that with some hand-waving we could get cmd.execute(*) working <rcjsuen> right <paulweb515> In theory MakeHandlersGo would just be a front for appContext..get(EHandlerService.class).execute(*) except without the ability to provide their own ExecutionEvent :-) <paulweb515> rcjsuen: but even in 3.x, we've always said get IHandlerService and execute a command that way So it's not to say we won't make it work in 4.x, but IHandlerService is the way to go. Thanks for the information. It might help to document that in the code so others who follow the execution path know why it doesn't work and how to work around it. I'll check the Mylyn sources if we execute commands directly anywhere else. (In reply to comment #5) > I have committed the attached patch. David, could you take a look. You wrote the > original command execution code. Looks good, in fact it looks cleaner than the original. Nice to know about @IHandlerService.executeCommand@ Thanks for the review. I'll mark it resolved then. |