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 144387 Details for
Bug 286520
Missing ScrolledComposite.setShowFocusedControl() and default behavior inconsistent with SWT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
SWT sample showing default behavior
ScrollTestShell.java (text/plain), 2.35 KB, created by
Robert Enyedi
on 2009-08-13 09:47:44 EDT
(
hide
)
Description:
SWT sample showing default behavior
Filename:
MIME Type:
Creator:
Robert Enyedi
Created:
2009-08-13 09:47:44 EDT
Size:
2.35 KB
patch
obsolete
>package formsuitest; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.custom.ScrolledComposite; >import org.eclipse.swt.graphics.Point; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.*; > >public class ScrollTestShell extends Shell { > public static void main(String args[]) { > try { > Display display = Display.getDefault(); > ScrollTestShell shell = new ScrollTestShell(display); > shell.open(); > shell.layout(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > } catch (Exception e) { > e.printStackTrace(); > } > } > > public ScrollTestShell(Display display) { > super(display, SWT.SHELL_TRIM); > setLayout(new FillLayout(SWT.VERTICAL)); > > ScrolledComposite scrolledComposite = new ScrolledComposite(this, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); > > // Uncomment this to get the undesired RWT behavior. > //scrolledComposite.setShowFocusedControl(true); > > scrolledComposite.setExpandHorizontal(true); > scrolledComposite.setExpandVertical(true); > > Composite rootComposite = new Composite(scrolledComposite, SWT.NONE); > rootComposite.setLayout(new GridLayout(1, false)); > scrolledComposite.setContent(rootComposite); > scrolledComposite.setMinSize(1500, 1500); > > Text label = new Text(rootComposite, SWT.MULTI); > label.setText("\n\n\n\nHeader\n\n\n\n"); > label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); > > ScrollTestComposite scrollTestComposite = new ScrollTestComposite(rootComposite, SWT.NONE); > scrollTestComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > > setSize(589, 404); > rootComposite.setSize(1500, 1500); > } > > @Override > protected void checkSubclass() {} > > public class ScrollTestComposite extends Composite { > public ScrollTestComposite(Composite parent, int style) { > super(parent, style); > setLayout(new FillLayout(SWT.HORIZONTAL)); > { > Tree tree = new Tree(this, SWT.BORDER); > { > for (int i = 0; i < 20; i++) { > TreeItem treeItem = new TreeItem(tree, SWT.NONE); > treeItem.setText("New Parent " + i); > > for (int j = 0; j < 20; j++) { > TreeItem treeChild = new TreeItem(treeItem, > SWT.NONE); > treeChild.setText("Child " + j); > } > } > } > } > } > > @Override > protected void checkSubclass() {} > } >}
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 286520
: 144387 |
144388
|
144389
|
144390
|
144391
|
144392
|
144393
|
144395
|
144396