Reusing Handler in plugin [message #327170] |
Sat, 12 April 2008 12:30  |
Eclipse User |
|
|
|
Originally posted by: tom.eiswind.de
HI Paul tried to answer this already, but I dont get it.
I have a generic extensible Handler in my core plugin.
I want it to be active for a certain view part in core.
<handler
class="de.eiswind.paris.client.core.ui.EditHandler"
commandId="de.eiswind.mango.client.core.command.edit">
<activeWhen>
<with
variable="activePartId">
<equals
value="de.eiswind.paris.client.core.ui.lastused.LastUsedView ">
</equals>
</with>
</activeWhen>
<enabledWhen>
<with variable="selection">
<count value="1" />
</with>
</enabledWhen>
Plugin no. two contributes a new view, for which I want that hanlder to
be active too. If I redeclare it in plugin.xml only ony of them works.
<handler
class="de.eiswind.paris.client.core.ui.EditHandler"
commandId="de.eiswind.mango.client.core.command.edit">
<activeWhen>
<with
variable="activePartId">
<equals
value="de.eiswind.mango.client.search.ui.Search">
</equals>
</with>
</activeWhen>
<enabledWhen>
<with variable="selection">
<count value="1" />
</with>
</enabledWhen>
</handler>
How can I extend the activeWhen clause of the handler ?
|
|
|
|
Re: Reusing Handler in plugin [message #327270 is a reply to message #327181] |
Tue, 15 April 2008 02:35   |
Eclipse User |
|
|
|
Originally posted by: tom.eiswind.de
Hi Paul,
only the LastUsedView works, the other says
HANDLERS >>> resolveConflicts: eval:
HandlerActivation(commandId=de.eiswind.mango.client.core.com mand.edit,
handler=de.eiswind.paris.client.core.ui.EditHandler,
expression=org.eclipse.core.internal.expressions.WithExpression@8e59bed8,sourcePriority=4194304)
HANDLERS >>> Resolved conflict detected. The following activation won:
HANDLERS >>>
HandlerActivation(commandId=de.eiswind.mango.client.core.com mand.edit,
handler=de.eiswind.paris.client.core.ui.EditHandler,
expression=org.eclipse.core.internal.expressions.WithExpression@8e59bed8,sourcePriority=4194304)
HANDLERS >>> Command('de.eiswind.mango.client.core.command.edit') has
changed to 'de.eiswind.paris.client.core.ui.EditHandler' as its handler
Paul Webster schrieb:
> Thomas wrote:
>> <handler
>> class="de.eiswind.paris.client.core.ui.EditHandler"
>> commandId="de.eiswind.mango.client.core.command.edit">
>> <activeWhen>
>> <with
>> variable="activePartId">
>> <equals
>>
>> value="de.eiswind.paris.client.core.ui.lastused.LastUsedView ">
>> </equals>
>> </with>
>>
>> </activeWhen>
>> <enabledWhen>
>> <with variable="selection">
>> <count value="1" />
>> </with>
>> </enabledWhen>
>>
>> Plugin no. two contributes a new view, for which I want that hanlder
>> to be active too. If I redeclare it in plugin.xml only ony of them works.
>
> Although they'll be 2 separate instances of the EditHandler, your
> activeWhen clause looks correct (i.e. one will be active when
> LastUsedView is active, and the other instance will be active when
> Search is active).
>
> What part is not working? Nothing is executing your handlers at all?
>
> To find out what is going on, you can have a look at:
> http://wiki.eclipse.org/Platform_Command_Framework#Tracing_O ption
>
> You care about sources and handlers from the debugging options listed.
>
> PW
>
>
>
|
|
|
Re: Reusing Handler in plugin [message #327323 is a reply to message #327270] |
Tue, 15 April 2008 10:46  |
Eclipse User |
|
|
|
Thomas wrote:
> Hi Paul,
>
> only the LastUsedView works, the other says
> HANDLERS >>> resolveConflicts: eval:
> HandlerActivation(commandId=de.eiswind.mango.client.core.com mand.edit,
> handler=de.eiswind.paris.client.core.ui.EditHandler,
> expression=org.eclipse.core.internal.expressions.WithExpression@8e59bed8,sourcePriority=4194304)
>
> HANDLERS >>> Resolved conflict detected. The following activation won:
> HANDLERS >>>
> HandlerActivation(commandId=de.eiswind.mango.client.core.com mand.edit,
> handler=de.eiswind.paris.client.core.ui.EditHandler,
> expression=org.eclipse.core.internal.expressions.WithExpression@8e59bed8,sourcePriority=4194304)
>
> HANDLERS >>> Command('de.eiswind.mango.client.core.command.edit') has
> changed to 'de.eiswind.paris.client.core.ui.EditHandler' as its handler
Unfortunately, that doesn't tell us anything since it appears to be a
conflict of "1" (which shouldn't happen, but OK).
What is the trace from the SOURCE >>> where the activePartId changes to
your search view?
PW
--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
|
|
|
Powered by
FUDForum. Page generated in 0.03366 seconds