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 73393 Details for
Bug 171276
[Forms] layout issue with long scope set name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch
patch171276.txt (text/plain), 5.68 KB, created by
Adam Archer
on 2007-07-09 17:09:49 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Adam Archer
Created:
2007-07-09 17:09:49 EDT
Size:
5.68 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.help.ui >Index: src/org/eclipse/help/ui/internal/views/SearchPart.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java,v >retrieving revision 1.50 >diff -u -r1.50 SearchPart.java >--- src/org/eclipse/help/ui/internal/views/SearchPart.java 16 Mar 2007 20:18:56 -0000 1.50 >+++ src/org/eclipse/help/ui/internal/views/SearchPart.java 9 Jul 2007 21:08:49 -0000 >@@ -302,7 +302,7 @@ > } > > private void createScopeSet(Section section, FormToolkit toolkit) { >- scopeSetLink = toolkit.createHyperlink(section, null, SWT.NULL); >+ scopeSetLink = toolkit.createHyperlink(section, null, SWT.WRAP); > scopeSetLink.addHyperlinkListener(new HyperlinkAdapter() { > > public void linkActivated(HyperlinkEvent e) { >#P org.eclipse.ui.forms >Index: src/org/eclipse/ui/internal/forms/widgets/FormUtil.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/FormUtil.java,v >retrieving revision 1.26 >diff -u -r1.26 FormUtil.java >--- src/org/eclipse/ui/internal/forms/widgets/FormUtil.java 16 Mar 2007 20:24:02 -0000 1.26 >+++ src/org/eclipse/ui/internal/forms/widgets/FormUtil.java 9 Jul 2007 21:08:51 -0000 >@@ -130,7 +130,6 @@ > int last = 0; > int height = lineHeight; > int maxWidth = 0; >- > for (int loc = wb.first(); loc != BreakIterator.DONE; loc = wb.next()) { > String word = text.substring(saved, loc); > Point extent = gc.textExtent(word); >@@ -138,11 +137,20 @@ > // overflow > saved = last; > height += extent.y; >- } else { >- maxWidth = Math.max(maxWidth, extent.x); >+ // switch to current word so maxWidth will accommodate very long single words >+ word = text.substring(last, loc); >+ extent = gc.textExtent(word); > } >+ maxWidth = Math.max(maxWidth, extent.x); > last = loc; > } >+ /* >+ * Correct the height attribute in case it was calculated wrong due to wHint being less than maxWidth. >+ * The recursive call proved to be the only thing that worked in all cases. Some attempts can be made >+ * to estimate the height, but the algorithm needs to be run again to be sure. >+ */ >+ if (maxWidth > wHint) >+ return computeWrapSize(gc, text, maxWidth); > return new Point(maxWidth, height); > } > >@@ -387,7 +395,7 @@ > } > } > >- static boolean isWrapControl(Control c) { >+ public static boolean isWrapControl(Control c) { > if ((c.getStyle() & SWT.WRAP) != 0) > return true; > if (c instanceof Composite) { >Index: src/org/eclipse/ui/forms/widgets/ExpandableComposite.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ExpandableComposite.java,v >retrieving revision 1.57 >diff -u -r1.57 ExpandableComposite.java >--- src/org/eclipse/ui/forms/widgets/ExpandableComposite.java 22 Mar 2007 15:49:00 -0000 1.57 >+++ src/org/eclipse/ui/forms/widgets/ExpandableComposite.java 9 Jul 2007 21:08:50 -0000 >@@ -260,13 +260,27 @@ > - thmargin - thmargin; > if (tsize.x > 0) > twidth -= tsize.x + IGAP; >- if (textClient != null) >+ if (textClient != null) { > tcsize = textClientCache.computeSize(SWT.DEFAULT, SWT.DEFAULT); >- if (tcsize.x > 0) >- twidth -= tcsize.x + IGAP; >+ } > Point size = NULL_SIZE; >- if (textLabel != null) >- size = textLabelCache.computeSize(twidth, SWT.DEFAULT); >+ if (textLabel != null) { >+ if (tcsize.x > 0 && FormUtil.isWrapControl(textClient)) { >+ size = textLabelCache.computeSize(SWT.DEFAULT, SWT.DEFAULT); >+ if (twidth < size.x + IGAP + tcsize.x) { >+ twidth -= IGAP; >+ if (textLabel instanceof Label) >+ size = FormUtil.computeWrapSize(new GC(textLabel), ((Label)textLabel).getText(), Math.round(twidth*(size.x/(float)(size.x+tcsize.x)))); >+ else >+ size = textLabelCache.computeSize(Math.round(twidth*(size.x/(float)(size.x+tcsize.x))), SWT.DEFAULT); >+ tcsize = textClientCache.computeSize(twidth-size.x, SWT.DEFAULT); >+ } >+ } >+ else { >+ twidth -= tcsize.x + IGAP; >+ size = textLabelCache.computeSize(twidth, SWT.DEFAULT); >+ } >+ } > if (textLabel instanceof Label) { > Point defSize = textLabelCache.computeSize(SWT.DEFAULT, > SWT.DEFAULT); >@@ -386,13 +400,26 @@ > Point tcsize = NULL_SIZE; > if (textClient != null) { > tcsize = textClientCache.computeSize(SWT.DEFAULT, SWT.DEFAULT); >- if (innertHint != SWT.DEFAULT) >- innertHint -= IGAP + tcsize.x; > } > Point size = NULL_SIZE; > >- if (textLabel != null) >- size = textLabelCache.computeSize(innertHint, SWT.DEFAULT); >+ if (textLabel != null) { >+ if (tcsize.x > 0 && FormUtil.isWrapControl(textClient)) { >+ size = textLabelCache.computeSize(SWT.DEFAULT, SWT.DEFAULT); >+ if (innertHint != SWT.DEFAULT && innertHint < size.x + IGAP + tcsize.x) { >+ innertHint -= IGAP; >+ if (textLabel instanceof Label) >+ size = FormUtil.computeWrapSize(new GC(textLabel), ((Label)textLabel).getText(), Math.round(innertHint*(size.x/(float)(size.x+tcsize.x)))); >+ else >+ size = textLabelCache.computeSize(Math.round(innertHint*(size.x/(float)(size.x+tcsize.x))), SWT.DEFAULT); >+ tcsize = textClientCache.computeSize(innertHint-size.x, SWT.DEFAULT); >+ } >+ } else { >+ if (innertHint != SWT.DEFAULT) >+ innertHint -= IGAP + tcsize.x; >+ size = textLabelCache.computeSize(innertHint, SWT.DEFAULT); >+ } >+ } > if (textLabel instanceof Label) { > Point defSize = textLabelCache.computeSize(SWT.DEFAULT, > SWT.DEFAULT);
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 171276
:
57288
|
73381
|
73393
|
73575