aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Rolka2014-11-28 06:50:49 -0500
committerDaniel Rolka2014-11-28 07:12:21 -0500
commite9159952c7f1ad32201c60f59407ff1116892e76 (patch)
treef2148eec6fd69405afcfd7d4b0b075a8bc312d82
parentfc07a9c308a6c4d2e7ec2e2c2dbaa521dd8bfcc5 (diff)
downloadeclipse.platform.ui-e9159952c7f1ad32201c60f59407ff1116892e76.zip
eclipse.platform.ui-e9159952c7f1ad32201c60f59407ff1116892e76.tar.gz
eclipse.platform.ui-e9159952c7f1ad32201c60f59407ff1116892e76.tar.xz
Bug 440294 - [Progress] ProgressAnimationItem toolbar button selection
opens ProgressView It is back port of the bug 335543. The author of the original patch is Srimathi <meetmathi@gmail.com> Change-Id: Iabb3957069ce2189c295b2bae2544b3c56753b64 Signed-off-by: Daniel Rolka <daniel.rolka@pl.ibm.com>
-rw-r--r--bundles/org.eclipse.e4.ui.progress/src/org/eclipse/e4/ui/progress/internal/ProgressAnimationItem.java17
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java14
2 files changed, 24 insertions, 7 deletions
diff --git a/bundles/org.eclipse.e4.ui.progress/src/org/eclipse/e4/ui/progress/internal/ProgressAnimationItem.java b/bundles/org.eclipse.e4.ui.progress/src/org/eclipse/e4/ui/progress/internal/ProgressAnimationItem.java
index 76cbd26..ff0d01f 100644
--- a/bundles/org.eclipse.e4.ui.progress/src/org/eclipse/e4/ui/progress/internal/ProgressAnimationItem.java
+++ b/bundles/org.eclipse.e4.ui.progress/src/org/eclipse/e4/ui/progress/internal/ProgressAnimationItem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2014 IBM Corporation and others.
* 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
@@ -113,8 +113,13 @@ public class ProgressAnimationItem extends AnimationItem implements
StatusReporter.SHOW, new Object[0]);
removeTopElement(ji);
}
-
- execute(ji, job);
+
+ // To fix a bug (335543) introduced in 3.6.1.
+ // doAction() should return if progress region button was
+ // selected to open a job result action or command.
+ if (execute(ji, job)) {
+ return;
+ }
}
}
}
@@ -126,14 +131,16 @@ public class ProgressAnimationItem extends AnimationItem implements
/**
* @param ji
* @param job
+ * @return <code>true</code> if Action or Command is executed
*/
- private void execute(JobInfo ji, Job job) {
+ private boolean execute(JobInfo ji, Job job) {
Object prop = job.getProperty(IProgressConstants.ACTION_PROPERTY);
if (prop instanceof IAction && ((IAction) prop).isEnabled()) {
IAction action = (IAction) prop;
action.run();
removeTopElement(ji);
+ return true;
}
prop = job.getProperty(IProgressConstants.COMMAND_PROPERTY);
@@ -141,7 +148,9 @@ public class ProgressAnimationItem extends AnimationItem implements
ParameterizedCommand command = (ParameterizedCommand) prop;
getEHandlerService().executeHandler(command);
removeTopElement(ji);
+ return true;
}
+ return false;
}
/**
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
index 2c0202c..fb2802c 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
@@ -123,7 +123,12 @@ public class ProgressAnimationItem extends AnimationItem implements
removeTopElement(ji);
}
- execute(ji, job);
+ // To fix a bug (335543) introduced in 3.6.1.
+ // doAction() should return if progress region button was
+ // selected to open a job result action or command.
+ if (execute(ji, job)) {
+ return;
+ }
}
}
}
@@ -135,14 +140,16 @@ public class ProgressAnimationItem extends AnimationItem implements
/**
* @param ji
* @param job
+ * @return <code>true</code> if Action or Command is executed
*/
- private void execute(JobInfo ji, Job job) {
+ private boolean execute(JobInfo ji, Job job) {
Object prop = job.getProperty(IProgressConstants.ACTION_PROPERTY);
if (prop instanceof IAction && ((IAction) prop).isEnabled()) {
IAction action = (IAction) prop;
action.run();
removeTopElement(ji);
+ return true;
}
prop = job.getProperty(IProgressConstants2.COMMAND_PROPERTY);
@@ -171,8 +178,9 @@ public class ProgressAnimationItem extends AnimationItem implements
StatusManager.getManager().handle(status,
StatusManager.LOG | StatusManager.SHOW);
}
-
+ return true;
}
+ return false;
}
/**