Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Global menu enablement


This documentation does not mention the need to call:
getSite().getActionBars().updateActionBars();
when changing the handler any other time (outside of init(...)).  This is a common mistake for many developers who are dynamically changing global action handlers and expect the retarget action to get remapped to the new handler.

-Randy



Nick Edgar <Nick_Edgar@xxxxxxxxxx>
Sent by: platform-ui-dev-admin@xxxxxxxxxxx

04/13/2004 04:31 PM
Please respond to platform-ui-dev

       
        To:        platform-ui-dev@xxxxxxxxxxx
        cc:        
        Subject:        Re: [platform-ui-dev] Global menu enablement



John has answered for the build actions.

For Cut/Copy/Paste/Delete, these are regular workbench retargetable
actions.
You can hook a handling action using:

getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.CUT.getId(),
cutAction);

If your view uses an inline text control, e.g. for in-place rename, you'll
need to delegate these operations accordingly.
There is a convenience class to help with this.  See
org.eclipse.ui.actions.TextActionHandler.
See how this is done in the Navigator, in
org.eclipse.ui.views.navigator.RefactorActionGroup.

For more details, see:
http://help.eclipse.org/help21/topic/org.eclipse.platform.doc.isv/guide/wrkAdv_retarget_setting.htm

Nick




Michael Elder <mdelder@xxxxxxxxxx>
Sent by: platform-ui-dev-admin@xxxxxxxxxxx
04/13/2004 02:32 PM
Please respond to
platform-ui-dev


To
platform-ui-dev@xxxxxxxxxxx
cc

Subject
[platform-ui-dev] Global menu enablement












Hello,

     I'm having an issue that seems appropriate for the platform-ui-dev
list, if I am seeking assistance from the wrong venue, please redirect me.
Here's my problem.

I want to enable certain existing menu options on the Edit and Project
menus. We have developed a custom Navigator (part of the
Common/General-Purpose Navigator effort). I'd like to enable certain
actions (like "Build Project", "Clean Project", "Cut|Copy|Paste|Delete")
based on a user's selection in our Common Navigator. In the latter cases I
also would like to substitute what actually happens to support these
operations for custom contributions to our navigator. Any suggestions?

That is, when a user selects a node in our Navigator (for instance, a
custom EMF representation of a ejb-jar.xml file), I'd like to enable
Cut|Copy|Paste|Delete in the Workbench Edit menu, and tie in the
appropriate actions.

When a user selects a project, (contributed by a custom Content Provider),
I'd like to update the selection and enablement of "Build Project" and
other appropriate options under the Workbench Project menu.


Thanks in advance for your time and assistance.

-------------------------------------------------------------------------
Kind Regards,

Michael D. Elder
Rational Studio / J2EE Tools Development
IBM RTP Lab
Ext: (919) 543-8356
T/L:  441-8356
mdelder@xxxxxxxxxx


_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev


_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev


Back to the top