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  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
> >
> >
> >
|
|
|
Goto Forum:
Current Time: Fri Nov 07 04:42:15 EST 2025
Powered by FUDForum. Page generated in 0.04595 seconds
|