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 2658 Details for
Bug 27213
Show Outline (CTRL+O) view in GTK version is too big
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.
An example of computeSize difference
PR27213.java (text/plain), 1.89 KB, created by
Charlie Gracie
on 2002-12-04 19:09:08 EST
(
hide
)
Description:
An example of computeSize difference
Filename:
MIME Type:
Creator:
Charlie Gracie
Created:
2002-12-04 19:09:08 EST
Size:
1.89 KB
patch
obsolete
>import org.eclipse.swt.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >public class PR27213 { > > public static void main(String[] args) { > Display display = new Display(); > //the first tree has 3 children with the second and third children > //having 60 and 40 children respectively > Shell shell1 = new Shell(display); > shell1.setLayout(new GridLayout(2,true)); > Tree tree1 = new Tree(shell1, SWT.SINGLE | SWT.V_SCROLL); > GridData gridData = new GridData(GridData.FILL_BOTH); > tree1.setLayoutData(gridData); > > TreeItem item1 = new TreeItem(tree1,0); > item1.setText("child"); > TreeItem item2 = new TreeItem(tree1,0); > item2.setText("child"); > TreeItem item3 = new TreeItem(tree1,0); > item3.setText("child"); > for(int i = 0;i<60;i++) { > TreeItem item = new TreeItem(item2, SWT.NONE); > item.setText("sub child"+i); > } > for(int i = 0;i<40;i++) { > TreeItem item = new TreeItem(item3, SWT.NONE); > item.setText("sub child"+i); > } > Point point1 = shell1.computeSize(SWT.DEFAULT,SWT.DEFAULT); > item1.setExpanded(true); > item2.setExpanded(true); > item3.setExpanded(true); > Point point2 = shell1.computeSize(SWT.DEFAULT,SWT.DEFAULT); > > //the second tree has 103 children > Shell shell2 = new Shell(display); > shell2.setLayout(new GridLayout(2,true)); > Tree tree2 = new Tree(shell2, SWT.SINGLE | SWT.V_SCROLL); > tree2.setLayoutData(gridData); > > for(int i = 0;i<103;i++) { > TreeItem item = new TreeItem(tree2, SWT.NONE); > item.setText("child"+i); > } > Point point3 = shell2.computeSize(SWT.DEFAULT,SWT.DEFAULT); > > //on gtk 2 and 3 are equal but on widows and motif 1 and 2 are equal > System.out.println("point1 y "+point1.y); > System.out.println("point2 y "+point2.y); > System.out.println("point3 y "+point3.y); > > shell1.dispose(); > shell2.dispose(); > display.dispose(); > } >}
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 27213
: 2658