Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » TreeViewer only showing one level
TreeViewer only showing one level [message #436604] Tue, 13 September 2005 16:12 Go to next message
Eclipse UserFriend
Originally posted by: bdberry.us.ibm.com

My content provider (implements ITreeContentProvider) does not get past
the root element and displays no content - it does not even seem to
reach the methods (right now I have put System.out in the content
provider just to trap the order of execution). Is there something wrong
with the way I am setting this up?

tree = new Tree(parent, SWT.SINGLE);
tree.setHeaderVisible(true);
tree.setLinesVisible(true);

headings = new String [] {"Name", "Status", "Assignee", "Last Modified"};

for (int index = 0; index < headings.length; index++) {
treeColumn = new TreeColumn(tree, SWT.LEFT);
treeColumn.setText(headings[index]);
treeColumn.setWidth(170);;
treeColumn.setResizable(true);
}

gridData = new GridData();
gridData.horizontalAlignment = SWT.LEFT;
gridData.grabExcessVerticalSpace = true;
gridData.minimumHeight = 250;
tree.setLayoutData(gridData);

setViewer(new TableTreeViewer(tree, TreeViewer.ALL_LEVELS));
getViewer().setContentProvider(new SolutionPakContentProvider());
getViewer().setLabelProvider(new SolutionPakLabelProvider());
getViewer().setInput(
((EngagementEditorInput)getEditorInput()).getEngagementInfo( ) );
Re: TreeViewer only showing one level [message #436607 is a reply to message #436604] Tue, 13 September 2005 19:09 Go to previous message
Eclipse UserFriend
Originally posted by: bdberry.us.ibm.com

Brian Berry wrote:
> My content provider (implements ITreeContentProvider) does not get past
> the root element and displays no content - it does not even seem to
> reach the methods (right now I have put System.out in the content
> provider just to trap the order of execution). Is there something wrong
> with the way I am setting this up?
>
> tree = new Tree(parent, SWT.SINGLE);
> tree.setHeaderVisible(true);
> tree.setLinesVisible(true);
>
> headings = new String [] {"Name", "Status", "Assignee", "Last Modified"};
>
> for (int index = 0; index < headings.length; index++) {
> treeColumn = new TreeColumn(tree, SWT.LEFT);
> treeColumn.setText(headings[index]);
> treeColumn.setWidth(170);;
> treeColumn.setResizable(true);
> }
>
> gridData = new GridData();
> gridData.horizontalAlignment = SWT.LEFT;
> gridData.grabExcessVerticalSpace = true;
> gridData.minimumHeight = 250;
> tree.setLayoutData(gridData);
>
> setViewer(new TableTreeViewer(tree, TreeViewer.ALL_LEVELS));
> getViewer().setContentProvider(new SolutionPakContentProvider());
> getViewer().setLabelProvider(new SolutionPakLabelProvider());
> getViewer().setInput(
> ((EngagementEditorInput)getEditorInput()).getEngagementInfo( ) );

The problem is I had to use viewer.getTree()... rather than create a new
tree.
Previous Topic:Disabled Text inside a form, the border doesn't show
Next Topic:access to META-INFO/persistence.xml from required plugin
Goto Forum:
  


Current Time: Sat Dec 07 22:51:43 GMT 2024

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

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

Back to the top