Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » treeviewer with 2 columns
treeviewer with 2 columns [message #1015501] Thu, 28 February 2013 21:08 Go to next message
Mokhtar Alshubei is currently offline Mokhtar AlshubeiFriend
Messages: 121
Registered: November 2011
Location: Germany
Senior Member
Hi,

my model is an arraylist of 2 objects, each has an arraylist field of some sub-objects that in turn each has an arraylist of sub-objects. so my tree looks like:

root1>
-----sub1.1
---------sub1.1.1
---------sub1.1.2
root2>
-----sub2.1
---------sub2.1.1
---------sub2.1.2

can i get the tree with 2 columns ? like this
root1>...............root2>
-----sub1.1...............-----sub2.1...............
---------sub1.1.1...............---------sub2.1.1...............
---------sub1.1.2...............---------sub2.1.2...............
I tried but I failed. this is what my method looks like:
@Override
	public Object[] getElements(Object inputElement) {
		return getChildren(inputElement);
	}

	@Override
	public Object[] getChildren(Object parentElement) {
		if (parentElement instanceof AnalysisResultsModel)
			return ((AnalysisResultsModel) parentElement).getResults().toArray();
		if (parentElement instanceof ResultsVersion)
			return ((ResultsVersion) parentElement).getCandidates().toArray();
		if (parentElement instanceof Candidate)
			return ((Candidate) parentElement).getElements().toArray();
		
		return null;
	}

Thanks a lot,
Mok
Re: treeviewer with 2 columns [message #1028686 is a reply to message #1015501] Thu, 28 March 2013 15:56 Go to previous message
Timur Achmetow is currently offline Timur AchmetowFriend
Messages: 38
Registered: April 2012
Member
Look here:
http://www.vogella.com/articles/EclipseJFaceTree/article.html
Previous Topic:Databinding - AssertionFailedException on disposing TreeViewer: Getter called on disposed observable
Next Topic:How to add a listener to 'Next'Button of JFACEe Wizard Page?
Goto Forum:
  


Current Time: Tue Apr 23 06:46:06 GMT 2024

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

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

Back to the top