Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Problems with extensionpoint org.eclipse.ui.viewActions
Problems with extensionpoint org.eclipse.ui.viewActions [message #321515] Thu, 18 October 2007 19:36 Go to next message
Torsten Link is currently offline Torsten LinkFriend
Messages: 51
Registered: July 2009
Member
Hi All,

the enablement for this extensionpoint seems not to work (for me).

I have a ViewPart with a Table viewer in it and
four ActionContributions to this ViewPart.

One Action should always be enabled. That is working.
The other Actions should be enabled when one or more
entries in the table are selected.

But the actions keep disabled.

Here you could see my plugin.xml

<extension
point="org.eclipse.ui.views">
<view
...
id="de.qatools.smartest.view.param.ParamViewPart"
</view>
</extension>

<extension
point="org.eclipse.ui.viewActions">
<viewContribution
id="de.qatools.smartest.view.param.viewContributionActions"
targetID="de.qatools.smartest.view.param.ParamViewPart">
<action
class="...DeleteParameterAction"
icon="icons/delete.gif"
id="...DeleteParameterAction.id"
label="Delete Parameter"
state="true"
style="push"
toolbarPath="additions"
tooltip="Löscht einen oder mehrere Parameter">
<!-- first try name ist the FQ interface name NOT working-->
<enablement>
<objectClass
name="...IParameter">
</objectClass>
</enablement>
</action>
<action
<!-- THIS IS WORKING -->
class="...AddParameterAction"
enablesFor="*"
icon="icons/add.gif"
id="...AddParameterAction.id"
label="Add Parameter"
state="true"
style="push"
toolbarPath="additions"
tooltip="Fügt einen neuen Parameter hinzu">
</action>
<action
<!-- second try NOT working-->
class="...DownAction"
enablesFor="+"
icon="icons/down.gif"
id="...DownAction.id"
label="Down"
state="true"
style="push"
toolbarPath="additions">
</action>
</viewContribution>
</extension>


Do you have any ideas?


Thanks in advance


Torsten Link
Re: Problems with extensionpoint org.eclipse.ui.viewActions [message #321546 is a reply to message #321515] Fri, 19 October 2007 15:08 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Your definitions looked fine to me. This example works for me:

<action
class="org.eclipse.ui.examples.contributions.ViewActionDelegate1 "
enablesFor="+"
id="org.eclipse.ui.examples.contributions.action1"
label="%view.action.label"
menubarPath="additions"
style="push">
</action>
[/xml]

It's disabled when there are no selections, enabled otherwise.

Did you make your tree viewer your site selection provider? From InfoView:
viewer = new ListViewer(parent);
.... stuff
getSite().setSelectionProvider(viewer);

Later,
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


Re: Problems with extensionpoint org.eclipse.ui.viewActions [message #321548 is a reply to message #321546] Fri, 19 October 2007 15:05 Go to previous message
Torsten Link is currently offline Torsten LinkFriend
Messages: 51
Registered: July 2009
Member
Hi Paul,

Thanks a lot.



Paul Webster wrote:

> Your definitions looked fine to me. This example works for me:
>
> <action
> class="org.eclipse.ui.examples.contributions.ViewActionDelegate1 "
> enablesFor="+"
> id="org.eclipse.ui.examples.contributions.action1"
> label="%view.action.label"
> menubarPath="additions"
> style="push">
> </action>
> [/xml]
>
> It's disabled when there are no selections, enabled otherwise.
>
> Did you make your tree viewer your site selection provider? From InfoView:
> viewer = new ListViewer(parent);
> ... stuff
> getSite().setSelectionProvider(viewer);



If I do it right, it is working


>
> Later,
> PW
>
Previous Topic:rcp application in os taskbar while splashscreen is displayed
Next Topic:Eclipse won't start up (Ubuntu 7.10 64-Bit)
Goto Forum:
  


Current Time: Sat Aug 17 09:22:09 GMT 2024

Powered by FUDForum. Page generated in 0.03559 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top