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 110509 Details for
Bug 205861
improve tooltip presentation and content
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]
limit tooltip width
clipboard.txt (text/plain), 4.77 KB, created by
Steffen Pingel
on 2008-08-20 22:06:09 EDT
(
hide
)
Description:
limit tooltip width
Filename:
MIME Type:
Creator:
Steffen Pingel
Created:
2008-08-20 22:06:09 EDT
Size:
4.77 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java,v >retrieving revision 1.56 >diff -u -r1.56 TasksUiInternal.java >--- src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java 18 Aug 2008 06:01:39 -0000 1.56 >+++ src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java 21 Aug 2008 02:05:31 -0000 >@@ -911,4 +911,11 @@ > return false; > } > >+ /** >+ * Returns text masking the &-character from decoration as an accelerator in SWT labels. >+ */ >+ public static String escapeLabelText(String text) { >+ return (text != null) ? text.replace("&", "&&") : null; // mask & from SWT >+ } >+ > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java,v >retrieving revision 1.48 >diff -u -r1.48 TaskListToolTip.java >--- src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java 11 Jun 2008 17:35:58 -0000 1.48 >+++ src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java 21 Aug 2008 02:05:31 -0000 >@@ -20,6 +20,7 @@ > > import org.eclipse.core.runtime.IAdaptable; > import org.eclipse.core.runtime.IStatus; >+import org.eclipse.jface.layout.GridDataFactory; > import org.eclipse.jface.window.ToolTip; > import org.eclipse.mylyn.commons.core.DateUtil; > import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages; >@@ -39,6 +40,7 @@ > import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskDataDiff; > import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotification; > import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotifier; >+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; > import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; > import org.eclipse.mylyn.tasks.core.IRepositoryElement; > import org.eclipse.mylyn.tasks.core.IRepositoryQuery; >@@ -52,6 +54,7 @@ > import org.eclipse.mylyn.tasks.ui.TasksUi; > import org.eclipse.mylyn.tasks.ui.TasksUiImages; > import org.eclipse.swt.SWT; >+import org.eclipse.swt.graphics.GC; > import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.graphics.Rectangle; >@@ -79,6 +82,8 @@ > > private final static int MAX_TEXT_WIDTH = 300; > >+ private final static int MAX_WIDTH = 600; >+ > private final static int X_SHIFT; > > static { >@@ -604,11 +609,21 @@ > imageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING)); > imageLabel.setImage(image); > >- Label textLabel = new Label(parent, SWT.NONE); >+ Label textLabel = new Label(parent, SWT.WRAP); > textLabel.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND)); > textLabel.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND)); > textLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER)); >- textLabel.setText(removeTrailingNewline(text)); >+ textLabel.setText(TasksUiInternal.escapeLabelText(removeTrailingNewline(text))); >+ >+ GC gc = new GC(textLabel); >+ try { >+ if (gc.textExtent(text).x > MAX_WIDTH) { >+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).hint(MAX_WIDTH, SWT.DEFAULT).applyTo( >+ textLabel); >+ } >+ } finally { >+ gc.dispose(); >+ } > } > > private static class ProgressData { >Index: src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java,v >retrieving revision 1.6 >diff -u -r1.6 AbstractAttributeEditor.java >--- src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java 6 Jun 2008 00:09:26 -0000 1.6 >+++ src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java 21 Aug 2008 02:05:31 -0000 >@@ -9,6 +9,7 @@ > package org.eclipse.mylyn.tasks.ui.editors; > > import org.eclipse.core.runtime.Assert; >+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; > import org.eclipse.mylyn.tasks.core.data.TaskAttribute; > import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; > import org.eclipse.mylyn.tasks.core.data.TaskDataModel; >@@ -76,7 +77,7 @@ > > public String getLabel() { > String label = getAttributeMapper().getLabel(getTaskAttribute()); >- return (label != null) ? label.replace("&", "&&") : null; // mask & from SWT >+ return TasksUiInternal.escapeLabelText(label); > } > > public Label getLabelControl() {
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 205861
:
85155
|
90274
| 110509 |
123982
|
254613