Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Dong2016-07-07 23:12:49 +0000
committerMatthias Sohn2016-09-13 21:45:06 +0000
commit219458f33d8a4d97cfdc4e7f635cbc08eaa83c71 (patch)
treeda7ff2c4cee43381ef9f649b2fc94a2c52ff1309 /org.eclipse.egit.mylyn.ui/src/org
parent435f10cb1e2679c1d47764f294fd2fc07f8a9fac (diff)
downloadegit-219458f33d8a4d97cfdc4e7f635cbc08eaa83c71.tar.gz
egit-219458f33d8a4d97cfdc4e7f635cbc08eaa83c71.tar.xz
egit-219458f33d8a4d97cfdc4e7f635cbc08eaa83c71.zip
Reset commit message in staging view when new task is activated
Bug: 472716 Change-Id: I8c82e078f81078cae5ab14424f4d86e55847dec9 Signed-off-by: Brandon Dong <brandon.dong@tasktop.com>
Diffstat (limited to 'org.eclipse.egit.mylyn.ui/src/org')
-rw-r--r--org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/CommitTextTaskActivationListener.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/CommitTextTaskActivationListener.java b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/CommitTextTaskActivationListener.java
new file mode 100644
index 0000000000..acaee890aa
--- /dev/null
+++ b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/CommitTextTaskActivationListener.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Brandon Dong <brandon.dong@tasktop.com>
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.internal.mylyn.ui.commit;
+
+import org.eclipse.egit.ui.internal.staging.StagingView;
+import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.TaskActivationAdapter;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * A listener that updates commit text in staging view when a task is activated
+ */
+public class CommitTextTaskActivationListener extends TaskActivationAdapter {
+
+ @Override
+ public void taskActivated(ITask task) {
+ StagingView view = (StagingView) PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage()
+ .findView(StagingView.VIEW_ID);
+ if (view != null) {
+ view.resetCommitMessageComponent();
+ }
+ }
+
+}

Back to the top