[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.emf] Re: use EMF model from GEF
|
- From: Nikolaj Berntsen <nberntsen@xxxxxxxxxxxx>
- Date: Thu, 04 Sep 2003 10:13:09 +0200
- Newsgroups: eclipse.tools.emf
- Organization: EclipseCorner
- User-agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.5b) Gecko/20030827
Nikolaj Berntsen wrote:
I would probably like to get some kind of tree view (parent/child) view
on my data structure. I can probably use an adapter for this. Overnight
I occured to me I might be able to get inspired from the adapter (way of
doing things) for the selection viewer.
I managed to get the children from an adapterfactory using the directly
accessed root:
CandyBox candyBox = (CandyBox)candyResource.getContents().get(0);
AdapterFactoryContentProvider cp = new
AdapterFactoryContentProvider(adapterFactory);
Object[] obs = cp.getChildren(candyBox);
Which is 'better' than the direct access, since it gives all children no
matter the type (my example only had one type, Candy).
Is there a way to get the Root element other than the above way? Or is
using getContents().get(0) the 'correct' way to start walking your tree
of data?
Not really important, but I'd like to know.
Cheers,
/\/ikolaj