Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-06-17 07:18:25 +0000
committerUwe Stieber2013-06-17 07:21:09 +0000
commitb35168239d3af6396d97dd8a994083a8e6b5b8ea (patch)
tree0f300d701c72892518db5b34dae76980cb9f9aa3
parentd94176819583c52c9cc02ced1ec1d83971809952 (diff)
downloadorg.eclipse.tcf-b35168239d3af6396d97dd8a994083a8e6b5b8ea.tar.gz
org.eclipse.tcf-b35168239d3af6396d97dd8a994083a8e6b5b8ea.tar.xz
org.eclipse.tcf-b35168239d3af6396d97dd8a994083a8e6b5b8ea.zip
Target Explorer: Process explorer terminate action not checking for "canTerminate" context property
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.xml2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/properties/PropertyTester.java16
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml9
3 files changed, 24 insertions, 3 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.xml
index f9fddd657..437f7d1b0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.xml
@@ -31,7 +31,7 @@
class="org.eclipse.tcf.te.tcf.processes.core.model.properties.PropertyTester"
id="org.eclipse.tcf.te.tcf.processes.core.model.properties"
namespace="org.eclipse.tcf.te.tcf.processes.core"
- properties="isAttached,canAttach,hasProcessContext"
+ properties="isAttached,canAttach,hasProcessContext,canTerminate"
type="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode">
</propertyTester>
</extension>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/properties/PropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/properties/PropertyTester.java
index 1419b2367..cebb0b3a3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/properties/PropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/properties/PropertyTester.java
@@ -76,6 +76,22 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
return ((Boolean) expectedValue).booleanValue() == canAttach.get();
}
+
+ if ("canTerminate".equals(property) && expectedValue instanceof Boolean) { //$NON-NLS-1$
+ final AtomicBoolean canTerminate = new AtomicBoolean();
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ if (node.getProcessContext() != null) {
+ canTerminate.set(node.getProcessContext().canTerminate());
+ }
+ }
+ };
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
+
+ return ((Boolean) expectedValue).booleanValue() == canTerminate.get();
+ }
}
return false;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml
index e7212d7e3..b619957a0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml
@@ -460,13 +460,14 @@
<adapt type="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode">
<and>
<test property="org.eclipse.tcf.te.tcf.processes.core.hasProcessContext" value="true"/>
- <test property="org.eclipse.tcf.te.tcf.processes.ui.model.isAttached" value="true"/>
+ <test property="org.eclipse.tcf.te.tcf.processes.core.isAttached" value="true"/>
</and>
</adapt>
</iterate>
</with>
</enabledWhen>
</handler>
+
<handler
class="org.eclipse.tcf.te.tcf.processes.ui.handler.TerminateHandler"
commandId="org.eclipse.tcf.te.launch.command.terminate">
@@ -481,8 +482,12 @@
<enabledWhen>
<with variable="selection">
<count value="+"/>
- <iterate ifEmpty="false" operator="and">
+ <iterate operator="and" ifEmpty="false">
<adapt type="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode">
+ <and>
+ <test property="org.eclipse.tcf.te.tcf.processes.core.hasProcessContext" value="true"/>
+ <test property="org.eclipse.tcf.te.tcf.processes.core.canTerminate" value="true"/>
+ </and>
</adapt>
</iterate>
</with>

Back to the top