| [news.eclipse.tools] Re: How can I split my EditorPart border in half? |
|
/**
* The SashForm lays out its children
in a Row or Column arrangement (as specified
* by the orientation) and places a
Sash between the children.
* One child may be maximized to
occupy the entire size of the SashForm.
* The relative sizes of the children
may be specfied using weights.
*/
If you create a SashForm without any
border, it should blend nicely into the edges of the ViewForm.
public static void main
(String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
shell.setLayout(new FillLayout());
ViewForm vform = new ViewForm(shell, SWT.BORDER);
CLabel label = new CLabel(vform, SWT.NONE);
label.setText("My View");
vform.setTopLeft(label);
SashForm sform = new SashForm(vform, SWT.VERTICAL);
vform.setContent(sform);
Text
t = new Text(sform, SWT.NONE);
t.setText("Top");
t =
new Text(sform, SWT.NONE);
t.setText("Bottom");
shell.open
();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep
();
}
display.dispose ();
}
|