summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-26 13:41:28 (EDT)
committer Kevin Sawicki2011-04-26 13:41:28 (EDT)
commit91bb50cd7e03f682e5e3c8e5218da905724cca0c (patch)
tree159feddb5999cf0662999aee1de0d03562ee5c8e
parent8bc31dd0b52578b4739dd56451b8a6ba8dfcbfd3 (diff)
downloadegit-github-91bb50cd7e03f682e5e3c8e5218da905724cca0c.zip
egit-github-91bb50cd7e03f682e5e3c8e5218da905724cca0c.tar.gz
egit-github-91bb50cd7e03f682e5e3c8e5218da905724cca0c.tar.bz2
Remove attach context button from action part.refs/changes/60/3260/1
Gists do not support binary attachments. Change-Id: I8eb639e193a86d41b1a5b2095e3c3e7b4caaf6d8 Signed-off-by: Kevin Sawicki <kevin@github.com>
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java
index 42aef5e..3d88a4d 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java
@@ -15,10 +15,13 @@ import java.util.Set;
import org.eclipse.mylyn.github.ui.internal.IssueSummaryPart;
import org.eclipse.mylyn.internal.github.core.gist.GistAttribute;
+import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorActionPart;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorPartDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* Gist task editor page class
@@ -47,7 +50,8 @@ public class GistTaskEditorPage extends AbstractTaskEditorPage {
TaskEditorPartDescriptor partDescriptor = descriptorIt.next();
String id = partDescriptor.getId();
if (id.equals(ID_PART_ATTRIBUTES) || id.equals(ID_PART_SUMMARY)
- || id.equals(ID_PART_ATTACHMENTS))
+ || id.equals(ID_PART_ATTACHMENTS)
+ || id.equals(ID_PART_ACTIONS))
descriptorIt.remove();
}
if (!getModel().getTaskData().isNew()) {
@@ -66,6 +70,20 @@ public class GistTaskEditorPage extends AbstractTaskEditorPage {
}
}.setPath(PATH_ATTACHMENTS));
}
+ partDescriptors.add(new TaskEditorPartDescriptor(ID_PART_ACTIONS) {
+
+ public AbstractTaskEditorPart createPart() {
+ return new TaskEditorActionPart() {
+
+ protected void addAttachContextButton(
+ Composite buttonComposite, FormToolkit toolkit) {
+ // Prohibit context button since Gists don't support
+ // binary attachments
+ }
+
+ };
+ }
+ }.setPath(PATH_ACTIONS));
return partDescriptors;
}