Help with CTabItem | Not able to view the component [message #497970] |
Fri, 13 November 2009 15:17 |
JavaGalaxy Messages: 6 Registered: November 2009 |
Junior Member |
|
|
Hi,
I am new to Plugin development. I am struck with simple problem.
Can anyone help me what is wrong with below code? I can't see anything in the display, its grayed out.
public class MyTab extends CTabItem {
public MyTab(final CTabFolder tabFolder, int style) {
super(tabFolder, style);
setText("Info123");
final Composite composite = new Composite(tabFolder, style);
GridLayout layout = new GridLayout(3, false);
//layout.marginHeight = layout.marginWidth = 20;
composite.setLayout(layout);
final Canvas canvas = new Canvas(composite, SWT.BORDER);
//canvas.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Group moduleGroup = new Group(canvas, SWT.NULL);
moduleGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
moduleGroup.setLayout(new GridLayout(2, false));
moduleGroup.setText("Module");
Text atlPathText = new Text(moduleGroup, SWT.SINGLE | SWT.BORDER);
atlPathText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
atlPathText.setText("12345");
final Button browseWorkspace = new Button(moduleGroup, SWT.RIGHT);
browseWorkspace.setText("Workspace");
}
}
And this class is been invoked from another Java file that extends TrayDialog as below
protected Control createDialogArea(Composite parent) {
Composite rootContainer = (Composite) super.createDialogArea(parent);
CTabFolder tabFolder = new CTabFolder(rootContainer, SWT.TOP);
CTabItem info = new MyTab(tabFolder, SWT.NONE);
System.out.println(info.isShowing());
System.out.println(info.getBounds());
}
When the print isShowing() and getBounds(), I get true and 0,0,0,0
Thanks
|
|
|
|
Powered by
FUDForum. Page generated in 0.04021 seconds