Override editing commands with command framework in EMF editor [message #428675] |
Thu, 26 March 2009 10:46  |
Eclipse User |
|
|
|
Hi There,
I would like to request some direction on how to override the standard
COPY, CUT, PASTE actions using the command API? (Declarative form).
I add another page with a custom editor in the EMF Multipage editor and
would like to override the EMF handling of these commands.
My declaration below doesn't activate the Action for an Editor, which is
an EMF Editor BTW. The EMF Editor registers it's action with
setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
through an ActionBar contributor.
Could this be a handler conflict?
Do I need to re-declare the paste command or is the handler sufficient?
<extension
point="org.eclipse.ui.handlers">
<handler
class="com.netxforge.networkdata.addon.PasteHandler"
commandId="org.eclipse.ui.edit.paste">
<activeWhen>
<with
variable="activeEditor">
<equals
value="com.MyEditor">
</equals>
</with></activeWhen>
</handler>
</extension>
Thanks Christophe
|
|
|
|
Re: Override editing commands with command framework in EMF editor [message #428684 is a reply to message #428680] |
Thu, 26 March 2009 11:23  |
Eclipse User |
|
|
|
Thank you Ed, (sorry about multiple posts).
I actually get a handler conflict, would be nice if handler priority
could be set somehow.
Conflict for
'org.eclipse.ui.edit.paste':HandlerActivation(commandId=org. eclipse.ui.edit.paste,
handler=org.eclipse.ui.internal.handlers.WidgetMethodHandler@cecd26,
expression=,sourcePriority=0)
HandlerActivation(commandId=org.eclipse.ui.edit.paste,
handler=com.netxforge.networkdata.addon.PasteHandler,
expression=,sourcePriority=0)
Ed Merks wrote:
> Christophe,
>
> Comments below.
>
> Christophe Bouhier wrote:
>> Hi There,
>>
>> I would like to request some direction on how to override the standard
>> COPY, CUT, PASTE actions using the command API? (Declarative form).
> Did you see the long recent thread about Delete?
>>
>> I add another page with a custom editor in the EMF Multipage editor
>> and would like to override the EMF handling of these commands.
>>
>> My declaration below doesn't activate the Action for an Editor, which
>> is an EMF Editor BTW. The EMF Editor registers it's action with
>> setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
>> through an ActionBar contributor.
>>
>> Could this be a handler conflict?
> I imagine there can only be one handler.
>>
>>
>> Do I need to re-declare the paste command or is the handler sufficient?
> Probably you'd want to specialize the editing domain to create
> specialized commands...
>>
>> <extension
>> point="org.eclipse.ui.handlers">
>> <handler
>> class="com.netxforge.networkdata.addon.PasteHandler"
>> commandId="org.eclipse.ui.edit.paste">
>> <activeWhen>
>> <with
>> variable="activeEditor">
>> <equals
>> value="com.MyEditor">
>> </equals>
>> </with></activeWhen>
>> </handler>
>> </extension>
>>
>> Thanks Christophe
|
|
|
Powered by
FUDForum. Page generated in 1.35264 seconds