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 251077 Details for
Bug 460745
CTabFolder layouts ALL children when a parent container request layout(true,true)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Sample
Sample.java (text/x-java-source), 1.89 KB, created by
Thomas Schindl
on 2015-02-24 17:54:31 EST
(
hide
)
Description:
Sample
Filename:
MIME Type:
Creator:
Thomas Schindl
Created:
2015-02-24 17:54:31 EST
Size:
1.89 KB
patch
obsolete
>package test.ctabfolder; > > >import org.eclipse.swt.SWT; >import org.eclipse.swt.custom.CTabFolder; >import org.eclipse.swt.custom.CTabItem; >import org.eclipse.swt.events.SelectionAdapter; >import org.eclipse.swt.events.SelectionEvent; >import org.eclipse.swt.graphics.Point; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Layout; >import org.eclipse.swt.widgets.Shell; > >public class Sample { > public static void main(String[] args) { > Display d = new Display(); > > Shell s = new Shell(d); > s.setLayout(new GridLayout()); > > CTabFolder f = new CTabFolder(s, SWT.BORDER); > f.setLayoutData(new GridData(GridData.FILL_BOTH)); > > { > CTabItem i = new CTabItem(f, SWT.NONE); > i.setText("Test"); > Composite child = new Composite(f,SWT.NONE); > child.setLayout(new MyLayout()); > child.setData("Child 1"); > i.setControl(child); > } > > { > CTabItem i = new CTabItem(f, SWT.NONE); > i.setText("Test 2"); > Composite child = new Composite(f,SWT.NONE); > child.setLayout(new MyLayout()); > child.setData("Child 2"); > i.setControl(child); > } > > > Button b = new Button(s, SWT.PUSH); > b.setText("Layout parent"); > b.addSelectionListener(new SelectionAdapter() { > @Override > public void widgetSelected(SelectionEvent e) { > s.layout(true, true); > } > }); > > s.open(); > while( ! s.isDisposed() ) { > if( d.readAndDispatch() ) { > d.sleep(); > } > } > } > > static class MyLayout extends Layout { > > @Override > protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { > return new Point(0, 0); > } > > @Override > protected void layout(Composite composite, boolean flushCache) { > System.err.println("Doing a layout on " + composite.getData()); > Thread.dumpStack(); > } > > } >}
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 460745
: 251077