Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How do I specify specific context-menu for the nodes on my view?
How do I specify specific context-menu for the nodes on my view? [message #165886] Thu, 04 December 2003 11:13 Go to next message
Eclipse UserFriend
Originally posted by: jmedina.on.com

I created a View that connect to a server and display some elements in a
hierarchical structure (tree).
I want o be able to do a right-click on the nodes and have a context menu.
But I want this context menu to be sensitive to the item selected. The
sample on the book "The Java Developer's Guide to Eclipse" (AddisonWesley)
only shows how to add a generic context menu. (same menu no matter what the
selected item is. I wonder if that should still be called "context"-menu)

Any pointers to documentation and samples are appreciated.

-Jorge
Re: How do I specify specific context-menu for the nodes on my view? [message #165926 is a reply to message #165886] Thu, 04 December 2003 12:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: michael.kane.myeclipseide.com

One approach is to use an org.eclipse.ui.popupMenu extension with
<viewContribution><visibility>[<objectClass>|<objectState >] constraints on
your menu's actions? I know that is an approach we recently used for
filtering the context-menu in a tree view of heterogeneous types and state
differences.

Michael
MyEclipse/Eclipse Developer
Genuitec, LLC


"Jorge" <jmedina@on.com> wrote in message news:bqnmbt$mss$1@eclipse.org...
> I created a View that connect to a server and display some elements in a
> hierarchical structure (tree).
> I want o be able to do a right-click on the nodes and have a context menu.
> But I want this context menu to be sensitive to the item selected. The
> sample on the book "The Java Developer's Guide to Eclipse" (AddisonWesley)
> only shows how to add a generic context menu. (same menu no matter what
the
> selected item is. I wonder if that should still be called "context"-menu)
>
> Any pointers to documentation and samples are appreciated.
>
> -Jorge
>
>
Re: How do I specify specific context-menu for the nodes on my view? [message #169587 is a reply to message #165926] Fri, 12 December 2003 06:06 Go to previous message
Eclipse UserFriend
Originally posted by: jmedina.on.com

Is this mechanism only suitable when extending another plugin ?
What if the view and objects are created by my own plugin ? From what I read
at
http://help.eclipse.org/help21/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/extension-points/org_eclipse_ui_p opupMenus.html
that mechanism work wehn extending another plugin.

Do I need to test for what is selected before building teh context menu?
(and again use the logic full of "instanceof" operators)


"Michael Kane" <michael.kane@myeclipseide.com> wrote in message
news:bqnqln$sjt$1@eclipse.org...
> One approach is to use an org.eclipse.ui.popupMenu extension with
> <viewContribution><visibility>[<objectClass>|<objectState >] constraints on
> your menu's actions? I know that is an approach we recently used for
> filtering the context-menu in a tree view of heterogeneous types and state
> differences.
>
> Michael
> MyEclipse/Eclipse Developer
> Genuitec, LLC
>
>
> "Jorge" <jmedina@on.com> wrote in message news:bqnmbt$mss$1@eclipse.org...
> > I created a View that connect to a server and display some elements in a
> > hierarchical structure (tree).
> > I want o be able to do a right-click on the nodes and have a context
menu.
> > But I want this context menu to be sensitive to the item selected. The
> > sample on the book "The Java Developer's Guide to Eclipse"
(AddisonWesley)
> > only shows how to add a generic context menu. (same menu no matter what
> the
> > selected item is. I wonder if that should still be called
"context"-menu)
> >
> > Any pointers to documentation and samples are appreciated.
> >
> > -Jorge
> >
> >
>
>
Previous Topic:Startup problem Eclipse 2.1.2 with Solaris 8
Next Topic:Building the platform binary
Goto Forum:
  


Current Time: Sat May 10 16:44:45 EDT 2025

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

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

Back to the top