Place a SWT figure inside Draw2D figure [message #63622] |
Sat, 08 February 2003 16:13 |
Eclipse User |
|
|
|
Originally posted by: radienssmgs2.hotmail.com
I would like to put a SWT widget inside Draw2D figure, so I use the
TableTree SWT example and put that inside the CiruitFigure example and then
create a FigureCanvas for that tableTree and setup the content with a new
Figure and add that figure to the ScrollPane. But I don't see my TableTree.
Could someone please tell me what do I miss:
<<< Here is what I add to the Circuit Figure constructor >>>>
Shell shell = new Shell(Display.getCurrent());
final TableTree tableTree = new TableTree(shell, SWT.FULL_SELECTION);
Table table = tableTree.getTable();
TableColumn column1 = new TableColumn(table, SWT.NONE);
column1.setText("column 1");
TableColumn column2 = new TableColumn(table, SWT.NONE);
column2.setText("column 2");
for (int i = 0; i < 4; i++) {
TableTreeItem item = new TableTreeItem(tableTree, SWT.NONE);
item.setText(0, "table tree item" + i);
item.setText(1, "value " + i);
}
column1.pack();
column2.pack();
Figure fig = new Figure();
FigureCanvas fc = new FigureCanvas(tableTree);
fc.setContents(fig);
scrollpane.add(fig);
|
|
|
Powered by
FUDForum. Page generated in 0.04437 seconds