| [news.eclipse.tools] Re: How can I split my EditorPart border in half? |
|
I could probably use a picture with some indication of what
you do not like about what you have got.
Here is another stab at an example of my own. The
following code will give you (as far as I can tell) exactly the look you are
getting with the Hierarchy Tree and Members components. If you wanted a
heavier spearation, you could also uncomment the alternate ViewForm creation
lines - this will put a single line around your components.
public static void main (String [] args)
{
Display display =
new Display ();
Shell shell =
new Shell (display);
shell.setLayout(new
FillLayout());
ViewForm vform1 =
new ViewForm(shell,
SWT.BORDER);
SashForm sform =
new SashForm(vform1,
SWT.VERTICAL);
vform1.setContent(sform);
ViewForm vform2 =
new ViewForm(sform,
SWT.NONE);
//ViewForm vform2 = new ViewForm(sform, SWT.BORDER |
SWT.FLAT);
CLabel label =
new CLabel(vform2,
SWT.NONE);
label.setText("My
View");
vform2.setTopLeft(label);
Text t =
new Text(vform2,
SWT.NONE);
t.setText("Top");
vform2.setContent(t);
ViewForm vform3 =
new ViewForm(sform,
SWT.NONE);
//ViewForm vform3 = new ViewForm(sform, SWT.BORDER |
SWT.FLAT);
label =
new CLabel(vform3,
SWT.NONE);
label.setText("My
Other View");
vform3.setTopLeft(label);
t = new Text(vform3, SWT.NONE);
t.setText("Bottom");
vform3.setContent(t);
shell.open
();
while (!shell.isDisposed
()) {
if
(!display.readAndDispatch ()) display.sleep ();
}
display.dispose
();
}
|