swt inside createFigure [message #139200] |
Mon, 25 June 2007 07:55  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02438 seconds