Skip to main content



      Home
Home » Eclipse Projects » GEF » Place a SWT figure inside Draw2D figure
Place a SWT figure inside Draw2D figure [message #63622] Sat, 08 February 2003 16:13
Eclipse UserFriend
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);
Previous Topic:Logic Editor Example 0206
Next Topic:Change the Select Behaviour in GEF
Goto Forum:
  


Current Time: Thu May 01 19:36:27 EDT 2025

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

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

Back to the top