Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2011-05-30 21:59:24 +0000
committerspingel2011-05-30 21:59:24 +0000
commitc83035d233456ed3d8592b5650695f17e66609b0 (patch)
tree80be7bc6696ba15ffceed36b4b77915ee27debaa /org.eclipse.mylyn.tasks.ui
parent5e0847972d60c54c151573cf998cfc86f20ea9ca (diff)
downloadorg.eclipse.mylyn.tasks-c83035d233456ed3d8592b5650695f17e66609b0.tar.gz
org.eclipse.mylyn.tasks-c83035d233456ed3d8592b5650695f17e66609b0.tar.xz
org.eclipse.mylyn.tasks-c83035d233456ed3d8592b5650695f17e66609b0.zip
NEW - bug 345826: show Gravatar images in task editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=345826
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionSettingsContribution.java27
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensions.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorSummaryPart.java26
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties2
5 files changed, 49 insertions, 12 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java
index 88619558c..56bc96677 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java
@@ -271,10 +271,14 @@ public class Messages extends NLS {
public static String TaskEditorExtensionSettingsContribution__default_;
+ public static String TaskEditorExtensionSettingsContribution_Avatar_Button_Label;
+
public static String TaskEditorExtensionSettingsContribution_Editor;
public static String TaskEditorExtensionSettingsContribution_Plain_Text;
+ public static String TaskEditorExtensionSettingsContribution_Rendering_Group_Label;
+
public static String TaskEditorExtensionSettingsContribution_Select_the_capabilities_of_the_task_editor;
public static String TaskHyperlinkPresenter_Not_In_Task_List;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionSettingsContribution.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionSettingsContribution.java
index 35aca42b9..6626c4da4 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionSettingsContribution.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionSettingsContribution.java
@@ -14,6 +14,7 @@ package org.eclipse.mylyn.internal.tasks.ui.editors;
import java.util.SortedSet;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.mylyn.internal.provisional.commons.ui.WorkbenchUtil;
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorExtensions.RegisteredTaskEditorExtension;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -26,6 +27,7 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Widget;
/**
@@ -51,6 +53,8 @@ public class TaskEditorExtensionSettingsContribution extends AbstractTaskReposit
private String selectedExtensionId;
+ private Button avatarSupportButton;
+
public TaskEditorExtensionSettingsContribution() {
super(Messages.TaskEditorExtensionSettingsContribution_Editor,
Messages.TaskEditorExtensionSettingsContribution_Select_the_capabilities_of_the_task_editor);
@@ -60,6 +64,8 @@ public class TaskEditorExtensionSettingsContribution extends AbstractTaskReposit
public void applyTo(TaskRepository repository) {
TaskEditorExtensions.setTaskEditorExtensionId(repository, selectedExtensionId == null ? "none" //$NON-NLS-1$
: selectedExtensionId);
+ repository.setProperty(TaskEditorExtensions.REPOSITORY_PROPERTY_AVATAR_SUPPORT,
+ Boolean.toString(avatarSupportButton.getSelection()));
}
@Override
@@ -79,6 +85,26 @@ public class TaskEditorExtensionSettingsContribution extends AbstractTaskReposit
layout.marginWidth = 0;
parent.setLayout(layout);
+ createGravatarControl(parent);
+
+ Group group = new Group(parent, SWT.BORDER);
+ group.setText(Messages.TaskEditorExtensionSettingsContribution_Rendering_Group_Label);
+ group.setLayout(new GridLayout(1, true));
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
+ createTaskEditorExtensionsControl(group);
+
+ return parent;
+ }
+
+ private void createGravatarControl(Composite parent) {
+ avatarSupportButton = new Button(parent, SWT.CHECK);
+ avatarSupportButton.setText(Messages.TaskEditorExtensionSettingsContribution_Avatar_Button_Label);
+ avatarSupportButton.setSelection(getRepository() != null
+ && Boolean.parseBoolean(getRepository().getProperty(
+ TaskEditorExtensions.REPOSITORY_PROPERTY_AVATAR_SUPPORT)));
+ }
+
+ private void createTaskEditorExtensionsControl(Composite parent) {
String defaultExtensionId = TaskEditorExtensions.getDefaultTaskEditorExtensionId(getConnectorKind());
selectedExtensionId = getRepository() == null
? defaultExtensionId
@@ -120,7 +146,6 @@ public class TaskEditorExtensionSettingsContribution extends AbstractTaskReposit
if (!foundSelection) {
noneButton.setSelection(true);
}
- return parent;
}
@Override
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensions.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensions.java
index 54171ebb1..5b2c06db3 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensions.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensions.java
@@ -33,6 +33,8 @@ public class TaskEditorExtensions {
public static final String REPOSITORY_PROPERTY_EDITOR_EXTENSION = "editorExtension"; //$NON-NLS-1$
+ public static final String REPOSITORY_PROPERTY_AVATAR_SUPPORT = "avatarSupport"; //$NON-NLS-1$
+
private static Map<String, RegisteredTaskEditorExtension> extensionsById = new HashMap<String, RegisteredTaskEditorExtension>();
private static Map<String, String> associationByConnectorKind = new HashMap<String, String>();
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorSummaryPart.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorSummaryPart.java
index c91237e85..44567d4a1 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorSummaryPart.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorSummaryPart.java
@@ -187,17 +187,21 @@ public class TaskEditorSummaryPart extends AbstractTaskEditorPart {
addSummaryText(composite, toolkit);
- TaskAttribute userAssignedAttribute = getTaskData().getRoot().getMappedAttribute(TaskAttribute.USER_ASSIGNED);
- if (userAssignedAttribute != null) {
- UserAttributeEditor editor = new UserAttributeEditor(getModel(), userAssignedAttribute);
- editor.createControl(composite, toolkit);
- GridDataFactory.fillDefaults()
- .align(SWT.CENTER, SWT.CENTER)
- .span(1, 2)
- .indent(0, 1)
- .applyTo(editor.getControl());
- layout.marginRight = 1;
- layout.numColumns++;
+ if (Boolean.parseBoolean(getModel().getTaskRepository().getProperty(
+ TaskEditorExtensions.REPOSITORY_PROPERTY_AVATAR_SUPPORT))) {
+ TaskAttribute userAssignedAttribute = getTaskData().getRoot().getMappedAttribute(
+ TaskAttribute.USER_ASSIGNED);
+ if (userAssignedAttribute != null) {
+ UserAttributeEditor editor = new UserAttributeEditor(getModel(), userAssignedAttribute);
+ editor.createControl(composite, toolkit);
+ GridDataFactory.fillDefaults()
+ .align(SWT.CENTER, SWT.CENTER)
+ .span(1, 2)
+ .indent(0, 2)
+ .applyTo(editor.getControl());
+ layout.marginRight = 1;
+ layout.numColumns++;
+ }
}
if (needsHeader()) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties
index 91ba7f3f1..b5f6db24f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties
@@ -151,8 +151,10 @@ TaskEditor_Task=Task
TaskEditor_Task_added_to_the_Uncategorized_container=Task added to the Uncategorized container
TaskEditorExtensionSettingsContribution__default_=\ (default)
+TaskEditorExtensionSettingsContribution_Avatar_Button_Label=Show avatar images
TaskEditorExtensionSettingsContribution_Editor=Task Editor Settings
TaskEditorExtensionSettingsContribution_Plain_Text=Plain Text
+TaskEditorExtensionSettingsContribution_Rendering_Group_Label=Description and Comments
TaskEditorExtensionSettingsContribution_Select_the_capabilities_of_the_task_editor=Select the capabilities of the task editor
TaskHyperlinkPresenter_Not_In_Task_List=Open {0} from Repository
TaskUrlHyperlink_Open_URL_in_Task_Editor=Open ''{0}'' in Task Editor

Back to the top