Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 205861
Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java (+7 lines)
Lines 911-914 Link Here
911
		return false;
911
		return false;
912
	}
912
	}
913
913
914
	/**
915
	 * Returns text masking the &-character from decoration as an accelerator in SWT labels.
916
	 */
917
	public static String escapeLabelText(String text) {
918
		return (text != null) ? text.replace("&", "&&") : null; // mask & from SWT
919
	}
920
914
}
921
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java (-2 / +17 lines)
Lines 20-25 Link Here
20
20
21
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.core.runtime.IAdaptable;
22
import org.eclipse.core.runtime.IStatus;
22
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.jface.layout.GridDataFactory;
23
import org.eclipse.jface.window.ToolTip;
24
import org.eclipse.jface.window.ToolTip;
24
import org.eclipse.mylyn.commons.core.DateUtil;
25
import org.eclipse.mylyn.commons.core.DateUtil;
25
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
26
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
Lines 39-44 Link Here
39
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskDataDiff;
40
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskDataDiff;
40
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotification;
41
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotification;
41
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotifier;
42
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotifier;
43
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
42
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
44
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
43
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
45
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
44
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
46
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
Lines 52-57 Link Here
52
import org.eclipse.mylyn.tasks.ui.TasksUi;
54
import org.eclipse.mylyn.tasks.ui.TasksUi;
53
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
55
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
54
import org.eclipse.swt.SWT;
56
import org.eclipse.swt.SWT;
57
import org.eclipse.swt.graphics.GC;
55
import org.eclipse.swt.graphics.Image;
58
import org.eclipse.swt.graphics.Image;
56
import org.eclipse.swt.graphics.Point;
59
import org.eclipse.swt.graphics.Point;
57
import org.eclipse.swt.graphics.Rectangle;
60
import org.eclipse.swt.graphics.Rectangle;
Lines 79-84 Link Here
79
82
80
	private final static int MAX_TEXT_WIDTH = 300;
83
	private final static int MAX_TEXT_WIDTH = 300;
81
84
85
	private final static int MAX_WIDTH = 600;
86
82
	private final static int X_SHIFT;
87
	private final static int X_SHIFT;
83
88
84
	static {
89
	static {
Lines 604-614 Link Here
604
		imageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING));
609
		imageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING));
605
		imageLabel.setImage(image);
610
		imageLabel.setImage(image);
606
611
607
		Label textLabel = new Label(parent, SWT.NONE);
612
		Label textLabel = new Label(parent, SWT.WRAP);
608
		textLabel.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
613
		textLabel.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
609
		textLabel.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
614
		textLabel.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
610
		textLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER));
615
		textLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER));
611
		textLabel.setText(removeTrailingNewline(text));
616
		textLabel.setText(TasksUiInternal.escapeLabelText(removeTrailingNewline(text)));
617
618
		GC gc = new GC(textLabel);
619
		try {
620
			if (gc.textExtent(text).x > MAX_WIDTH) {
621
				GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).hint(MAX_WIDTH, SWT.DEFAULT).applyTo(
622
						textLabel);
623
			}
624
		} finally {
625
			gc.dispose();
626
		}
612
	}
627
	}
613
628
614
	private static class ProgressData {
629
	private static class ProgressData {
(-)src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java (-1 / +2 lines)
Lines 9-14 Link Here
9
package org.eclipse.mylyn.tasks.ui.editors;
9
package org.eclipse.mylyn.tasks.ui.editors;
10
10
11
import org.eclipse.core.runtime.Assert;
11
import org.eclipse.core.runtime.Assert;
12
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
12
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
13
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
13
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
14
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
14
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
15
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
Lines 76-82 Link Here
76
77
77
	public String getLabel() {
78
	public String getLabel() {
78
		String label = getAttributeMapper().getLabel(getTaskAttribute());
79
		String label = getAttributeMapper().getLabel(getTaskAttribute());
79
		return (label != null) ? label.replace("&", "&&") : null; // mask & from SWT
80
		return TasksUiInternal.escapeLabelText(label);
80
	}
81
	}
81
82
82
	public Label getLabelControl() {
83
	public Label getLabelControl() {

Return to bug 205861