Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2010-12-10 22:30:13 +0000
committerfbecker2010-12-10 22:30:13 +0000
commit325a69f9a8f688d318dde26774990a2bd79024c6 (patch)
tree7de99dc1e1d3c5ebaacfb83ddf6b14fd710f4806 /org.eclipse.mylyn.tasks.ui
parente6167f6fbfdfd2424dbaed4aa473dd4545d14933 (diff)
downloadorg.eclipse.mylyn.tasks-325a69f9a8f688d318dde26774990a2bd79024c6.tar.gz
org.eclipse.mylyn.tasks-325a69f9a8f688d318dde26774990a2bd79024c6.tar.xz
org.eclipse.mylyn.tasks-325a69f9a8f688d318dde26774990a2bd79024c6.zip
ASSIGNED - bug 331626: [api] attribute editors should have a tooltip
https://bugs.eclipse.org/bugs/show_bug.cgi?id=331626
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor.java1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LongTextAttributeEditor.java1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/MultiSelectionAttributeEditor.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PriorityAttributeEditor.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextAttributeEditor.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor.java1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TextAttributeEditor.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java14
11 files changed, 33 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor.java
index bdebff83f..741a430d2 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor.java
@@ -46,6 +46,7 @@ public class BooleanAttributeEditor extends AbstractAttributeEditor {
}
}
});
+ button.setToolTipText(getDescription());
refresh();
setControl(button);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor.java
index 911ec9ea5..13039e301 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CheckboxMultiSelectAttributeEditor.java
@@ -69,6 +69,7 @@ public class CheckboxMultiSelectAttributeEditor extends AbstractAttributeEditor
valueText.setFont(EditorUtil.TEXT_FONT);
toolkit.adapt(valueText, false, false);
valueText.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
+ valueText.setToolTipText(getDescription());
updateText();
setControl(valueText);
} else {
@@ -89,6 +90,7 @@ public class CheckboxMultiSelectAttributeEditor extends AbstractAttributeEditor
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(valueText);
valueText.setFont(EditorUtil.TEXT_FONT);
valueText.setEditable(false);
+ valueText.setToolTipText(getDescription());
button = toolkit.createButton(composite, "", SWT.ARROW | SWT.DOWN); //$NON-NLS-1$
GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.TOP).applyTo(button);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java
index a2e6e02c4..5ee8388fd 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java
@@ -54,10 +54,12 @@ public class DateAttributeEditor extends AbstractAttributeEditor {
toolkit.adapt(text, false, false);
text.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
text.setText(getTextValue());
+ text.setToolTipText(getDescription());
setControl(text);
} else {
datePicker = new DatePicker(composite, SWT.FLAT, getTextValue(), showTime, 0);
datePicker.setFont(EditorUtil.TEXT_FONT);
+ datePicker.setToolTipText(getDescription());
if (!showTime) {
datePicker.setDateFormat(EditorUtil.getDateFormat());
} else {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LongTextAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LongTextAttributeEditor.java
index 25779349c..7d46a3521 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LongTextAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LongTextAttributeEditor.java
@@ -51,6 +51,7 @@ public class LongTextAttributeEditor extends AbstractAttributeEditor {
viewer.configure(configuration);
viewer.setDocument(new Document(getValue()));
final StyledText text = viewer.getTextWidget();
+ text.setToolTipText(getDescription());
toolkit.adapt(text, false, false);
// enable cut/copy/paste
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/MultiSelectionAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/MultiSelectionAttributeEditor.java
index 9e60bef95..28a3507f6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/MultiSelectionAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/MultiSelectionAttributeEditor.java
@@ -60,6 +60,7 @@ public class MultiSelectionAttributeEditor extends AbstractAttributeEditor {
toolkit.adapt(text, false, false);
text.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
select(getValues(), getValuesLabels());
+ text.setToolTipText(getDescription());
setControl(text);
} else {
@@ -67,6 +68,7 @@ public class MultiSelectionAttributeEditor extends AbstractAttributeEditor {
toolkit.adapt(list, false, false);
list.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
list.setFont(EditorUtil.TEXT_FONT);
+ list.setToolTipText(getDescription());
Map<String, String> labelByValue = getAttributeMapper().getOptions(getTaskAttribute());
if (labelByValue != null) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PriorityAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PriorityAttributeEditor.java
index 98fa005e2..1ca6eaf28 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PriorityAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PriorityAttributeEditor.java
@@ -98,7 +98,11 @@ public class PriorityAttributeEditor extends AbstractAttributeEditor {
private void updateEditor() {
editor.select(getValue(), mapping.getPriorityLevel());
- editor.setToolTipText(getValueLabel());
+ String toolTip = getValueLabel();
+ if (toolTip != null && !toolTip.equals("")) {
+ toolTip = getDescription();
+ }
+ editor.setToolTipText(toolTip);
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextAttributeEditor.java
index 75e5b0162..0e7aee07c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextAttributeEditor.java
@@ -74,6 +74,8 @@ public class RichTextAttributeEditor extends AbstractAttributeEditor {
@Override
public void createControl(Composite parent, FormToolkit toolkit) {
editor.createControl(parent, toolkit);
+ editor.getViewer().getTextWidget().setToolTipText(getDescription());
+
setControl(editor.getControl());
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor.java
index 0a893ac0b..6807d04d9 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor.java
@@ -216,7 +216,6 @@ public class RichTextEditor {
toolkit.adapt(viewer.getControl(), false, false);
}
EditorUtil.addScrollListener(viewer.getTextWidget());
-
return viewer;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java
index 4ff4c67d1..c407929f2 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java
@@ -62,6 +62,7 @@ public class SingleSelectionAttributeEditor extends AbstractAttributeEditor {
text.setFont(EditorUtil.TEXT_FONT);
toolkit.adapt(text, false, false);
text.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
+ text.setToolTipText(getDescription());
setControl(text);
} else {
combo = new CCombo(parent, SWT.FLAT | SWT.READ_ONLY);
@@ -69,6 +70,7 @@ public class SingleSelectionAttributeEditor extends AbstractAttributeEditor {
toolkit.adapt(combo, false, false);
combo.setFont(EditorUtil.TEXT_FONT);
combo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
+ combo.setToolTipText(getDescription());
combo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TextAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TextAttributeEditor.java
index cab82b199..8c28b637b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TextAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TextAttributeEditor.java
@@ -47,11 +47,13 @@ public class TextAttributeEditor extends AbstractAttributeEditor {
text = new Text(parent, SWT.FLAT | SWT.READ_ONLY);
text.setFont(EditorUtil.TEXT_FONT);
text.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
+ text.setToolTipText(getDescription());
text.setText(getValue());
} else {
text = toolkit.createText(parent, getValue(), SWT.FLAT);
text.setFont(EditorUtil.TEXT_FONT);
text.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
+ text.setToolTipText(getDescription());
text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
setValue(text.getText());
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java
index e1adc07ef..5db3538aa 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java
@@ -43,6 +43,8 @@ public abstract class AbstractAttributeEditor {
private boolean readOnly;
+ private String description;
+
/**
* @since 3.0
*/
@@ -53,6 +55,7 @@ public abstract class AbstractAttributeEditor {
this.taskAttribute = taskAttribute;
setDecorationEnabled(true);
setReadOnly(taskAttribute.getMetaData().isReadOnly());
+ setDescription(taskAttribute.getMetaData().getValue(TaskAttribute.META_DESCRIPTION));
}
/**
@@ -229,4 +232,15 @@ public abstract class AbstractAttributeEditor {
throw new UnsupportedOperationException();
}
+ /**
+ * @since 3.5
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ private void setDescription(String description) {
+ this.description = description;
+ }
+
}

Back to the top