| Summary: | visibleWhen is not checked for key binding only commands | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Szymon Brandys <Szymon.Brandys> |
| Component: | Client | Assignee: | Susan McCourt <susan> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | pwebster |
| Version: | unspecified | ||
| Target Milestone: | 0.4 RC1 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
our first binding-only command that isn't always active. Paul also mentioned the irony of "visibleWhen" when in fact this is an activation expression because the command is never "visible". I'm not sure we need to distinguish, but perhaps a better name. fixed. Szymon, apart from seeing the console log in the visible when expression, I didn't have a way to make sure the validation was working as you expect. Please reopen if there's any problem. The dynamic case of the page target changing is not handled. For example... on the repositories page, when it is just "Repositories" the visibleWhen for "open commit" is false. Good. Now the page target is changed to a particular repository. We recalculate and render and we indeed get a binding. Good. Now change page target back to "Repositories." We need a way to mark the binding as being inactive again. We have never in the past checked a binding when we aren't rendering a command. Here, we know we don't want to render it, but we still need to deactive the binding. Pushed a fix. |
I have a dom command with a check in visibleWhen(). It is added to my page in the following way: commandService.registerCommandContribution("eclipse.orion.git.openCommitCommand", 102, "pageActions", "eclipse.gitGroup"); When the command framework renders the dom commands visibleWhen check is called. Now I made the command a key binding only command. commandService.registerCommandContribution("eclipse.orion.git.openCommitCommand", 102, "pageActions", "eclipse.gitGroup", true, new mCommands.CommandKeyBinding('h', true, true); vivibleWhen is now not checked.