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 181759 Details for
Bug 268402
[Forms] FormText links do not erase focus ring
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.
[patch]
Fix 2
patch.txt (text/plain), 4.24 KB, created by
Markus Keller
on 2010-10-26 15:06:24 EDT
(
hide
)
Description:
Fix 2
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2010-10-26 15:06:24 EDT
Size:
4.24 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.forms >Index: src/org/eclipse/ui/forms/widgets/FormText.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/FormText.java,v >retrieving revision 1.88 >diff -u -r1.88 FormText.java >--- src/org/eclipse/ui/forms/widgets/FormText.java 21 Sep 2010 18:57:58 -0000 1.88 >+++ src/org/eclipse/ui/forms/widgets/FormText.java 26 Oct 2010 18:52:19 -0000 >@@ -1596,22 +1596,21 @@ > > private void paintFocusTransfer(IHyperlinkSegment oldLink, > IHyperlinkSegment newLink) { >- GC gc = new GC(this); >- Color bg = getBackground(); >- Color fg = getForeground(); >- gc.setFont(getFont()); > if (oldLink != null) { >- gc.setBackground(bg); >- gc.setForeground(fg); >- oldLink.paintFocus(gc, bg, fg, false, null); >+ Rectangle r = oldLink.getBounds(); >+ redraw(r.x, r.y, r.width, r.height, true); >+ update(); > } > if (newLink != null) { >- // ensureVisible(newLink); >+ GC gc = new GC(this); >+ Color bg = getBackground(); >+ Color fg = getForeground(); >+ gc.setFont(getFont()); > gc.setBackground(bg); > gc.setForeground(fg); > newLink.paintFocus(gc, bg, fg, true, null); >+ gc.dispose(); > } >- gc.dispose(); > } > > private void ensureVisible(IFocusSelectable segment) { >Index: src/org/eclipse/ui/internal/forms/widgets/AggregateHyperlinkSegment.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/AggregateHyperlinkSegment.java,v >retrieving revision 1.12 >diff -u -r1.12 AggregateHyperlinkSegment.java >--- src/org/eclipse/ui/internal/forms/widgets/AggregateHyperlinkSegment.java 18 May 2005 15:53:11 -0000 1.12 >+++ src/org/eclipse/ui/internal/forms/widgets/AggregateHyperlinkSegment.java 26 Oct 2010 18:52:19 -0000 >@@ -117,16 +117,15 @@ > * @see org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment#getBounds() > */ > public Rectangle getBounds() { >- Rectangle bounds = new Rectangle(Integer.MAX_VALUE, Integer.MAX_VALUE, >- 0, 0); >- // TODO this is wrong >- for (int i = 0; i < segments.size(); i++) { >+ if (segments.size() == 0) >+ return new Rectangle(Integer.MAX_VALUE, Integer.MAX_VALUE, 0, 0); >+ >+ IHyperlinkSegment segment0 = (IHyperlinkSegment) segments.get(0); >+ Rectangle bounds = segment0.getBounds(); >+ for (int i = 1; i < segments.size(); i++) { > IHyperlinkSegment segment = (IHyperlinkSegment) segments.get(i); > Rectangle sbounds = segment.getBounds(); >- bounds.x = Math.min(bounds.x, sbounds.x); >- bounds.y = Math.min(bounds.y, sbounds.y); >- bounds.width = Math.max(bounds.width, sbounds.width); >- bounds.height = Math.max(bounds.height, sbounds.height); >+ bounds.add(sbounds); > } > return bounds; > } >Index: src/org/eclipse/ui/internal/forms/widgets/TextSegment.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/TextSegment.java,v >retrieving revision 1.32 >diff -u -r1.32 TextSegment.java >--- src/org/eclipse/ui/internal/forms/widgets/TextSegment.java 22 Jun 2010 16:40:37 -0000 1.32 >+++ src/org/eclipse/ui/internal/forms/widgets/TextSegment.java 26 Oct 2010 18:52:19 -0000 >@@ -15,6 +15,7 @@ > import java.util.Hashtable; > import java.util.Vector; > >+import org.eclipse.jface.util.Geometry; > import org.eclipse.swt.SWT; > import org.eclipse.swt.graphics.Color; > import org.eclipse.swt.graphics.Font; >@@ -206,20 +207,16 @@ > } > > public Rectangle getBounds() { >- int x = 0, y = 0; >- int width = 0, height = 0; >- >- for (int i = 0; i < areaRectangles.size(); i++) { >+ if (areaRectangles.size() == 0) >+ return new Rectangle(0, 0, 0, 0); >+ >+ AreaRectangle ar0 = (AreaRectangle) areaRectangles.get(0); >+ Rectangle bounds = Geometry.copy(ar0.rect); >+ for (int i = 1; i < areaRectangles.size(); i++) { > AreaRectangle ar = (AreaRectangle) areaRectangles.get(i); >- if (i == 0) { >- x = ar.rect.x; >- y = ar.rect.y; >- } else >- x = Math.min(ar.rect.x, x); >- width = Math.max(ar.rect.width, width); >- height += ar.rect.height; >+ bounds.add(ar.rect); > } >- return new Rectangle(x, y, width, height); >+ return bounds; > } > > public boolean advanceLocator(GC gc, int wHint, Locator locator,
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 268402
:
178123
| 181759