Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 139284 Details for
Bug 208167
[JFace] Request for FormDataBuilder
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Snippet using FormLayoutBuilder
SnippetWithBuilder.java (text/plain), 1.96 KB, created by
Micah Hainline
on 2009-06-16 08:51:06 EDT
(
hide
)
Description:
Snippet using FormLayoutBuilder
Filename:
MIME Type:
Creator:
Micah Hainline
Created:
2009-06-16 08:51:06 EDT
Size:
1.96 KB
patch
obsolete
>import org.eclipse.swt.SWT; >import org.eclipse.swt.layout.FormLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Label; >import org.eclipse.swt.widgets.List; >import org.eclipse.swt.widgets.Shell; > >public class SnippetWithBuilder { > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > createComposite(shell); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > } > > private static final int LIST_MARGIN = 10; > private static final int HEADER_MARGIN = 5; > private static final int ARROW_BUTTON_MARGIN = 3; > > private static void createComposite(Composite parent) { > parent.setLayout(new FormLayout()); > Label header1 = new Label(parent, SWT.NONE); > header1.setText("Available"); > List list1 = new List(parent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER); > Button right = new Button(parent, SWT.ARROW | SWT.RIGHT); > Label moveLabel = new Label(parent, SWT.NONE); > moveLabel.setText("Move"); > Button left = new Button(parent, SWT.ARROW | SWT.LEFT); > Label header2 = new Label(parent, SWT.NONE); > header2.setText("Selected"); > List list2 = new List(parent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER); > > FormDataBuilder.position(header1).top().left(); > FormDataBuilder.position(list1).top(header1, HEADER_MARGIN).bottom().left().right(moveLabel, LIST_MARGIN); > FormDataBuilder.position(moveLabel).centerHorizontally().centerVertically(); > FormDataBuilder.position(right).centerHorizontally().bottom(moveLabel, ARROW_BUTTON_MARGIN); > FormDataBuilder.position(left).centerHorizontally().top(moveLabel, ARROW_BUTTON_MARGIN); > FormDataBuilder.position(header2).top().left(list2, 0, SWT.LEFT); > FormDataBuilder.position(list2).top(header2, HEADER_MARGIN).bottom().left(moveLabel, LIST_MARGIN).right(); > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 208167
:
81680
|
139283
| 139284