Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsConflict in keys shortcuts
https://www.eclipse.org/forums/index.php/mv/msg/220344/696158/#msg_696158
Originally posted by: Martin Jedlicka
Hi,
I have question on definition key binding. I have an RCP application
and in application two plugins 'poll.lsn.monitorvariable' and
'poll.lsn.recorddata'. I defined keys shortcuts CTRL+G in each plugin
this way:
Is it possible somehow to resolve this error or do I have in my
application a unique keys shortcuts (Ctrl+G only once)? I'd rather solve
it somehow, but I do not know how.
Thanks.
Martin]]>2011-07-13T11:41:25-00:00Re: Conflict in keys shortcuts
https://www.eclipse.org/forums/index.php/mv/msg/220344/696494/#msg_696494
Originally posted by: Martin Jedlicka
Note:
Plugins 'poll.lsn.monitorvariable' and 'poll.lsn.recorddata' are in
different perspectives.
It is possible to have the same keys shortcuts in a variety of perspectives?
Martin
Dne 13.7.2011 13:41, Martin Jedlicka napsal(a):
> Hi,
>
> I have question on definition key binding. I have an RCP application and
> in application two plugins 'poll.lsn.monitorvariable' and
> 'poll.lsn.recorddata'. I defined keys shortcuts CTRL+G in each plugin
> this way:
>
> Plugin 'poll.lsn.monitorvariable:
>
> <command
> categoryId="poll.lsn.monitorvariable.commands"
>
> defaultHandler="poll.lsn.monitorvariable.actions.ChartPropertiesHandler"
> id="poll.lsn.monitorvariable.command.chartproperties"
> name="%poll.lsn.monitorvariable.command.chartproperties">
> </command>
>
> <key
> commandId="poll.lsn.monitorvariable.command.chartproperties"
> contextId="org.eclipse.ui.contexts.window"
> schemeId="poll.lsn.scheme"
> sequence="M1+G">
> </key>
>
> Plugin 'poll.lsn.recorddata':
>
> <command
> categoryId="poll.lsn.recorddata.commands"
>
> defaultHandler="poll.lsn.recorddata.actions.ShowChartAndLogAnHandler"
> id="poll.lsn.recorddata.command.showchartlogan"
> name="%poll.lsn.recorddata.command.showchartlogan">
> </command>
>
> <key
> commandId="poll.lsn.recorddata.command.showchartlogan"
> contextId="org.eclipse.ui.contexts.window"
> schemeId="poll.lsn.scheme"
> sequence="M1+G">
> </key>
>
> After started my application occurred a conflict for CTRL+G:
>
> !MESSAGE A conflict occurred for CTRL+G:
> Binding(CTRL+G,
>
> ParameterizedCommand(Command(poll.lsn.monitorvariable.command.chartproperties,Nastavení
> grafu,
> ,
> Category(poll.lsn.monitorvariable.commands,Sledování
> proměnných,MonitorVariable commands,true),
> poll.lsn.monitorvariable.actions.ChartPropertiesHandler,
> ,,true),null),
> poll.lsn.scheme,
> org.eclipse.ui.contexts.window,,,system)
> Binding(CTRL+G,
>
> ParameterizedCommand(Command(poll.lsn.recorddata.command.showchartlogan,Zobrazení
> analogového grafu / logického analyzátoru,
> ,
> Category(poll.lsn.recorddata.commands,Záznamník dat,RecordData
> commands,true),
> poll.lsn.recorddata.actions.ShowChartAndLogAnHandler,
> ,,true),null),
> poll.lsn.scheme,
> org.eclipse.ui.contexts.window,,,system)
>
> Is it possible somehow to resolve this error or do I have in my
> application a unique keys shortcuts (Ctrl+G only once)? I'd rather solve
> it somehow, but I do not know how.
>
> Thanks.
>
> Martin]]>2011-07-14T05:59:40-00:00Re: Conflict in keys shortcuts
https://www.eclipse.org/forums/index.php/mv/msg/220344/698066/#msg_698066
As an aside: Plugins aren't in any perspective, although they can provide one or more perspectives.
The 2 most common contexts that key shortcuts are defined in are "In Windows" or in a specific part.
You have 3 choices.
1) define the commands and keybindings as if they all exist at the window level. That way there's no conflict.
2) define one command and one keybinding, and different handlers per perspective (or part). That's how a common action like Refresh is defined (one command, one keybinding, multiple handlers).
3) define 2 different contexts, one for each perspective, and activate/deactivate them on perspective change.
PW
]]>Paul Webster2011-07-18T17:53:24-00:00Re: Conflict in keys shortcuts
https://www.eclipse.org/forums/index.php/mv/msg/220344/698076/#msg_698076
Originally posted by: Martin Jedlicka
Thanks Paul!
I don't understand choice 1. What do you mean? It is possible to give an
example?
M.
Dne 18.7.2011 19:53, Paul Webster napsal(a):
> Your collision is happening because you've bound the same key to
> different commands in the window context (and you're in a window).
>
> As an aside: Plugins aren't in any perspective, although they can
> provide one or more perspectives.
>
> The 2 most common contexts that key shortcuts are defined in are "In
> Windows" or in a specific part.
>
> You have 3 choices.
>
> 1) define the commands and keybindings as if they all exist at the
> window level. That way there's no conflict.
>
> 2) define one command and one keybinding, and different handlers per
> perspective (or part). That's how a common action like Refresh is
> defined (one command, one keybinding, multiple handlers).
>
> 3) define 2 different contexts, one for each perspective, and
> activate/deactivate them on perspective change.
>
> PW
>]]>2011-07-18T18:11:12-00:00Re: Conflict in keys shortcuts
https://www.eclipse.org/forums/index.php/mv/msg/220344/698086/#msg_698086
CTRL+5 G -> poll.lsn.monitorvariable.command.chartproperties
CTRL+4 G -> poll.lsn.recorddata.command.showchartlogan
Or another approach, why not have the chart properties tied to the already provided org.eclipse.ui.IWorkbenchCommandConstants.FILE_PROPERTIES command? Then you just provide a handler, and ALT+ENTER is the standard shortcut for Properties.
Later,
PW]]>Paul Webster2011-07-18T18:29:43-00:00Re: Conflict in keys shortcuts
https://www.eclipse.org/forums/index.php/mv/msg/220344/698146/#msg_698146
Originally posted by: Martin Jedlicka
Option 1: Ok, I see.
Option 2: How do I implement this? It is possible to give an example?
M.
Dne 18.7.2011 20:29, Paul Webster napsal(a):
> For option 1, I mean picking non-conflicting keys for your commands. ex:
>
> CTRL+5 G -> poll.lsn.monitorvariable.command.chartproperties
> CTRL+4 G -> poll.lsn.recorddata.command.showchartlogan
>
> Or another approach, why not have the chart properties tied to the
> already provided
> org.eclipse.ui.IWorkbenchCommandConstants.FILE_PROPERTIES command? Then
> you just provide a handler, and ALT+ENTER is the standard shortcut for
> Properties.
>
>
> Later,
> PW]]>2011-07-18T21:22:59-00:00Re: Conflict in keys shortcuts
https://www.eclipse.org/forums/index.php/mv/msg/220344/698415/#msg_698415
Eclipse User wrote on Mon, 18 July 2011 17:22
]]>Paul Webster2011-07-19T12:48:06-00:00Re: Conflict in keys shortcuts
https://www.eclipse.org/forums/index.php/mv/msg/220344/698573/#msg_698573
Originally posted by: Martin Jedlicka