Can't make JFace TreeViewer larger [message #538865] |
Tue, 08 June 2010 16:13  |
Eclipse User |
|
|
|
Hello,
I want to create a JFace TreeViewer in a JFace WizardPage. My problem is that the viewer is too small.
I tried to extend the viewer over two columns of a GridLayout but it doesn't work. The viewer always has the same
size.
public class FileSelectionPage extends WizardPage implements ISelectionChangedListener {
. . .
. . .
public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
gl.numColumns = 2;
composite.setLayout(gl);
Label label = new Label(composite, SWT.NONE);
label.setText("Please select an axl file: ");
Label dummyLabel2 = new Label(composite, SWT.NONE);
dummyLabel2.setText(" ");
TreeViewer viewer = new TreeViewer(composite,SWT.BORDER);
viewer.setContentProvider(new FileTreeContentProvider());
viewer.setLabelProvider(new FileTreeLabelProvider());
File[] fileSystemRoots = File.listRoots();
viewer.setInput(fileSystemRoots);
viewer.addSelectionChangedListener(this);
GridData viewerGridData = new GridData();
viewerGridData.horizontalSpan = 2;
viewer.getControl().setLayoutData(viewerGridData);
setControl(composite);
//setControl(parent);
}
. . .
}
best regards
Simon
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02748 seconds