Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-04-17 12:35:49 +0000
committerTobias Schwarz2013-04-17 12:37:21 +0000
commita5134198af3763948343bf4b394f80c428da386f (patch)
tree9463e50ae54642f025c895e7cddac7f4a098428c /target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper
parentc311eab9167b0f11561c654b7f03832125596b69 (diff)
downloadorg.eclipse.tcf-a5134198af3763948343bf4b394f80c428da386f.tar.gz
org.eclipse.tcf-a5134198af3763948343bf4b394f80c428da386f.tar.xz
org.eclipse.tcf-a5134198af3763948343bf4b394f80c428da386f.zip
Target Explorer: add step group for simulator launch, add wait step
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.properties34
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.xml8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/WaitStep.java72
3 files changed, 98 insertions, 16 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.properties
index f496bb73d..6408b6f8b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.properties
@@ -1,16 +1,18 @@
-##################################################################################
-# Copyright (c) 2011, 2012 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Wind River Systems - initial API and implementation
-##################################################################################
-
-pluginName = Target Explorer, Stepper plug-in
-providerName = Eclipse.org - Target Explorer
-
-Extension.Steppers.name=Steppers
-Extension.Steps.name=Steps
-Extension.StepGroups.name=Step Groups
+##################################################################################
+# Copyright (c) 2011, 2012 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Target Explorer, Stepper plug-in
+providerName = Eclipse.org - Target Explorer
+
+Extension.Steppers.name=Steppers
+Extension.Steps.name=Steps
+Extension.StepGroups.name=Step Groups
+
+WaitStep.name=Waiting... \ No newline at end of file
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.xml
index 5293e8f5b..ba35e8363 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.xml
@@ -17,4 +17,12 @@
</propertyTester>
</extension>
+<!-- Launch Step contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.stepper.steps">
+ <step
+ id="org.eclipse.tcf.te.runtime.stepper.waitStep"
+ class="org.eclipse.tcf.te.runtime.stepper.steps.WaitStep"
+ label="%WaitStep.name"/>
+ </extension>
+
</plugin>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/WaitStep.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/WaitStep.java
new file mode 100644
index 000000000..94a321cd5
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/WaitStep.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tcf.te.runtime.stepper.steps;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
+import org.eclipse.tcf.te.runtime.interfaces.IConditionTester;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+
+/**
+ * Step to wait some time.
+ * The timeout is 1000ms per default.
+ * A specific timeout can be set through parameter "timeout" for a step group reference.
+ */
+public class WaitStep extends AbstractStep {
+
+ /**
+ * Constructor.
+ */
+ public WaitStep() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void execute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor, ICallback callback) {
+ long timeout = 1000;
+ if (getParameters() != null) {
+ String value = getParameters().get("timeout"); //$NON-NLS-1$
+ if (value != null) {
+ try {
+ timeout = Long.parseLong(value);
+ }
+ catch (Exception e) {
+ }
+ }
+ }
+
+ ExecutorsUtil.waitAndExecute(timeout, new IConditionTester() {
+ @Override
+ public boolean isConditionFulfilled() {
+ return monitor.isCanceled();
+ }
+
+ @Override
+ public void cleanup() {
+ }
+ });
+ callback.done(this, monitor.isCanceled() ? Status.CANCEL_STATUS : Status.OK_STATUS);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ }
+}

Back to the top