Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Adding actions to context menu
Adding actions to context menu [message #325742] Tue, 26 February 2008 10:13 Go to next message
RaviKumar is currently offline RaviKumarFriend
Messages: 20
Registered: July 2009
Junior Member
Hi,

I want to add a "New action" to the context menus, so i was using the
extension
"org.eclipse.ui.popupMenus".

My "New Action" should appear only for the specific type of projects.
Lets us say i want it only for c++ project/some other custom projects.
How i have to do it.???

i am also using "objectclass(objectContribution) =
org.eclipse.core.resources.IProject" so that i will get this "New Action"
only for the project types on the context menu.

Any suggestions please.....


Thanks and Regards,
Ravi.
Re: Adding actions to context menu [message #325755 is a reply to message #325742] Tue, 26 February 2008 13:38 Go to previous messageGo to next message
Allan Ramirez is currently offline Allan RamirezFriend
Messages: 14
Registered: July 2009
Junior Member
Use enablement

check this link and it's on the buttom of the page

http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench_basicext_popupMenus.htm
Re: Adding actions to context menu [message #325756 is a reply to message #325742] Tue, 26 February 2008 13:39 Go to previous messageGo to next message
Allan Ramirez is currently offline Allan RamirezFriend
Messages: 14
Registered: July 2009
Junior Member
use enablement

check this link and proceed to the bottom of the page

http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench_basicext_popupMenus.htm





ravi wrote:

> Hi,

> I want to add a "New action" to the context menus, so i was using the
> extension
> "org.eclipse.ui.popupMenus".

> My "New Action" should appear only for the specific type of projects.
> Lets us say i want it only for c++ project/some other custom projects.
> How i have to do it.???

> i am also using "objectclass(objectContribution) =
> org.eclipse.core.resources.IProject" so that i will get this "New Action"
> only for the project types on the context menu.

> Any suggestions please.....


> Thanks and Regards,
> Ravi.
Re: Adding actions to context menu [message #325817 is a reply to message #325742] Thu, 28 February 2008 05:20 Go to previous messageGo to next message
RaviKumar is currently offline RaviKumarFriend
Messages: 20
Registered: July 2009
Junior Member
ravi wrote:

> Hi,

> I want to add a "New action" to the context menus, so i was using the
> extension
> "org.eclipse.ui.popupMenus".

> My "New Action" should appear only for the specific type of projects.
> Lets us say i want it only for c++ project/some other custom projects.
> How i have to do it.???

> i am also using "objectclass(objectContribution) =
> org.eclipse.core.resources.IProject" so that i will get this "New Action"
> only for the project types on the context menu.

> Any suggestions please.....


> Thanks and Regards,
> Ravi.


Hi,

i have checked this link,

http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench_basicext_popupMenus.htm

That gives some idea to add an action to the context menu, as well as
visibility.
With the help of that i have added an action on the context menu, But that
is always available on the context menu. I want that action to appear only
for the "C/C++ Project types only".

Is there a way to identify the type of project and add the context menu
action???


Thanks and Regards,
Ravi.
Re: Adding actions to context menu [message #325818 is a reply to message #325817] Thu, 28 February 2008 06:23 Go to previous messageGo to next message
Allan Ramirez is currently offline Allan RamirezFriend
Messages: 14
Registered: July 2009
Junior Member
Try this...


<enablement>
<and>
<objectState name="nature"
value="org.eclipse.jdt.core.javanature"/>
<objectClass
name="org.eclipse.core.resources.IProject">
</objectClass>
</and>
</enablement>


I don't know what's the equivalent for org.eclipse.jdt.core.javanature
in c/c++ nature.

You can find it out by going to one of your c/c++ project and then open
the .project file. The natures are listed there and I'm sure c/c++ is in
there.
Re: Adding actions to context menu [message #325820 is a reply to message #325817] Thu, 28 February 2008 06:40 Go to previous message
RaviKumar is currently offline RaviKumarFriend
Messages: 20
Registered: July 2009
Junior Member
Thanks,


I found out the way to add an action on the context menu for a specific
project type.

<filter
name="projectNature"
value="org.eclipse.cdt.core.cnature">
</filter>
Using this we can filter out only the cProjects.


Regards,
Ravi.
Previous Topic:Save handler when editing files not in workspace using eclipse default editor
Next Topic:ActionSet visibility
Goto Forum:
  


Current Time: Sun Jun 30 00:02:42 GMT 2024

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

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

Back to the top