Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Does Eclipse has something similar to the Nodes of Netbeans ?
Does Eclipse has something similar to the Nodes of Netbeans ? [message #169569] Fri, 12 December 2003 05:47 Go to next message
Eclipse UserFriend
Originally posted by: jmedina.on.com

I am creating a view, but my current code for the content provider, label
provider and other pieces is full of "instanceof".
I consider the use of "instanceof" not a very good practice in an OOP.

I get rid of many of them (the instanceof clauses) by introducing a very
basic "node" class. Then, all the objects in the content and label provider
can be casted to this node class. (It is like a wrapper of a real object in
the model).
I'm not sure if this is possible, but I would like to attach some Action-s
to those nodes, so that the context menu is filled with whatever Action-s
are available for a particular object (node)

Well...I found myself then coding something similar to what Netbeans calls
Nodes. (I did some Netbeans programming before, but we decided to swtich to
Eclipse).

Are there any classes in Eclipse similar to the Nodes API in Netbeans ?

The code looks very ugly with all those "instanceof". Even using my wrapper
I still use the "instanceof" for each element wrapped. ( Of course, I could
use a subclass of the general wrapper...but that what precisely I am looking
for in Eclipse)

Thanks for your answers.

-Jorge
Re: Does Eclipse has something similar to the Nodes of Netbeans ? [message #169645 is a reply to message #169569] Fri, 12 December 2003 09:49 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

If you are developping a tree view, you should consider using a JFace
TreeViewer: http://www.eclipse.org/articles/index.html

Jean

Jorge wrote:

> I am creating a view, but my current code for the content provider, label
> provider and other pieces is full of "instanceof".
> I consider the use of "instanceof" not a very good practice in an OOP.

> I get rid of many of them (the instanceof clauses) by introducing a very
> basic "node" class. Then, all the objects in the content and label provider
> can be casted to this node class. (It is like a wrapper of a real object in
> the model).
> I'm not sure if this is possible, but I would like to attach some Action-s
> to those nodes, so that the context menu is filled with whatever Action-s
> are available for a particular object (node)

> Well...I found myself then coding something similar to what Netbeans calls
> Nodes. (I did some Netbeans programming before, but we decided to swtich to
> Eclipse).

> Are there any classes in Eclipse similar to the Nodes API in Netbeans ?

> The code looks very ugly with all those "instanceof". Even using my wrapper
> I still use the "instanceof" for each element wrapped. ( Of course, I could
> use a subclass of the general wrapper...but that what precisely I am looking
> for in Eclipse)

> Thanks for your answers.

> -Jorge
Re: Does Eclipse has something similar to the Nodes of Netbeans ? [message #169661 is a reply to message #169645] Fri, 12 December 2003 09:52 Go to previous messageGo to next message
Eclipse UserFriend
Ermm .. seems like I got a problem with the link, sorry, here is the right
one:
http://www.eclipse.org/articles/treeviewer-cg/TreeViewerArti cle.htm

Jean Couillaud wrote:

> Hello,

> If you are developping a tree view, you should consider using a JFace
> TreeViewer: http://www.eclipse.org/articles/index.html

> Jean

> Jorge wrote:

> > I am creating a view, but my current code for the content provider, label
> > provider and other pieces is full of "instanceof".
> > I consider the use of "instanceof" not a very good practice in an OOP.

> > I get rid of many of them (the instanceof clauses) by introducing a very
> > basic "node" class. Then, all the objects in the content and label provider
> > can be casted to this node class. (It is like a wrapper of a real object in
> > the model).
> > I'm not sure if this is possible, but I would like to attach some Action-s
> > to those nodes, so that the context menu is filled with whatever Action-s
> > are available for a particular object (node)

> > Well...I found myself then coding something similar to what Netbeans calls
> > Nodes. (I did some Netbeans programming before, but we decided to swtich to
> > Eclipse).

> > Are there any classes in Eclipse similar to the Nodes API in Netbeans ?

> > The code looks very ugly with all those "instanceof". Even using my wrapper
> > I still use the "instanceof" for each element wrapped. ( Of course, I could
> > use a subclass of the general wrapper...but that what precisely I am
looking
> > for in Eclipse)

> > Thanks for your answers.

> > -Jorge
Re: Does Eclipse has something similar to the Nodes of Netbeans ? [message #169764 is a reply to message #169645] Fri, 12 December 2003 11:50 Go to previous messageGo to next message
Eclipse UserFriend
Jean:
He is using the TreeViewer, thus the content provider and label provider.

Jorge:
It has been a while since I used TreeViewer, but I don't recall having a
node class. Node classes are pretty easy to write yourself so you might
want to just do that. I am not familiar with netbeans but if you like
their Node implementation you should be able to port it into something
your providers will like.

-Phil

Jean Couillaud wrote:
> Hello,
>
> If you are developping a tree view, you should consider using a JFace
> TreeViewer: http://www.eclipse.org/articles/index.html
>
> Jean
>
> Jorge wrote:
>
>
>>I am creating a view, but my current code for the content provider, label
>>provider and other pieces is full of "instanceof".
>>I consider the use of "instanceof" not a very good practice in an OOP.
>
>
>>I get rid of many of them (the instanceof clauses) by introducing a very
>>basic "node" class. Then, all the objects in the content and label provider
>>can be casted to this node class. (It is like a wrapper of a real object in
>>the model).
>>I'm not sure if this is possible, but I would like to attach some Action-s
>>to those nodes, so that the context menu is filled with whatever Action-s
>>are available for a particular object (node)
>
>
>>Well...I found myself then coding something similar to what Netbeans calls
>>Nodes. (I did some Netbeans programming before, but we decided to swtich to
>>Eclipse).
>
>
>>Are there any classes in Eclipse similar to the Nodes API in Netbeans ?
>
>
>>The code looks very ugly with all those "instanceof". Even using my wrapper
>>I still use the "instanceof" for each element wrapped. ( Of course, I could
>>use a subclass of the general wrapper...but that what precisely I am looking
>>for in Eclipse)
>
>
>>Thanks for your answers.
>
>
>>-Jorge
>
>
>
Re: Does Eclipse has something similar to the Nodes of Netbeans ? [message #169803 is a reply to message #169764] Fri, 12 December 2003 12:11 Go to previous message
Eclipse UserFriend
Arf, sorry, should try thinking next time ..
By the way, I agree with philip on all he just told.

Philip Borlin wrote:

> Jean:
> He is using the TreeViewer, thus the content provider and label provider.

> Jorge:
> It has been a while since I used TreeViewer, but I don't recall having a
> node class. Node classes are pretty easy to write yourself so you might
> want to just do that. I am not familiar with netbeans but if you like
> their Node implementation you should be able to port it into something
> your providers will like.

> -Phil

> Jean Couillaud wrote:
> > Hello,
> >
> > If you are developping a tree view, you should consider using a JFace
> > TreeViewer: http://www.eclipse.org/articles/index.html
> >
> > Jean
> >
> > Jorge wrote:
> >
> >
> >>I am creating a view, but my current code for the content provider, label
> >>provider and other pieces is full of "instanceof".
> >>I consider the use of "instanceof" not a very good practice in an OOP.
> >
> >
> >>I get rid of many of them (the instanceof clauses) by introducing a very
> >>basic "node" class. Then, all the objects in the content and label provider
> >>can be casted to this node class. (It is like a wrapper of a real object in
> >>the model).
> >>I'm not sure if this is possible, but I would like to attach some Action-s
> >>to those nodes, so that the context menu is filled with whatever Action-s
> >>are available for a particular object (node)
> >
> >
> >>Well...I found myself then coding something similar to what Netbeans calls
> >>Nodes. (I did some Netbeans programming before, but we decided to swtich to
> >>Eclipse).
> >
> >
> >>Are there any classes in Eclipse similar to the Nodes API in Netbeans ?
> >
> >
> >>The code looks very ugly with all those "instanceof". Even using my wrapper
> >>I still use the "instanceof" for each element wrapped. ( Of course, I could
> >>use a subclass of the general wrapper...but that what precisely I am
looking
> >>for in Eclipse)
> >
> >
> >>Thanks for your answers.
> >
> >
> >>-Jorge
> >
> >
> >
Previous Topic:CVS plugin let me send "edit" command only for read-only files..
Next Topic:Attaching to CVS commit
Goto Forum:
  


Current Time: Fri Nov 07 08:37:14 EST 2025

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

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

Back to the top