Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » command and global action ..
command and global action .. [message #334369] Thu, 05 February 2009 14:24 Go to next message
Carmelo  is currently offline Carmelo Friend
Messages: 224
Registered: July 2009
Senior Member
Hi all,
I have defined a command that is correctly displayed in a view context menu
....

let's say this command perform a "Delete" operation ...
what is the right way to bind this with the edit/delete global action?

Thanks in advance
Kar
Re: command and global action .. [message #334379 is a reply to message #334369] Fri, 06 February 2009 08:39 Go to previous messageGo to next message
Sharon F is currently offline Sharon FFriend
Messages: 8
Registered: July 2009
Junior Member
Kar wrote:

> Hi all,
> I have defined a command that is correctly displayed in a view context menu
> ....

> let's say this command perform a "Delete" operation ...
> what is the right way to bind this with the edit/delete global action?

> Thanks in advance
> Kar

A good start point could be found here:
http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/extension-points/org_eclipse_ui_b indings.html

Sharon
--
http://www.eclaxy.com
Eclipse Development Outsourcing
Re: command and global action .. [message #334393 is a reply to message #334379] Fri, 06 February 2009 16:16 Go to previous messageGo to next message
Carmelo  is currently offline Carmelo Friend
Messages: 224
Registered: July 2009
Senior Member
Hi Sharon and thanks for your help ... but I'm still lost ...
I'm using the new framework eclipse 3.3

I mean the command works fine .. but still not able to understand how to
bind it with the global action

my command performs a delete and I want this to be bound with the delete in
the edit menu ...

I found the example contribution ... and I have seen that the command id is
the same name of the used for the command itself ... in my case
org.eclipse.ui.edit.delete (but I see a disabled icon in the popup menu / as
in the edit menu)

the same bit below works fine if a change org.eclipse.ui.edit.delete in
org.eclipse.ui.edit.deletex

don't really know what to search anymore ...
thanks
kar


<extension
point="org.eclipse.ui.commands">
<category
description="Commands for the EOM Inspector"
id="com.xxx.inspector.commands.category"
name="Inspector Commands">
</category>
<command
categoryId="com.xxx.inspector.commands.category"
description="Destroy the selected resources"
id="org.eclipse.ui.edit.delete"
name="Delete">
</command>
</extension>

<extension
point="org.eclipse.ui.handlers">
<handler
class="com.xxx.inspector.handlers.DeleteHandler"
commandId="org.eclipse.ui.edit.delete">
</handler>
</extension>

<extension
point="org.eclipse.ui.bindings">
<key
commandId="org.eclipse.ui.edit.delete"
contextId="com.xxx.inspector.contexts"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="DEL">
</key>
</extension>

<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:org.eclipse.ui.popup.any">
<command
commandId="org.eclipse.ui.edit.delete"
icon="images/delete.gif"
label="Delete"
style="push"
tooltip="Delete selected resources">
<visibleWhen>
<with variable="activeMenuSelection">
<iterate>
<adapt
type="com.xxx.rse.sevices.files.eom.EOMHostFile"> </adapt>
</iterate>
</with>
</visibleWhen>
</command>
</menuContribution>
</extension>

<extension
point="org.eclipse.ui.contexts">
<context
description="The Inspector Context"
id="com.xxx.inspector.contexts"
name="Inspector Contexts"
parentId="org.eclipse.ui.contexts.window">
</context>
</extension>



"Sharon" <sharon.floyd@eclaxy.com> wrote in message
news:532fec11a3dfdcacaf648a1ae6f63c52$1@www.eclipse.org...
> Kar wrote:
>
>> Hi all,
>> I have defined a command that is correctly displayed in a view context
>> menu ....
>
>> let's say this command perform a "Delete" operation ...
>> what is the right way to bind this with the edit/delete global action?
>
>> Thanks in advance
>> Kar
>
> A good start point could be found here:
> http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/extension-points/org_eclipse_ui_b indings.html
>
> Sharon
> --
> http://www.eclaxy.com
> Eclipse Development Outsourcing
>
>
Re: command and global action .. [message #334469 is a reply to message #334393] Wed, 11 February 2009 06:42 Go to previous message
Sharon F is currently offline Sharon FFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Kar,

To manipulate the global action, you have to call
org.eclipse.ui.IActionBars.setGlobalActionHandler and set the actionId
"org.eclipse.ui.edit.delete"'s handler to your action.

Good luck!

Sharon
--
http://www.eclaxy.com
Eclipse Development Outsourcing
Previous Topic:Incremental compilation comes and goes
Next Topic:Adding Help to the Preferences Pages in an RCP application
Goto Forum:
  


Current Time: Fri Apr 26 19:42:21 GMT 2024

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

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

Back to the top