Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2011-01-26 07:08:47 +0000
committerspingel2011-01-26 07:08:47 +0000
commit8d5cd5dd71fa6f8706fd7b43f432a083afe46f47 (patch)
tree0469830c4bc1b677a8aedfad6a36cd0826f72022 /org.eclipse.mylyn.tasks.ui
parent93c71d16f166a223b1edb150e2ef01d4cf1c0bec (diff)
downloadorg.eclipse.mylyn.tasks-8d5cd5dd71fa6f8706fd7b43f432a083afe46f47.tar.gz
org.eclipse.mylyn.tasks-8d5cd5dd71fa6f8706fd7b43f432a083afe46f47.tar.xz
org.eclipse.mylyn.tasks-8d5cd5dd71fa6f8706fd7b43f432a083afe46f47.zip
NEW - bug 334721: determine the task for which an AttributeEditor control is used
https://bugs.eclipse.org/bugs/show_bug.cgi?id=334721
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java14
1 files changed, 14 insertions, 0 deletions
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 6ad9352ea..e664819c3 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
@@ -29,6 +29,17 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
*/
public abstract class AbstractAttributeEditor {
+ /**
+ * The key used to associate the editor control with the corresponding task attribute. This enables lookup of the
+ * model element from the widget hierarchy.
+ *
+ * @since 3.5
+ * @see Control#getData(String)
+ * @see #getControl()
+ * @see #getTaskAttribute()
+ */
+ public static final String KEY_TASK_ATTRIBUTE = "org.eclipse.mylyn.tasks.ui.editors.TaskAttribute"; //$NON-NLS-1$
+
private Control control;
private boolean decorationEnabled;
@@ -156,6 +167,9 @@ public abstract class AbstractAttributeEditor {
*/
protected void setControl(Control control) {
this.control = control;
+ if (control != null) {
+ control.setData(KEY_TASK_ATTRIBUTE, taskAttribute);
+ }
}
/**

Back to the top