TreeViewer only showing one level [message #436604] |
Tue, 13 September 2005 16:12 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03016 seconds