|
Re: org.eclipse.ui.menu contribution for specific perspective [message #507284 is a reply to message #507043] |
Tue, 12 January 2010 18:05 |
Peter Nehrer Messages: 241 Registered: July 2009 |
Senior Member |
|
|
Hey Patrick,
I don't think you can completely replace your action sets with
o.e.ui.menus extensions, unfortunately. See
http://www.eclipse.org/forums/index.php?t=tree&th=158101 &S=1fc4c39640675e1c88c920e4dc4304b0#page_top
for some context. I think the documentation for o.e.ui.menus gives the
false impression that this should be possible and should be corrected.
Is there any reason you can't use action sets to accomplish what you
need to?
--Peter
On 1/11/10 1:52 PM, Patrick Chuong wrote:
> Hello,
>
> I am trying to use the the command framework and contribute toolbar and
> menu to the workbench window for a given perspective, but the actions
> are visible for all perspectives. Then I use the visibleWhen to restrict
> it to be visible for a given perspective. However, this does not work
> the same as an actionSet, by default, the actionSet can be set to be
> hidden and than use the perpectiveExtension to set which perspective the
> actionSet should be visible. User can also goto the customize
> perspective dialog to set the actionSet to be visible, where as the menu
> extension is not possible, there is no way to set the toolbar or menu to
> be visible if visibleWhen is used.
>
> I am not able to figure out a way to do the same thing as the actoinSet
> extension point. Can some let me know whether this is possible?
>
> Thanks,
> Patrick
>
|
|
|
|
Re: org.eclipse.ui.menu contribution for specific perspective [message #507513 is a reply to message #507288] |
Wed, 13 January 2010 17:58 |
Peter Nehrer Messages: 241 Registered: July 2009 |
Senior Member |
|
|
Patrick, you probably figured it out by now :-P but just in case:
You can handle initial visibility by watching a system property in
visibleWhen (using systemTest). Or you can create a property tester and
use that to watch a preference setting (using test in visibleWhen). On
the editing side, you'd have to either modify the perspective
customization dialog to incorporate o.e.ui.menus contributions (which is
what the Platform should have done in the first place), maybe some
specially marked ones, or just create your own dialog or preference page
to do this.
--Peter
On 1/12/10 1:28 PM, Patrick Chuong wrote:
> Hi Peter,
>
> Good to see you here.
>
> I wasn't able to use actionSet to place my action at a specific location
> in the toolbar or menu. The org.eclipse.ui.menu contribution allows me
> to do what I wanted.
>
> Also, using command allows me to wire actions in different menu and
> toolbar contributions to a single handler, which is really nice.
>
> I was able to achieved the perspective visiblility, with the exception
> of user can't enable/disable it in the customized dialog, and can't set
> the default visibility state.
>
> Patrick
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03366 seconds