Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2011-11-15 06:09:58 -0500
committerUwe Stieber2011-11-15 06:09:58 -0500
commit82f6c7e60522d1bcfeb628881d7ece2016e15871 (patch)
tree4deae57dbe47c93a57ff787d13ded998aced5525
parent9aed07ada74e508d7705cd249fa75a06bce10143 (diff)
downloadorg.eclipse.tcf-82f6c7e60522d1bcfeb628881d7ece2016e15871.tar.gz
org.eclipse.tcf-82f6c7e60522d1bcfeb628881d7ece2016e15871.tar.xz
org.eclipse.tcf-82f6c7e60522d1bcfeb628881d7ece2016e15871.zip
Target Explorer: Allow status handler callback to be "null" and avoid default status handler overwrite by tests plug-in
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.statushandler/src/org/eclipse/tm/te/runtime/statushandler/interfaces/IStatusHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.tests/plugin.xml3
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui/src/org/eclipse/tm/te/ui/statushandler/DefaultStatusHandler.java7
3 files changed, 9 insertions, 3 deletions
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.statushandler/src/org/eclipse/tm/te/runtime/statushandler/interfaces/IStatusHandler.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.statushandler/src/org/eclipse/tm/te/runtime/statushandler/interfaces/IStatusHandler.java
index 6b324c316..50f0c172f 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.statushandler/src/org/eclipse/tm/te/runtime/statushandler/interfaces/IStatusHandler.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.statushandler/src/org/eclipse/tm/te/runtime/statushandler/interfaces/IStatusHandler.java
@@ -27,7 +27,7 @@ public interface IStatusHandler extends IExecutableExtension {
*
* @param status The status. Must not be <code>null</code>.
* @param data The custom status data object, or <code>null</code> if none.
- * @param done The callback. Must not be <code>null</code>.
+ * @param done The callback, or <code>null</code>.
*/
public void handleStatus(IStatus status, IPropertiesContainer data, DoneHandleStatus done);
diff --git a/target_explorer/plugins/org.eclipse.tm.te.tests/plugin.xml b/target_explorer/plugins/org.eclipse.tm.te.tests/plugin.xml
index 28d9e9da1..f63004576 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.tests/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tm.te.tests/plugin.xml
@@ -19,6 +19,9 @@
<binding
handlerId="org.eclipse.tm.te.tests.handler1"
id="org.eclipse.tm.te.tests.binding1">
+ <enablement>
+ <instanceof value="org.eclipse.tm.te.tests.CoreTestCase"/>
+ </enablement>
</binding>
<binding
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui/src/org/eclipse/tm/te/ui/statushandler/DefaultStatusHandler.java b/target_explorer/plugins/org.eclipse.tm.te.ui/src/org/eclipse/tm/te/ui/statushandler/DefaultStatusHandler.java
index 73ab6dee4..c87c62037 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.ui/src/org/eclipse/tm/te/ui/statushandler/DefaultStatusHandler.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui/src/org/eclipse/tm/te/ui/statushandler/DefaultStatusHandler.java
@@ -44,7 +44,6 @@ public class DefaultStatusHandler extends AbstractStatusHandler {
@Override
public void handleStatus(final IStatus status, final IPropertiesContainer data, final DoneHandleStatus done) {
Assert.isNotNull(status);
- Assert.isNotNull(done);
// If the platform UI is not longer running or the display does not
// exist or is disposed already, don't do anything.
@@ -63,7 +62,11 @@ public class DefaultStatusHandler extends AbstractStatusHandler {
display.asyncExec(new Runnable() {
@Override
public void run() {
- doHandleStatus(status, data, done);
+ doHandleStatus(status, data, done != null ? done : new DoneHandleStatus() {
+ @Override
+ public void doneHandleStatus(Throwable error, IPropertiesContainer data) {
+ }
+ });
}
});
}

Back to the top