Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » delete action as object contribution ...
delete action as object contribution ... [message #328891] Thu, 05 June 2008 08:12 Go to next message
Carmelo  is currently offline Carmelo Friend
Messages: 224
Registered: July 2009
Senior Member
Hi all
I have an object action that I would like to link to the global action
EDIT/DELETE .

I can see my action correctly activate in the popupMenus on the selected
object type . but cannot link it with the edit/delete menu + plus key action
delete .

Does anyone can help me?

Thanks
Kar
Re: delete action as object contribution ... [message #328903 is a reply to message #328891] Fri, 06 June 2008 09:33 Go to previous messageGo to next message
Rahul Kamdar is currently offline Rahul KamdarFriend
Messages: 63
Registered: July 2009
Member
You need to override the default delete and set the GlobalActionHandler for
delete action's id against your action implementation.

In order to override the default delete, you need to override the
EditActionsProvider
"org.eclipse.ui.navigator.resources.actions.EditActions". I do that using a
navigatorContent extension in my plugin.xml under a new actionProvider for
Edit Actions - retargeting cut/copy/paste/delete.

Then in your action provider, you need to
setGlobalActionHandler(ActionFactory.Delete.getId(), your delete action); on
the actionBars object given by the fillActionBars method.

Maybe you could refer to
http://scribbledideas.blogspot.com/2006/06/building-common-n avigator-_115067357450703178.html

Rahul

"KarSc" <carmeloscala@hotmail.com> wrote in message
news:g2anp3$qpi$1@build.eclipse.org...
> Hi all
> I have an object action that I would like to link to the global action
> EDIT/DELETE .
>
> I can see my action correctly activate in the popupMenus on the selected
> object type . but cannot link it with the edit/delete menu + plus key
> action
> delete .
>
> Does anyone can help me?
>
> Thanks
> Kar
>
>
Re: delete action as object contribution ... [message #328957 is a reply to message #328903] Mon, 09 June 2008 08:34 Go to previous messageGo to next message
Carmelo  is currently offline Carmelo Friend
Messages: 224
Registered: July 2009
Senior Member
Really thanks for ur help
I will check soon ...
kar
ciao


"Rahul Kamdar" <rtkamdar@kamdars-india.com> ha scritto nel messaggio
news:g2b092$jv2$1@build.eclipse.org...
> You need to override the default delete and set the GlobalActionHandler
> for delete action's id against your action implementation.
>
> In order to override the default delete, you need to override the
> EditActionsProvider
> "org.eclipse.ui.navigator.resources.actions.EditActions". I do that using
> a navigatorContent extension in my plugin.xml under a new actionProvider
> for Edit Actions - retargeting cut/copy/paste/delete.
>
> Then in your action provider, you need to
> setGlobalActionHandler(ActionFactory.Delete.getId(), your delete action);
> on the actionBars object given by the fillActionBars method.
>
> Maybe you could refer to
> http://scribbledideas.blogspot.com/2006/06/building-common-n avigator-_115067357450703178.html
>
> Rahul
>
> "KarSc" <carmeloscala@hotmail.com> wrote in message
> news:g2anp3$qpi$1@build.eclipse.org...
>> Hi all
>> I have an object action that I would like to link to the global action
>> EDIT/DELETE .
>>
>> I can see my action correctly activate in the popupMenus on the selected
>> object type . but cannot link it with the edit/delete menu + plus key
>> action
>> delete .
>>
>> Does anyone can help me?
>>
>> Thanks
>> Kar
>>
>>
>
>
Re: delete action as object contribution ... [message #329004 is a reply to message #328903] Tue, 10 June 2008 13:06 Go to previous messageGo to next message
Carmelo  is currently offline Carmelo Friend
Messages: 224
Registered: July 2009
Senior Member
Hi Rahul,
thanks for ur help and the article u send ... but honestly I'm quite
confused now ...

the point right now is:
plain object contribution will just allow me to stick the action on the
object displayed in a tree/table but there will no be key and global action
association ...

if I use the mechanism of the navigator can I still use a normal view which
extends ViewPart or do I have necessarily implements all the methods in
InavigatorContentService (honestly I don't know what method is important and
must be coded)?

if the answer is No. I have already tried ...
- created the action provider


<extension point="org.eclipse.ui.navigator.navigatorContent">
<actionProvider
class="com.inspector.ui.views.actions.PropertyActionProvider "
id="com.inspector.ui.views.actions.PropertyActionProvider">
</actionProvider>
</extension>

- added the action provider at the view using the navigatorContent extension
(not sure is correct ... )
still nothing work and no action is displayed.

I will try to put in place an example using the eclipse plugin view example
and I will see what I can do.

any help will be appreciated.
Ciao
Kar




"Rahul Kamdar" <rtkamdar@kamdars-india.com> ha scritto nel messaggio
news:g2b092$jv2$1@build.eclipse.org...
> You need to override the default delete and set the GlobalActionHandler
> for delete action's id against your action implementation.
>
> In order to override the default delete, you need to override the
> EditActionsProvider
> "org.eclipse.ui.navigator.resources.actions.EditActions". I do that using
> a navigatorContent extension in my plugin.xml under a new actionProvider
> for Edit Actions - retargeting cut/copy/paste/delete.
>
> Then in your action provider, you need to
> setGlobalActionHandler(ActionFactory.Delete.getId(), your delete action);
> on the actionBars object given by the fillActionBars method.
>
> Maybe you could refer to
> http://scribbledideas.blogspot.com/2006/06/building-common-n avigator-_115067357450703178.html
>
> Rahul
>
> "KarSc" <carmeloscala@hotmail.com> wrote in message
> news:g2anp3$qpi$1@build.eclipse.org...
>> Hi all
>> I have an object action that I would like to link to the global action
>> EDIT/DELETE .
>>
>> I can see my action correctly activate in the popupMenus on the selected
>> object type . but cannot link it with the edit/delete menu + plus key
>> action
>> delete .
>>
>> Does anyone can help me?
>>
>> Thanks
>> Kar
>>
>>
>
>
Re: delete action as object contribution ... [message #329081 is a reply to message #329004] Thu, 12 June 2008 08:45 Go to previous message
Carmelo  is currently offline Carmelo Friend
Messages: 224
Registered: July 2009
Senior Member
From Rahul Kamdar
-----------------------------

Object contribution will add your action as you said to the context menu. In
order to override the default key/Edit>Delete you need to retarget these
actions.

As far as the navigator is concerned, I think you need to implement the
requisite methods. I am not writing my own Navigator, am just extending the
native Eclipse Project Explorer and have defined actionProviders that
override the default ones for Open, Edit and Refactor actions.

For your reference, my action provider is as follows:

<actionProvider
class="com......cnf.action.providers.EditActionProvider"
id="com......explorer.actionProvider.EditAction"
overrides="org.eclipse.ui.navigator.resources.actions.EditActions ">
<enablement>
......
</enablement>
</actionProvider>

In this actionProvider I have written my own cut/copy/paste/delete actions
and further in the action Provider class (one that extends
CommonActionProvider) in the fillActionBars method, I set these actions as
the default using:

IActionBars.setGlobalActionHandler(ActionFactory.whatever_ac tion.getId(),
whatever_action);

Try and follow these and let me know if it works. You could copy/paste this
reply and further reply on the newsgroup itself so someone else can also
help you out.

Rahul




"KarSc" <carmeloscala@hotmail.com> ha scritto nel messaggio
news:g2lu9i$igb$1@build.eclipse.org...
> Hi Rahul,
> thanks for ur help and the article u send ... but honestly I'm quite
> confused now ...
>
> the point right now is:
> plain object contribution will just allow me to stick the action on the
> object displayed in a tree/table but there will no be key and global
> action association ...
>
> if I use the mechanism of the navigator can I still use a normal view
> which extends ViewPart or do I have necessarily implements all the methods
> in InavigatorContentService (honestly I don't know what method is
> important and must be coded)?
>
> if the answer is No. I have already tried ...
> - created the action provider
>
>
> <extension point="org.eclipse.ui.navigator.navigatorContent">
> <actionProvider
> class="com.inspector.ui.views.actions.PropertyActionProvider "
> id="com.inspector.ui.views.actions.PropertyActionProvider">
> </actionProvider>
> </extension>
>
> - added the action provider at the view using the navigatorContent
> extension (not sure is correct ... )
> still nothing work and no action is displayed.
>
> I will try to put in place an example using the eclipse plugin view
> example and I will see what I can do.
>
> any help will be appreciated.
> Ciao
> Kar
>
>
>
>
> "Rahul Kamdar" <rtkamdar@kamdars-india.com> ha scritto nel messaggio
> news:g2b092$jv2$1@build.eclipse.org...
>> You need to override the default delete and set the GlobalActionHandler
>> for delete action's id against your action implementation.
>>
>> In order to override the default delete, you need to override the
>> EditActionsProvider
>> "org.eclipse.ui.navigator.resources.actions.EditActions". I do that using
>> a navigatorContent extension in my plugin.xml under a new actionProvider
>> for Edit Actions - retargeting cut/copy/paste/delete.
>>
>> Then in your action provider, you need to
>> setGlobalActionHandler(ActionFactory.Delete.getId(), your delete action);
>> on the actionBars object given by the fillActionBars method.
>>
>> Maybe you could refer to
>> http://scribbledideas.blogspot.com/2006/06/building-common-n avigator-_115067357450703178.html
>>
>> Rahul
>>
>> "KarSc" <carmeloscala@hotmail.com> wrote in message
>> news:g2anp3$qpi$1@build.eclipse.org...
>>> Hi all
>>> I have an object action that I would like to link to the global action
>>> EDIT/DELETE .
>>>
>>> I can see my action correctly activate in the popupMenus on the selected
>>> object type . but cannot link it with the edit/delete menu + plus key
>>> action
>>> delete .
>>>
>>> Does anyone can help me?
>>>
>>> Thanks
>>> Kar
>>>
>>>
>>
>>
Previous Topic:why eclipse load the old plugin
Next Topic:Select editor to open by file inspection
Goto Forum:
  


Current Time: Mon Jul 29 21:10:08 GMT 2024

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

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

Back to the top