[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform] Re: "Open" menu action in Project Explorer
|
Hi sorry for a late reply, I happened to check this today only...
Regarding the enablement clause:
<enablement>
<or>
<and>
<adapt type="org.eclipse.core.resources.IResource/IFile" />
<test
property="org.eclipse.core.resources.projectNature"
value="">
</test>
</and>
</or>
</enablement>
You need to add your own action and this needs to go into the "Open Group".
However, if you find that there are two "Open" actions coming up, that is
not the expected behavior. Can you post code from your plugin.xml where you
have contributed the actionProvider and also snippets from your class
implementing the commonActionProvider. Maybe we can identify what's going
wrong.
Rahul
"Derek. R" <spadge248@xxxxxxxxx> wrote in message
news:806ed4676af95918da0c41122aa60762$1@xxxxxxxxxxxxxxxxxx
> Thanks for the reply!
>
> The link helped me greatly, thanks for that. I don't quite understand
> what is supposed to happen from the code in the article are though - the
> author sets the global action handler on the open action, which I assumed
> would retarget the Open action in the context menu. I get confused when
> the author then appends his custom open action to the "Open Group" of the
> context menu - why would this need to be done if he is retargetting the
> global Open action? I dont want to add a new action, I want to override
> the functionality of the existing one.
>
> I did implement it however, and saw that my open action did not get called
> when the Open action was selected in the context menu. When I appended my
> action to the "Open Group", my action appeared in the Context menu above
> the global open action. Is this correct? Again, I thought my custom
> action would just get called when the global action was selected, rather
> than adding a new action.
>
> I also am not understanding how to use <enablement> with my action
> provider extension - I get as far as "instanceof IFile", but how do I tell
> it only IFile's of a certain Project Nature?
>
> Thanks,
> Derek
>