Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » swt inside createFigure
swt inside createFigure [message #139200] Mon, 25 June 2007 07:55 Go to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

Hi,

I would like to add a swt component inside my createFigure method, I'm
trying to adapt the following code to make it aviable with the creation
of my figure

public static void main(String args[]) {
Display display = new Display();
final Shell shell = new Shell (display);
LightweightSystem lws = new LightweightSystem(shell);
final TabFolder tabFolder = new TabFolder (shell, SWT.BORDER);
//MyTabFolder component = new MyTabFolder();
//component.setFolder(tabFolder);
for (int i=0; i<6; i++) {
TabItem item = new TabItem (tabFolder, SWT.NULL);
item.setText ("TabItem " + i);
// org.eclipse.swt.widgets.Button button = new
org.eclipse.swt.widgets.Button(tabFolder, SWT.PUSH);
// button.setText ("Page " + i);
// item.setControl (button);
}
tabFolder.setSize (500, 500);
//lws.setContents(component);

shell.open();

while (!shell.isDisposed())

while (!display.readAndDispatch())

display.sleep();
}

Any idea ?
Re: swt inside createFigure [message #139223 is a reply to message #139200] Mon, 25 June 2007 09:00 Go to previous message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

I've tryed

public IFigure createFigure() {
Shell shell = new Shell(Display.getCurrent());
final TabFolder tabFolder = new TabFolder (shell, SWT.BORDER);
LightweightSystem lws = new LightweightSystem(shell);
for (int i=0; i<6; i++) {
TabItem item = new TabItem (tabFolder, SWT.NULL);
item.setText ("TabItem " + i);
}
MyTabFolder result = new MyTabFolder();
result.setFolder(tabFolder);
ResizableCompartmentFigure figure = (ResizableCompartmentFigure) super
.createFigure();
figure.setTitleVisibility(false);
lws.setContents(result);
figure.add(result);
return figure;
}

but it doesn't display my tabbed pane :/

Regards

Alexandre
Previous Topic:Can I listen to creation of an edge?
Next Topic:How can I add a popup menu to the editor?
Goto Forum:
  


Current Time: Mon May 05 01:53:35 EDT 2025

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

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

Back to the top