summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2013-07-05 07:34:53 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-07-12 05:37:50 (EDT)
commit2f0e8608f6a5cb97515905d030e040d865676544 (patch)
tree3e480d0019ce2a1c60072c9a1c73da8dacdb5dda
parent2a308fa2699dcc362a7f9a3eb2915357a31ab2af (diff)
downloadorg.eclipse.mylyn.tasks-2f0e8608f6a5cb97515905d030e040d865676544.zip
org.eclipse.mylyn.tasks-2f0e8608f6a5cb97515905d030e040d865676544.tar.gz
org.eclipse.mylyn.tasks-2f0e8608f6a5cb97515905d030e040d865676544.tar.bz2
412394: [api] provide editor as context when obtaining label and imagerefs/changes/15/14315/3
from task editor page factory Change-Id: I5eba949deec9ca4ed31934103b2d12cfe0add2e0 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=412394
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPageFactory.java30
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java4
2 files changed, 32 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPageFactory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPageFactory.java
index 081e3c7..026632c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPageFactory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPageFactory.java
@@ -85,4 +85,34 @@ public abstract class AbstractTaskEditorPageFactory implements IPluginContributi
this.pluginId = pluginId;
}
+ /**
+ * Clients should override to provide an image for <code>page</code>. Invokes {@link #getPageImage()} for backwards
+ * compatibility.
+ *
+ * @param editor
+ * the task editor instance
+ * @param page
+ * the page that uses the image
+ * @return an image
+ * @since 3.10
+ */
+ public Image getPageImage(TaskEditor editor, IFormPage page) {
+ return getPageImage();
+ }
+
+ /**
+ * Clients should override to provide a label for <code>page</code>. Invokes {@link #getPageText()} for backwards
+ * compatibility.
+ *
+ * @param editor
+ * the task editor instance
+ * @param page
+ * the page that uses the label
+ * @return a label
+ * @since 3.10
+ */
+ public String getPageText(TaskEditor editor, IFormPage page) {
+ return getPageText();
+ }
+
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
index daf2998..cd9113a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
@@ -408,8 +408,8 @@ public class TaskEditor extends SharedHeaderFormEditor {
try {
IFormPage page = factory.createPage(this);
int index = addPage(page);
- setPageImage(index, factory.getPageImage());
- setPageText(index, factory.getPageText());
+ setPageImage(index, factory.getPageImage(this, page));
+ setPageText(index, factory.getPageText(this, page));
if (factory.getPriority() == AbstractTaskEditorPageFactory.PRIORITY_TASK) {
setActivePage(index);
}