Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-11-13 05:05:18 -0500
committerTobias Schwarz2013-11-13 05:05:18 -0500
commit71abe42ca44e58d7f66199616c595d92f7af8b62 (patch)
tree25e41b37b2f42995c229a8f736126f5e800d3c6e
parent4313cc49535842db38c1f8d116355c2ea0a58887 (diff)
downloadorg.eclipse.tcf-71abe42ca44e58d7f66199616c595d92f7af8b62.tar.gz
org.eclipse.tcf-71abe42ca44e58d7f66199616c595d92f7af8b62.tar.xz
org.eclipse.tcf-71abe42ca44e58d7f66199616c595d92f7af8b62.zip
Target Explorer: fix possible npe, add stepper service for scheduling
rule handling, add job canceling step
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core/META-INF/MANIFEST.MF1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/history/HistoryManager.java20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.properties2
-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/context/AbstractStepContext.java132
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java62
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepContext.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperOperationService.java84
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperService.java65
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java50
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/AbstractStepperJobSchedulingRule.java68
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/StepperJob.java106
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/services/AbstractStepperOperationService.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/services/AbstractStepperService.java)10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/CancelJobsStep.java103
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/AsyncCallbackCollector.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java)3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/AsyncCallbackHandler.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackHandler.java)2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/async/CallbackInvocationDelegate.java64
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerModelStepContext.java134
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractStepperOperationService.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractStepperService.java)10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelRefreshService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java25
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessStreamsListener.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/RefreshProcessListHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsLauncher.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsStreamsListener.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/processes/model/ProcessModelTestCase.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/view/TerminalsViewMementoHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.xml161
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/async/UICallbackInvocationDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/AbstractSectionDialog.java11
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/CancelStepperCommandHandler.java103
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/StepperCommandHandler.java57
42 files changed, 789 insertions, 587 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.core/META-INF/MANIFEST.MF
index 9bd567896..fb871e034 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core/META-INF/MANIFEST.MF
@@ -17,7 +17,6 @@ Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.eclipse.tcf.te.core.activator;x-internal:=true,
org.eclipse.tcf.te.core.adapters,
- org.eclipse.tcf.te.core.async,
org.eclipse.tcf.te.core.interfaces,
org.eclipse.tcf.te.core.nls;x-internal:=true,
org.eclipse.tcf.te.core.nodes.interfaces.wire,
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/history/HistoryManager.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/history/HistoryManager.java
index 51021bde5..6703f6d09 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/history/HistoryManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/history/HistoryManager.java
@@ -86,16 +86,18 @@ public class HistoryManager {
* Write the history to disk.
*/
public void flush() {
- try {
- // Get the persistence service
- IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
- if (uRIPersistenceService == null) {
- throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
+ synchronized (history) {
+ try {
+ // Get the persistence service
+ IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
+ if (uRIPersistenceService == null) {
+ throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
+ }
+ // Save the history to the persistence storage
+ uRIPersistenceService.write(history, getURI());
+ } catch (IOException e) {
}
- // Save the history to the persistence storage
- uRIPersistenceService.write(history, getURI());
- } catch (IOException e) {
- }
+ }
}
/**
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 0807577fe..745419ca7 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
@@ -15,4 +15,4 @@ Extension.Steppers.name=Steppers
Extension.Steps.name=Steps
Extension.StepGroups.name=Step Groups
-WaitStep.name=Waiting... \ No newline at end of file
+CancelJobsStep.name=Cancel Jobs \ 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 18f4c1b32..82a642084 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>
+<!-- Step contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.stepper.steps">
+ <step id="org.eclipse.tcf.te.runtime.stepper.cancelJobsStep"
+ label="%CancelJobsStep.name"
+ class="org.eclipse.tcf.te.runtime.stepper.steps.CancelJobsStep">
+ </step>
+ </extension>
+
</plugin>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/context/AbstractStepContext.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/context/AbstractStepContext.java
index 7eace1a92..701a19222 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/context/AbstractStepContext.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/context/AbstractStepContext.java
@@ -1,66 +1,66 @@
-/*******************************************************************************
- * 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.context;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-
-/**
- * Abstract step context implementation.
- */
-public abstract class AbstractStepContext extends PlatformObject implements IStepContext {
-
- private final Object contextObject;
-
- /**
- * Constructor.
- *
- * @param contextObject The context object. Must not be <code>null</code>.
- */
- public AbstractStepContext(Object contextObject) {
- super();
- Assert.isNotNull(contextObject);
- this.contextObject = contextObject;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getSecondaryId()
- */
- @Override
- public String getSecondaryId() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getName()
- */
- @Override
- public String getName() {
- return getId();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getContextObject()
- */
- @Override
- public Object getContextObject() {
- return contextObject;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getInfo(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public String getInfo(IPropertiesContainer data) {
- return getName() + "(" + getId() + (getSecondaryId() != null ? ":" + getSecondaryId() : "") + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-}
+/*******************************************************************************
+ * 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.context;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+
+/**
+ * Abstract step context implementation.
+ */
+public abstract class AbstractStepContext extends PlatformObject implements IStepContext {
+
+ private final Object contextObject;
+
+ /**
+ * Constructor.
+ *
+ * @param contextObject The context object. Must not be <code>null</code>.
+ */
+ public AbstractStepContext(Object contextObject) {
+ super();
+ Assert.isNotNull(contextObject);
+ this.contextObject = contextObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getSecondaryId()
+ */
+ @Override
+ public String getSecondaryId() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getName()
+ */
+ @Override
+ public String getName() {
+ return getId();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getContextObject()
+ */
+ @Override
+ public Object getContextObject() {
+ return contextObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getInfo(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public String getInfo(IPropertiesContainer data) {
+ return getName() + "(" + getId() + (getSecondaryId() != null ? ":" + getSecondaryId() : "") + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java
index 95bb94f55..b94de8a91 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java
@@ -1,26 +1,36 @@
-/*******************************************************************************
- * 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.interfaces;
-
-/**
- * Defines common step data attribute id's.
- */
-public interface IStepAttributes {
-
- /**
- * Define the prefix used by all other attribute id's as prefix.
- */
- public static final String ATTR_PREFIX = "org.eclipse.tcf.te.runtime.stepper"; //$NON-NLS-1$
-
- /**
- * The active context the launch is operating with.
- */
- public static final String ATTR_ACTIVE_CONTEXT = ATTR_PREFIX + ".active_context"; //$NON-NLS-1$
-}
+/*******************************************************************************
+ * 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.interfaces;
+
+/**
+ * Defines common step data attribute id's.
+ */
+public interface IStepAttributes {
+
+ /**
+ * Define the prefix used by all other attribute id's as prefix.
+ */
+ public static final String ATTR_PREFIX = "org.eclipse.tcf.te.runtime.stepper"; //$NON-NLS-1$
+
+ /**
+ * The active context the launch is operating with.
+ */
+ public static final String ATTR_ACTIVE_CONTEXT = ATTR_PREFIX + ".active_context"; //$NON-NLS-1$
+
+ /**
+ * The running job.
+ */
+ public static final String ATTR_STEPPER_JOB = ATTR_PREFIX + ".stepper_job"; //$NON-NLS-1$
+
+ /**
+ * The running job operation.
+ */
+ public static final String ATTR_STEPPER_JOB_OPERATION = ATTR_PREFIX + ".stepper_job_operation"; //$NON-NLS-1$
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepContext.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepContext.java
index 287533ab2..a034d865f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepContext.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepContext.java
@@ -41,7 +41,7 @@ public interface IStepContext extends IAdaptable {
/**
* Returns the context object.
- *
+ *
* @return The context Object. Must not be <code>null</code>.
*/
public Object getContextObject();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperOperationService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperOperationService.java
new file mode 100644
index 000000000..2973fbdb6
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperOperationService.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * 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.interfaces;
+
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.services.interfaces.IService;
+
+/**
+ * Stepper operation service.
+ */
+public interface IStepperOperationService extends IService {
+
+ /**
+ * Checks if this service can handle the given operation.
+ * @param context The context. Must not be <code>null</code>.
+ * @param operation The operation. Must not be <code>null</code>.
+ * @return <code>true</code> if this service handles the given operation.
+ */
+ public boolean isHandledOperation(Object context, String operation);
+
+ /**
+ * Get the step group id for the given context and operation
+ * or <code>null</code> if this operation is not available.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param operation The operation. Must not be <code>null</code>.
+ * @return The step group id or <code>null</code>.
+ */
+ public String getStepGroupId(Object context, String operation);
+
+
+ /**
+ * Get the step group name for the given context and operation
+ * or <code>null</code> if this operation is not available.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param operation The operation. Must not be <code>null</code>.
+ * @return The step group name or <code>null</code>.
+ */
+ public String getStepGroupName(Object context, String operation);
+
+ /**
+ * Get the step context for the given context and operation
+ * or <code>null</code> if this operation is not available.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param operation The operation. Must not be <code>null</code>.
+ * @return The step context or <code>null</code>.
+ */
+ public IStepContext getStepContext(Object context, String operation);
+
+ /**
+ * Get the step data for the given context and operation.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param operation The operation. Must not be <code>null</code>.
+ * @return The step data or an empty properties container.
+ */
+ public IPropertiesContainer getStepData(Object context, String operation);
+
+ /**
+ * Get the enabled state for the given operation.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param operation The operation. Must not be <code>null</code>.
+ * @return <code>true</code> if the operation is enabled.
+ */
+ public boolean isEnabled(Object context, String operation);
+
+ /**
+ * Returns <code>true</code> if the given operation can be canceled.
+ * @param context The context. Must not be <code>null</code>.
+ * @param operation The operation. Must not be <code>null</code>.
+ * @return <code>true</code> if the operation can be canceled.
+ */
+ public boolean isCancelable(Object context, String operation);
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperService.java
index e33c4d547..421cbc714 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperService.java
@@ -9,8 +9,8 @@
*******************************************************************************/
package org.eclipse.tcf.te.runtime.stepper.interfaces;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.services.interfaces.IService;
+import org.eclipse.tcf.te.runtime.stepper.job.AbstractStepperJobSchedulingRule;
/**
* Stepper service.
@@ -18,67 +18,10 @@ import org.eclipse.tcf.te.runtime.services.interfaces.IService;
public interface IStepperService extends IService {
/**
- * Checks if this service can handle the given operation.
+ * Get a job scheduling rule for the given context.
* @param context The context. Must not be <code>null</code>.
* @param operation The operation. Must not be <code>null</code>.
- * @return <code>true</code> if this service handles the given operation.
+ * @return The scheduling rule or <code>null</code>.
*/
- public boolean isHandledOperation(Object context, String operation);
-
- /**
- * Get the step group id for the given context and operation
- * or <code>null</code> if this operation is not available.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param operation The operation. Must not be <code>null</code>.
- * @return The step group id or <code>null</code>.
- */
- public String getStepGroupId(Object context, String operation);
-
-
- /**
- * Get the step group name for the given context and operation
- * or <code>null</code> if this operation is not available.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param operation The operation. Must not be <code>null</code>.
- * @return The step group name or <code>null</code>.
- */
- public String getStepGroupName(Object context, String operation);
-
- /**
- * Get the step context for the given context and operation
- * or <code>null</code> if this operation is not available.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param operation The operation. Must not be <code>null</code>.
- * @return The step context or <code>null</code>.
- */
- public IStepContext getStepContext(Object context, String operation);
-
- /**
- * Get the step data for the given context and operation.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param operation The operation. Must not be <code>null</code>.
- * @return The step data or an empty properties container.
- */
- public IPropertiesContainer getStepData(Object context, String operation);
-
- /**
- * Get the enabled state for the given operation.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param operation The operation. Must not be <code>null</code>.
- * @return <code>true</code> if the operation is enabled.
- */
- public boolean isEnabled(Object context, String operation);
-
- /**
- * Returns <code>true</code> if the given operation can be canceled.
- * @param context The context. Must not be <code>null</code>.
- * @param operation The operation. Must not be <code>null</code>.
- * @return <code>true</code> if the operation can be canceled.
- */
- public boolean isCancelable(Object context, String operation);
+ public AbstractStepperJobSchedulingRule getSchedulingRule(Object context, String operation);
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java
index bf48ee0d7..db779a216 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java
@@ -9,11 +9,13 @@
*******************************************************************************/
package org.eclipse.tcf.te.runtime.stepper.internal;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
import org.eclipse.tcf.te.runtime.services.interfaces.IService;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService;
import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
@@ -32,37 +34,43 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
String operation = expectedValue instanceof String ? (String)expectedValue : null;
if ("isRunning".equals(property)) { //$NON-NLS-1$
- if (operation != null && receiver instanceof IPropertiesContainer) {
- IPropertiesAccessService service = ServiceManager.getInstance().getService(receiver, IPropertiesAccessService.class);
- StepperJob job = service != null ? (StepperJob)service.getProperty(receiver, StepperJob.class.getName() + "." + operation) : null; //$NON-NLS-1$
- if (service == null && receiver instanceof IPropertiesContainer)
- job = (StepperJob)((IPropertiesContainer)receiver).getProperty(StepperJob.class.getName() + "." + operation); //$NON-NLS-1$
- return job != null && !job.isCanceled() && !job.isFinished();
+ if (operation != null) {
+ Map<String,List<Job>> jobs = StepperJob.getJobs(receiver);
+ if (jobs != null && jobs.containsKey(operation)) {
+ for (Job job : jobs.get(operation)) {
+ if (job instanceof StepperJob && !((StepperJob)job).isCanceled() && !((StepperJob)job).isFinished()) {
+ return true;
+ }
+ }
+ }
}
}
if ("isRunningOrCanceled".equals(property)) { //$NON-NLS-1$
- if (operation != null && receiver instanceof IPropertiesContainer) {
- IPropertiesAccessService service = ServiceManager.getInstance().getService(receiver, IPropertiesAccessService.class);
- StepperJob job = service != null ? (StepperJob)service.getProperty(receiver, StepperJob.class.getName() + "." + operation) : null; //$NON-NLS-1$
- if (service == null && receiver instanceof IPropertiesContainer)
- job = (StepperJob)((IPropertiesContainer)receiver).getProperty(StepperJob.class.getName() + "." + operation); //$NON-NLS-1$
- return job != null && !job.isFinished();
+ if (operation != null) {
+ Map<String,List<Job>> jobs = StepperJob.getJobs(receiver);
+ if (jobs != null && jobs.containsKey(operation)) {
+ for (Job job : jobs.get(operation)) {
+ if (job instanceof StepperJob && !((StepperJob)job).isFinished()) {
+ return true;
+ }
+ }
+ }
}
}
if ("isEnabled".equals(property)) { //$NON-NLS-1$
if (operation != null) {
- IService[] services = ServiceManager.getInstance().getServices(receiver, IStepperService.class, false);
- IStepperService stepperService = null;
+ IService[] services = ServiceManager.getInstance().getServices(receiver, IStepperOperationService.class, false);
+ IStepperOperationService stepperOperationService = null;
for (IService service : services) {
- if (service instanceof IStepperService && ((IStepperService)service).isHandledOperation(receiver, operation)) {
- stepperService = (IStepperService)service;
+ if (service instanceof IStepperOperationService && ((IStepperOperationService)service).isHandledOperation(receiver, operation)) {
+ stepperOperationService = (IStepperOperationService)service;
break;
}
}
- if (stepperService != null) {
- return stepperService.isEnabled(receiver, operation);
+ if (stepperOperationService != null) {
+ return stepperOperationService.isEnabled(receiver, operation);
}
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/AbstractStepperJobSchedulingRule.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/AbstractStepperJobSchedulingRule.java
new file mode 100644
index 000000000..2da5a87ff
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/AbstractStepperJobSchedulingRule.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 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.job;
+
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+
+public abstract class AbstractStepperJobSchedulingRule implements ISchedulingRule {
+
+ private final Object context;
+ private final String operation;
+
+ /**
+ * Constructor.
+ */
+ public AbstractStepperJobSchedulingRule(Object context, String operation) {
+ this.context = context;
+ this.operation = operation;
+ }
+
+ public Object getContext() {
+ return context;
+ }
+
+ public String getOperation() {
+ return operation;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse.core.runtime.jobs.ISchedulingRule)
+ */
+ @Override
+ public final boolean contains(ISchedulingRule rule) {
+ if (rule instanceof AbstractStepperJobSchedulingRule &&
+ context instanceof ISchedulingRule &&
+ ((AbstractStepperJobSchedulingRule)rule).context instanceof ISchedulingRule) {
+ return ((ISchedulingRule)context).contains((ISchedulingRule)((AbstractStepperJobSchedulingRule)rule).context);
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.ISchedulingRule#isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule)
+ */
+ @Override
+ public final boolean isConflicting(ISchedulingRule rule) {
+ if (this == rule) {
+ return true;
+ }
+ if (rule instanceof AbstractStepperJobSchedulingRule) {
+ return isConflicting(this, (AbstractStepperJobSchedulingRule)rule);
+ }
+ if (context instanceof ISchedulingRule) {
+ // use the conflicting rule of parent for all other operations.
+ return ((ISchedulingRule)context).isConflicting(rule);
+ }
+ return true;
+ }
+
+ protected abstract boolean isConflicting(AbstractStepperJobSchedulingRule rule1, AbstractStepperJobSchedulingRule rule2);
+} \ No newline at end of file
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/StepperJob.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/StepperJob.java
index 239b8f7df..aa8a5b17b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/StepperJob.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/StepperJob.java
@@ -9,6 +9,11 @@
*******************************************************************************/
package org.eclipse.tcf.te.runtime.stepper.job;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -25,24 +30,29 @@ import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
import org.eclipse.tcf.te.runtime.statushandler.StatusHandlerManager;
import org.eclipse.tcf.te.runtime.statushandler.interfaces.IStatusHandler;
+import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepAttributes;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService;
import org.eclipse.tcf.te.runtime.stepper.stepper.Stepper;
/**
* Stepper job implementation.
*/
-public class StepperJob extends Job {
+public final class StepperJob extends Job {
final private IStepContext stepContext;
final private IPropertiesContainer data;
final private String stepGroupId;
- final private String operation;
+ final protected String operation;
+
+ private final boolean isCancelable;
private ICallback jobCallback = null;
private boolean isFinished = false;
private boolean isCanceled = false;
- private final boolean isCancelable;
private boolean statusHandled = false;
private class NotCancelableProgressMonitor implements IProgressMonitor {
@@ -137,23 +147,63 @@ public class StepperJob extends Job {
this.operation = operation;
this.isCancelable = isCancelable;
- if (stepContext.getContextObject() instanceof ISchedulingRule) {
- setRule((ISchedulingRule)stepContext.getContextObject());
+ ISchedulingRule rule = null;
+ IStepperService service = ServiceManager.getInstance().getService(stepContext.getContextObject(), IStepperService.class, true);
+ if (service != null) {
+ rule = service.getSchedulingRule(stepContext.getContextObject(), operation);
+ }
+ else if (stepContext.getContextObject() instanceof ISchedulingRule) {
+ rule = (ISchedulingRule)stepContext.getContextObject();
}
- IPropertiesAccessService service = ServiceManager.getInstance().getService(stepContext.getContextObject(), IPropertiesAccessService.class);
- StepperJob job = service != null ? (StepperJob)service.getProperty(stepContext.getContextObject(), StepperJob.class.getName() + "." + operation) : null; //$NON-NLS-1$
- if (service == null && stepContext.getContextObject() instanceof IPropertiesContainer)
- job = (StepperJob)((IPropertiesContainer)stepContext.getContextObject()).getProperty(StepperJob.class.getName() + "." + operation); //$NON-NLS-1$
+ setRule(rule);
- if (job != null) throw new IllegalStateException("There is already a stepper job for operation '" + operation + "'."); //$NON-NLS-1$ //$NON-NLS-2$
+ Map<String,List<Job>> jobs = getJobs(stepContext.getContextObject());
+ addJob(jobs, this, operation);
+ setJobs(jobs, stepContext.getContextObject());
- if (service != null)
- service.setProperty(stepContext.getContextObject(), StepperJob.class.getName() + "." + operation, this); //$NON-NLS-1$
- else if (stepContext.getContextObject() instanceof IPropertiesContainer)
- ((IPropertiesContainer)stepContext.getContextObject()).setProperty(StepperJob.class.getName() + "." + operation, this); //$NON-NLS-1$
+ data.setProperty(IStepAttributes.ATTR_STEPPER_JOB, this);
+ data.setProperty(IStepAttributes.ATTR_STEPPER_JOB_OPERATION, operation);
}
+ public static Map<String,List<Job>> getJobs(Object context) {
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(context, IPropertiesAccessService.class);
+ Map<String,List<Job>> jobs = null;
+ if (service == null && context instanceof IPropertiesContainer)
+ jobs = (Map<String,List<Job>>)((IPropertiesContainer)context).getProperty(StepperJob.class.getName());
+ else
+ jobs = service != null ? (Map<String,List<Job>>)service.getProperty(context, StepperJob.class.getName()) : null;
+
+ if (jobs == null)
+ jobs = new HashMap<String, List<Job>>();
+
+ return jobs;
+ }
+
+ public static void addJob(Map<String,List<Job>> jobs, Job job, String operation) {
+ List<Job> jobsForOperation = jobs.get(operation);
+ if (jobsForOperation == null) {
+ jobsForOperation = new ArrayList<Job>();
+ jobs.put(operation, jobsForOperation);
+ }
+ jobsForOperation.add(job);
+ }
+
+ public static void removeJob(Map<String,List<Job>> jobs, Job job, String operation) {
+ List<Job> jobsForOperation = jobs.get(operation);
+ if (jobsForOperation != null) {
+ jobsForOperation.remove(job);
+ }
+ }
+
+ public static void setJobs(Map<String,List<Job>> jobs, Object context) {
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(context, IPropertiesAccessService.class);
+ if (service != null)
+ service.setProperty(context, StepperJob.class.getName(), jobs);
+ else if (context instanceof IPropertiesContainer)
+ ((IPropertiesContainer)context).setProperty(StepperJob.class.getName(), jobs);
+ }
+
/**
* Set the callback for the job.
* @param callback The callback.
@@ -190,7 +240,17 @@ public class StepperJob extends Job {
addJobChangeListener(listener);
// The stepper instance to be used
- IStepper stepper = new Stepper(getName());
+ IStepper stepper = new Stepper(getName()) {
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.stepper.Stepper#onInitialize(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected void onInitialize(IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) {
+ super.onInitialize(data, fullQualifiedId, monitor);
+ StepperAttributeUtil.setProperty(IStepAttributes.ATTR_STEPPER_JOB, fullQualifiedId, data, StepperJob.this);
+ StepperAttributeUtil.setProperty(IStepAttributes.ATTR_STEPPER_JOB_OPERATION, fullQualifiedId, data, operation);
+ }
+ };
IStatus status = Status.OK_STATUS;
try {
@@ -205,11 +265,9 @@ public class StepperJob extends Job {
// Cleanup the stepper
stepper.cleanup();
- IPropertiesAccessService service = ServiceManager.getInstance().getService(stepContext.getContextObject(), IPropertiesAccessService.class);
- if (service != null)
- service.setProperty(stepContext.getContextObject(), StepperJob.class.getName() + "." + operation, null); //$NON-NLS-1$
- else if (stepContext.getContextObject() instanceof IPropertiesContainer)
- ((IPropertiesContainer)stepContext.getContextObject()).setProperty(StepperJob.class.getName() + "." + operation, null); //$NON-NLS-1$
+ Map<String,List<Job>> jobs = getJobs(stepContext.getContextObject());
+ removeJob(jobs, this, operation);
+ setJobs(jobs, stepContext.getContextObject());
}
if (jobCallback != null)
@@ -250,4 +308,12 @@ public class StepperJob extends Job {
isCanceled = true;
}
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
+ */
+ @Override
+ public boolean belongsTo(Object family) {
+ return StepperJob.class.getName().equals(family);
+ }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/services/AbstractStepperService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/services/AbstractStepperOperationService.java
index 9be29cba2..a3bc1370a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/services/AbstractStepperService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/services/AbstractStepperOperationService.java
@@ -16,15 +16,15 @@ import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
import org.eclipse.tcf.te.runtime.services.AbstractService;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService;
/**
- * AbstractStepperService
+ * AbstractStepperOperationService
*/
-public abstract class AbstractStepperService extends AbstractService implements IStepperService {
+public abstract class AbstractStepperOperationService extends AbstractService implements IStepperOperationService {
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService#getStepContext(java.lang.Object, java.lang.String)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService#getStepContext(java.lang.Object, java.lang.String)
*/
@Override
public IStepContext getStepContext(Object context, String operation) {
@@ -43,7 +43,7 @@ public abstract class AbstractStepperService extends AbstractService implements
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService#getStepData(java.lang.Object, java.lang.String)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService#getStepData(java.lang.Object, java.lang.String)
*/
@Override
public IPropertiesContainer getStepData(Object context, String operation) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/CancelJobsStep.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/CancelJobsStep.java
new file mode 100644
index 000000000..ebe258ace
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/CancelJobsStep.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * 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 java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.Callback;
+import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
+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.StepperAttributeUtil;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepAttributes;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
+import org.eclipse.tcf.te.runtime.utils.ProgressHelper;
+
+/**
+ * Cancel als StepperJobs jobs.
+ */
+public class CancelJobsStep extends AbstractStep {
+
+ /**
+ * Constructor.
+ */
+ public CancelJobsStep() {
+ }
+
+ /* (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 {
+ }
+
+ /* (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(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor, final ICallback callback) {
+ Job thisJob = (StepperJob)StepperAttributeUtil.getProperty(IStepAttributes.ATTR_STEPPER_JOB, fullQualifiedId, data);
+
+ final AsyncCallbackCollector collector = new AsyncCallbackCollector();
+ Map<String,List<Job>> jobs = StepperJob.getJobs(context.getContextObject());
+ final AtomicInteger numJobsToCancel = new AtomicInteger();
+ final AtomicInteger canceledJobs = new AtomicInteger();
+ for (String op : jobs.keySet()) {
+ for (Job job : jobs.get(op)) {
+ if (job != thisJob) {
+ numJobsToCancel.set(numJobsToCancel.get()+1);
+ }
+ }
+ }
+ for (String op : jobs.keySet()) {
+ for (Job job : jobs.get(op)) {
+ if (job != thisJob) {
+ if (job instanceof StepperJob) {
+ Callback jobCb = new Callback(((StepperJob)job).getJobCallback()) {
+ @Override
+ protected void internalDone(Object caller, IStatus status) {
+ canceledJobs.set(canceledJobs.get()+1);
+ ProgressHelper.worked(monitor, getTotalWork(context, data) / numJobsToCancel.get());
+ ProgressHelper.setSubTaskName(monitor, canceledJobs.get() + " of " + numJobsToCancel.get() + " Jobs canceled."); //$NON-NLS-1$ //$NON-NLS-2$
+ collector.removeCallback(this);
+ }
+ };
+ if (job.getState() == Job.RUNNING) {
+ collector.addCallback(jobCb);
+ ((StepperJob)job).setJobCallback(jobCb);
+ }
+ else {
+ canceledJobs.set(canceledJobs.get()+1);
+ }
+ job.cancel();
+ }
+ }
+ }
+
+ }
+
+ collector.initDone();
+
+ ExecutorsUtil.waitAndExecute(0, collector.getConditionTester());
+
+ callback.done(this, Status.OK_STATUS);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/AsyncCallbackCollector.java
index 912ad2a1b..64940b3a0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/AsyncCallbackCollector.java
@@ -7,14 +7,13 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.core.async;
+package org.eclipse.tcf.te.runtime.callback;
import java.util.concurrent.ExecutionException;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.utils.StatusHelper;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/AsyncCallbackHandler.java
index 5e8524175..6726a4246 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/AsyncCallbackHandler.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.core.async;
+package org.eclipse.tcf.te.runtime.callback;
import java.util.Hashtable;
import java.util.Iterator;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/async/CallbackInvocationDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/async/CallbackInvocationDelegate.java
index 654e21546..6f97a827f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/async/CallbackInvocationDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/async/CallbackInvocationDelegate.java
@@ -1,32 +1,32 @@
-/*******************************************************************************
- * 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
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.core.async;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
-
-/**
- * Asynchronous callback collector callback invocation delegate implementation.
- * <p>
- * The delegate invokes callbacks within the TCF dispatch thread.
- */
-public class CallbackInvocationDelegate implements AsyncCallbackCollector.ICallbackInvocationDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.core.async.AsyncCallbackCollector.ICallbackInvocationDelegate#invoke(java.lang.Runnable)
- */
- @Override
- public void invoke(Runnable runnable) {
- Assert.isNotNull(runnable);
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeLater(runnable);
- }
-}
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.core.async;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
+
+/**
+ * Asynchronous callback collector callback invocation delegate implementation.
+ * <p>
+ * The delegate invokes callbacks within the TCF dispatch thread.
+ */
+public class CallbackInvocationDelegate implements AsyncCallbackCollector.ICallbackInvocationDelegate {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.core.async.AsyncCallbackCollector.ICallbackInvocationDelegate#invoke(java.lang.Runnable)
+ */
+ @Override
+ public void invoke(Runnable runnable) {
+ Assert.isNotNull(runnable);
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeLater(runnable);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
index 3a8c24191..42beffead 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
@@ -192,6 +192,7 @@
<stepGroup
id="org.eclipse.tcf.te.tcf.locator.disconnectStepGroup">
<references>
+ <reference id="org.eclipse.tcf.te.runtime.stepper.cancelJobsStep"/>
<reference id="org.eclipse.tcf.te.tcf.locator.stopDebuggerStep"/>
<reference id="org.eclipse.tcf.te.tcf.core.shutDownStep"/>
<reference id="org.eclipse.tcf.te.tcf.locator.stopSimulatorStep"/>
@@ -218,12 +219,8 @@
id="org.eclipse.tcf.te.tcf.locator.startDebuggerStepGroup"
iterator="org.eclipse.tcf.te.tcf.locator.iterators.StartDebuggerIterator">
<references>
- <reference
- id="org.eclipse.tcf.te.tcf.locator.startDebuggerStep">
- <parameter
- name="autoAttachAll"
- value="true">
- </parameter>
+ <reference id="org.eclipse.tcf.te.tcf.locator.startDebuggerStep">
+ <parameter name="autoAttachAll" value="true"/>
</reference>
</references>
</stepGroup>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java
index ff44e7094..24f488c10 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java
@@ -22,7 +22,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.tcf.core.async.CallbackInvocationDelegate;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerModelStepContext.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerModelStepContext.java
index b91e1961f..440760606 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerModelStepContext.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerModelStepContext.java
@@ -1,67 +1,67 @@
-/*******************************************************************************
- * 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.tcf.locator.internal.adapters;
-
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.te.runtime.stepper.context.AbstractStepContext;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-/**
- * Peer model step context implementation.
- */
-public class PeerModelStepContext extends AbstractStepContext {
-
- /**
- * Constructor
- */
- public PeerModelStepContext(IPeerModel peerModel) {
- super(peerModel);
- }
-
- /**
- * Returns the peer model.
- * @return The peer model.
- */
- public IPeerModel getPeerModel() {
- return (IPeerModel)getContextObject();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getId()
- */
- @Override
- public String getId() {
- return getPeerModel().getPeerId();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getName()
- */
- @Override
- public String getName() {
- return getPeerModel().getName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter(final Class adapter) {
- if (IPeerModel.class.equals(adapter)) {
- return getPeerModel();
- }
-
- if (IPeer.class.equals(adapter)) {
- return getPeerModel().getPeer();
- }
-
- return super.getAdapter(adapter);
- }
-}
+/*******************************************************************************
+ * 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.tcf.locator.internal.adapters;
+
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.te.runtime.stepper.context.AbstractStepContext;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+
+/**
+ * Peer model step context implementation.
+ */
+public class PeerModelStepContext extends AbstractStepContext {
+
+ /**
+ * Constructor
+ */
+ public PeerModelStepContext(IPeerModel peerModel) {
+ super(peerModel);
+ }
+
+ /**
+ * Returns the peer model.
+ * @return The peer model.
+ */
+ public IPeerModel getPeerModel() {
+ return (IPeerModel)getContextObject();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getId()
+ */
+ @Override
+ public String getId() {
+ return getPeerModel().getPeerId();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getName()
+ */
+ @Override
+ public String getName() {
+ return getPeerModel().getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(final Class adapter) {
+ if (IPeerModel.class.equals(adapter)) {
+ return getPeerModel();
+ }
+
+ if (IPeer.class.equals(adapter)) {
+ return getPeerModel().getPeer();
+ }
+
+ return super.getAdapter(adapter);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractStepperService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractStepperOperationService.java
index 8b57dc387..fff476206 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractStepperService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractStepperOperationService.java
@@ -1,5 +1,5 @@
/**
- * AbstractStepperService.java
+ * AbstractStepperOperationService.java
* Created on Apr 10, 2013
*
* Copyright (c) 2013 Wind River Systems, Inc.
@@ -17,16 +17,16 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.services.IStepperServiceOperati
/**
* Abstract connect/disconnect stepper service implementation.
*/
-public abstract class AbstractStepperService extends org.eclipse.tcf.te.runtime.stepper.services.AbstractStepperService {
+public abstract class AbstractStepperOperationService extends org.eclipse.tcf.te.runtime.stepper.services.AbstractStepperOperationService {
/**
* Constructor.
*/
- public AbstractStepperService() {
+ public AbstractStepperOperationService() {
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService#isHandledOperation(java.lang.Object, java.lang.String)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService#isHandledOperation(java.lang.Object, java.lang.String)
*/
@Override
public boolean isHandledOperation(Object context, String operation) {
@@ -73,7 +73,7 @@ public abstract class AbstractStepperService extends org.eclipse.tcf.te.runtime.
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService#isCancelable(java.lang.Object, java.lang.String)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService#isCancelable(java.lang.Object, java.lang.String)
*/
@Override
public boolean isCancelable(Object context, String operation) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelRefreshService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelRefreshService.java
index 37871d615..71c3c4ed9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelRefreshService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelRefreshService.java
@@ -31,7 +31,7 @@ import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.IToken;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.ILocator;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableNodeProperties;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java
index e7b588a76..d5e635fe1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java
@@ -19,7 +19,6 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.tcf.protocol.IChannel;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
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;
@@ -75,6 +74,9 @@ public class WaitForReadyStep extends AbstractPeerModelStep {
Tcf.getChannelManager().openChannel(peerModel.getPeer(), null, new IChannelManager.DoneOpenChannel() {
@Override
public void doneOpenChannel(final Throwable error, final IChannel channel) {
+ if (ProgressHelper.isCancel(WaitForReadyStep.this, monitor, callback)) {
+ return;
+ }
IStatus status = null;
// If the channel open succeeded, we are done
@@ -87,25 +89,18 @@ public class WaitForReadyStep extends AbstractPeerModelStep {
// If we have an OK status, we are done
if (status != null && status.isOK()) {
- Object wait = getParameters().get("wait"); //$NON-NLS-1$
- if (wait != null) {
- try {
- int waitValue = Integer.parseInt(wait.toString());
- ExecutorsUtil.waitAndExecute(waitValue, null);
- }
- catch (Exception e) {
- }
- }
callback(data, fullQualifiedId, callback, status, null);
return;
}
// License errors are reported to the user and breaks the wait immediately
- if (error != null
- && (error.getLocalizedMessage().contains("LMAPI error occured:") //$NON-NLS-1$
- || error.getLocalizedMessage().contains("Failed to read output from value-add"))) { //$NON-NLS-1$
- callback(data, fullQualifiedId, callback, StatusHelper.getStatus(error), null);
- return;
+ if (error != null) {
+ String message = error.getLocalizedMessage();
+ if (message != null && (message.contains("LMAPI error occured:") //$NON-NLS-1$
+ || message.contains("Failed to read output from value-add"))) { //$NON-NLS-1$
+ callback(data, fullQualifiedId, callback, StatusHelper.getStatus(error), null);
+ return;
+ }
}
// Try again until timed out
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
index 18ccf3346..54048fe1f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
@@ -45,7 +45,7 @@ import org.eclipse.tcf.services.IProcesses;
import org.eclipse.tcf.services.IProcesses.ProcessContext;
import org.eclipse.tcf.services.IProcessesV1;
import org.eclipse.tcf.services.IStreams;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.events.DisposedEvent;
import org.eclipse.tcf.te.runtime.events.EventManager;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessStreamsListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessStreamsListener.java
index ed568f452..33f9a9417 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessStreamsListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessStreamsListener.java
@@ -27,7 +27,7 @@ import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.IProcesses;
import org.eclipse.tcf.services.IProcessesV1;
import org.eclipse.tcf.services.IStreams;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.tcf.core.async.CallbackInvocationDelegate;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java
index 2676ee496..0d2f92698 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java
@@ -23,7 +23,7 @@ import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.IProcesses;
import org.eclipse.tcf.services.ISysMonitor;
import org.eclipse.tcf.services.ISysMonitor.SysMonitorContext;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java
index a803f87a9..c417374e9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java
@@ -22,7 +22,7 @@ import org.eclipse.tcf.protocol.IToken;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.IProcesses;
import org.eclipse.tcf.services.IProcesses.ProcessContext;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/RefreshProcessListHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/RefreshProcessListHandler.java
index ae3619c8c..e398ea4b9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/RefreshProcessListHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/RefreshProcessListHandler.java
@@ -17,7 +17,7 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsLauncher.java
index 7fb2dae0b..0d27225c7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsLauncher.java
@@ -41,7 +41,7 @@ import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.IStreams;
import org.eclipse.tcf.services.ITerminals;
import org.eclipse.tcf.services.ITerminals.TerminalContext;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.events.DisposedEvent;
import org.eclipse.tcf.te.runtime.events.EventManager;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsStreamsListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsStreamsListener.java
index 21ea4aa62..f542af4e2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsStreamsListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsStreamsListener.java
@@ -26,7 +26,7 @@ import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.IStreams;
import org.eclipse.tcf.services.ITerminals;
import org.eclipse.tcf.services.ITerminals.TerminalContext;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.tcf.core.async.CallbackInvocationDelegate;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
index 67d20d3a6..6e3894574 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
@@ -19,14 +19,14 @@ import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IService;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService;
import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
import org.eclipse.tcf.te.runtime.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.core.Tcf;
@@ -136,20 +136,20 @@ public class UIPlugin extends AbstractUIPlugin {
IPeerModel[] peers = model.getPeers();
// Loop them and check if disconnect is available
for (IPeerModel peerModel : peers) {
- IService[] services = ServiceManager.getInstance().getServices(peerModel, IStepperService.class, false);
- IStepperService stepperService = null;
+ IService[] services = ServiceManager.getInstance().getServices(peerModel, IStepperOperationService.class, false);
+ IStepperOperationService stepperOperationService = null;
for (IService service : services) {
- if (service instanceof IStepperService && ((IStepperService)service).isHandledOperation(peerModel, IStepperServiceOperations.DISCONNECT)) {
- stepperService = (IStepperService)service;
+ if (service instanceof IStepperOperationService && ((IStepperOperationService)service).isHandledOperation(peerModel, IStepperServiceOperations.DISCONNECT)) {
+ stepperOperationService = (IStepperOperationService)service;
break;
}
}
- if (stepperService != null) {
- String stepGroupId = stepperService.getStepGroupId(peerModel, IStepperServiceOperations.DISCONNECT);
- IStepContext stepContext = stepperService.getStepContext(peerModel, IStepperServiceOperations.DISCONNECT);
- String name = stepperService.getStepGroupName(peerModel, IStepperServiceOperations.DISCONNECT);
- boolean isEnabled = stepperService.isEnabled(peerModel, IStepperServiceOperations.DISCONNECT);
- IPropertiesContainer data = stepperService.getStepData(peerModel, IStepperServiceOperations.DISCONNECT);
+ if (stepperOperationService != null) {
+ String stepGroupId = stepperOperationService.getStepGroupId(peerModel, IStepperServiceOperations.DISCONNECT);
+ IStepContext stepContext = stepperOperationService.getStepContext(peerModel, IStepperServiceOperations.DISCONNECT);
+ String name = stepperOperationService.getStepGroupName(peerModel, IStepperServiceOperations.DISCONNECT);
+ boolean isEnabled = stepperOperationService.isEnabled(peerModel, IStepperServiceOperations.DISCONNECT);
+ IPropertiesContainer data = stepperOperationService.getStepData(peerModel, IStepperServiceOperations.DISCONNECT);
if (isEnabled && stepGroupId != null && stepContext != null) {
try {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java
index fb4a11b77..2fc20540a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java
@@ -22,7 +22,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.tcf.core.async.CallbackInvocationDelegate;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java
index f7df2c115..3d62cd087 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java
@@ -22,7 +22,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java
index a9ccb36a6..dab9ab671 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java
@@ -132,7 +132,9 @@ public abstract class AbstractContextSelectorSection extends org.eclipse.tcf.te.
ExecutorsUtil.executeInUI(new Runnable() {
@Override
public void run() {
- getSelectorControl().refresh();
+ if (getSelectorControl() != null) {
+ getSelectorControl().refresh();
+ }
getManagedForm().dirtyStateChanged();
}
});
@@ -208,7 +210,9 @@ public abstract class AbstractContextSelectorSection extends org.eclipse.tcf.te.
*/
@Override
public void extractData(IPropertiesContainer data) {
- data.setProperty(getContextListDataKey(), encode(selector.getCheckedModelContexts()));
+ if (selector != null) {
+ data.setProperty(getContextListDataKey(), encode(selector.getCheckedModelContexts()));
+ }
}
/* (non-Javadoc)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java
index 89b595eb9..42ed0dac5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java
@@ -19,7 +19,7 @@ import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IService;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService;
import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
import org.eclipse.tcf.te.runtime.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
@@ -89,20 +89,20 @@ public abstract class AbstractConfigWizard extends NewTargetWizard {
});
if (attachDebugger.get()) {
- IService[] services = ServiceManager.getInstance().getServices(peerModel, IStepperService.class, false);
- IStepperService stepperService = null;
+ IService[] services = ServiceManager.getInstance().getServices(peerModel, IStepperOperationService.class, false);
+ IStepperOperationService stepperOperationService = null;
for (IService service : services) {
- if (service instanceof IStepperService && ((IStepperService)service).isHandledOperation(peerModel, IStepperServiceOperations.ATTACH_DEBUGGER)) {
- stepperService = (IStepperService)service;
+ if (service instanceof IStepperOperationService && ((IStepperOperationService)service).isHandledOperation(peerModel, IStepperServiceOperations.ATTACH_DEBUGGER)) {
+ stepperOperationService = (IStepperOperationService)service;
break;
}
}
- if (stepperService != null) {
- String stepGroupId = stepperService.getStepGroupId(peerModel, IStepperServiceOperations.ATTACH_DEBUGGER);
- IStepContext stepContext = stepperService.getStepContext(peerModel, IStepperServiceOperations.ATTACH_DEBUGGER);
- String name = stepperService.getStepGroupName(peerModel, IStepperServiceOperations.ATTACH_DEBUGGER);
- IPropertiesContainer data = stepperService.getStepData(peerModel, IStepperServiceOperations.ATTACH_DEBUGGER);
- boolean enabled = stepperService.isEnabled(peerModel, IStepperServiceOperations.ATTACH_DEBUGGER);
+ if (stepperOperationService != null) {
+ String stepGroupId = stepperOperationService.getStepGroupId(peerModel, IStepperServiceOperations.ATTACH_DEBUGGER);
+ IStepContext stepContext = stepperOperationService.getStepContext(peerModel, IStepperServiceOperations.ATTACH_DEBUGGER);
+ String name = stepperOperationService.getStepGroupName(peerModel, IStepperServiceOperations.ATTACH_DEBUGGER);
+ IPropertiesContainer data = stepperOperationService.getStepData(peerModel, IStepperServiceOperations.ATTACH_DEBUGGER);
+ boolean enabled = stepperOperationService.isEnabled(peerModel, IStepperServiceOperations.ATTACH_DEBUGGER);
if (enabled && stepGroupId != null && stepContext != null) {
try {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/processes/model/ProcessModelTestCase.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/processes/model/ProcessModelTestCase.java
index 48ff6a3cc..2c870620e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/processes/model/ProcessModelTestCase.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/processes/model/ProcessModelTestCase.java
@@ -18,8 +18,8 @@ import junit.framework.TestSuite;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
-import org.eclipse.tcf.te.core.async.AsyncCallbackHandler;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackHandler;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.tcf.core.async.CallbackInvocationDelegate;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/view/TerminalsViewMementoHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/view/TerminalsViewMementoHandler.java
index 64ea8724b..b33f67cf8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/view/TerminalsViewMementoHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/view/TerminalsViewMementoHandler.java
@@ -15,7 +15,7 @@ import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.xml
index baa4d8cb9..d358e143c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.xml
@@ -138,7 +138,10 @@
<adapt type="org.eclipse.tcf.te.runtime.model.interfaces.IModelNode">
<test forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.services.hasService"
- value="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService"/>
+ value="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService"/>
+ <test forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.stepper.isEnabled"
+ value="connect"/>
<not>
<test forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
@@ -161,6 +164,16 @@
<test forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.stepper.isEnabled"
value="connect"/>
+ <not>
+ <test forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
+ value="connect"/>
+ </not>
+ <not>
+ <test forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
+ value="disconnect"/>
+ </not>
</adapt>
</iterate>
</with>
@@ -175,17 +188,22 @@
<adapt type="org.eclipse.tcf.te.runtime.model.interfaces.IModelNode">
<test forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.services.hasService"
- value="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService"/>
- <not>
+ value="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService"/>
+ <adapt type="org.eclipse.tcf.te.runtime.model.interfaces.IModelNode">
<test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
+ property="org.eclipse.tcf.te.runtime.stepper.isEnabled"
value="connect"/>
- </not>
- <not>
- <test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
- value="disconnect"/>
- </not>
+ <not>
+ <test forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
+ value="connect"/>
+ </not>
+ <not>
+ <test forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
+ value="disconnect"/>
+ </not>
+ </adapt>
</adapt>
</with>
</activeWhen>
@@ -199,6 +217,16 @@
<test forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.stepper.isEnabled"
value="connect"/>
+ <not>
+ <test forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
+ value="connect"/>
+ </not>
+ <not>
+ <test forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
+ value="disconnect"/>
+ </not>
</adapt>
</with>
</and>
@@ -215,12 +243,15 @@
<adapt type="org.eclipse.tcf.te.runtime.model.interfaces.IModelNode">
<test forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.services.hasService"
- value="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService"/>
- <not>
+ value="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService"/>
+ <or>
<test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
+ property="org.eclipse.tcf.te.runtime.stepper.isEnabled"
+ value="disconnect"/>
+ <test forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.stepper.isRunning"
value="connect"/>
- </not>
+ </or>
<not>
<test forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
@@ -235,9 +266,19 @@
<count value="1"/>
<iterate operator="and" ifEmpty="false">
<adapt type="org.eclipse.tcf.te.runtime.model.interfaces.IModelNode">
- <test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.stepper.isEnabled"
- value="disconnect"/>
+ <or>
+ <test forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.stepper.isEnabled"
+ value="disconnect"/>
+ <test forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.stepper.isRunning"
+ value="connect"/>
+ </or>
+ <not>
+ <test forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
+ value="disconnect"/>
+ </not>
</adapt>
</iterate>
</with>
@@ -252,12 +293,15 @@
<adapt type="org.eclipse.tcf.te.runtime.model.interfaces.IModelNode">
<test forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.services.hasService"
- value="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService"/>
- <not>
+ value="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService"/>
+ <or>
<test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
+ property="org.eclipse.tcf.te.runtime.stepper.isEnabled"
+ value="disconnect"/>
+ <test forcePluginActivation="true"
+ property="org.eclipse.tcf.te.runtime.stepper.isRunning"
value="connect"/>
- </not>
+ </or>
<not>
<test forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
@@ -269,78 +313,19 @@
<enabledWhen>
<with variable="activeEditorInput">
<adapt type="org.eclipse.tcf.te.runtime.model.interfaces.IModelNode">
- <test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.stepper.isEnabled"
- value="disconnect"/>
- </adapt>
- </with>
- </enabledWhen>
- </handler>
-
- <handler commandId="org.eclipse.tcf.te.ui.command.disconnect">
- <class class="org.eclipse.tcf.te.ui.handler.CancelStepperCommandHandler">
- <parameter name="operation" value="connect"/>
- </class>
- <activeWhen>
- <with variable="systemManagerViewSelection">
- <iterate operator="and" ifEmpty="false">
- <adapt type="org.eclipse.tcf.te.runtime.model.interfaces.IModelNode">
- <test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.services.hasService"
- value="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService"/>
+ <or>
<test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.stepper.isRunning"
- value="connect"/>
- <not>
- <test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.stepper.isEnabled"
- value="disconnect"/>
- </not>
- </adapt>
- </iterate>
- </with>
- </activeWhen>
- <enabledWhen>
- <with variable="systemManagerViewSelection">
- <count value="1"/>
- <iterate operator="and" ifEmpty="false">
- <adapt type="org.eclipse.tcf.te.runtime.model.interfaces.IModelNode">
- <test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.services.hasService"
- value="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService"/>
+ property="org.eclipse.tcf.te.runtime.stepper.isEnabled"
+ value="disconnect"/>
<test forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.stepper.isRunning"
value="connect"/>
- </adapt>
- </iterate>
- </with>
- </enabledWhen>
- </handler>
- <handler commandId="org.eclipse.tcf.te.ui.editor.command.disconnect">
- <class class="org.eclipse.tcf.te.ui.handler.CancelStepperCommandHandler">
- <parameter name="operation" value="connect"/>
- </class>
- <activeWhen>
- <with variable="activeEditorInput">
- <adapt type="org.eclipse.tcf.te.runtime.model.interfaces.IModelNode">
- <test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.services.hasService"
- value="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService"/>
- <test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.stepper.isRunning"
- value="connect"/>
- </adapt>
- </with>
- </activeWhen>
- <enabledWhen>
- <with variable="activeEditorInput">
- <adapt type="org.eclipse.tcf.te.runtime.model.interfaces.IModelNode">
+ </or>
+ <not>
<test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.services.hasService"
- value="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService"/>
- <test forcePluginActivation="true"
- property="org.eclipse.tcf.te.runtime.stepper.isRunning"
- value="connect"/>
+ property="org.eclipse.tcf.te.runtime.stepper.isRunningOrCanceled"
+ value="disconnect"/>
+ </not>
</adapt>
</with>
</enabledWhen>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/async/UICallbackInvocationDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/async/UICallbackInvocationDelegate.java
index 662fc33a5..c5b906728 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/async/UICallbackInvocationDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/async/UICallbackInvocationDelegate.java
@@ -10,7 +10,7 @@
package org.eclipse.tcf.te.ui.async;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.ui.PlatformUI;
/**
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/AbstractSectionDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/AbstractSectionDialog.java
index fd1bced92..bdf5fb1eb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/AbstractSectionDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/AbstractSectionDialog.java
@@ -153,10 +153,17 @@ public abstract class AbstractSectionDialog extends CustomTitleAreaDialog implem
*/
@Override
public String getDialogSettingsSectionName() {
- String name = getClass().getSimpleName();
- Class<?> enclosing = getClass().getEnclosingClass();
+ return getDialogSettingsSection(getClass());
+ }
+
+ protected String getDialogSettingsSection(Class<?> clazz) {
+ String name = clazz.getSimpleName();
+ Class<?> enclosing = clazz.getEnclosingClass();
while ((name == null || name.trim().length() == 0) && enclosing != null) {
name = enclosing.getSimpleName();
+ if (name != null && name.trim().length() > 0) {
+ name = name + "." + AbstractSectionDialog.class.getSimpleName(); //$NON-NLS-1$
+ }
enclosing = enclosing.getEnclosingClass();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/CancelStepperCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/CancelStepperCommandHandler.java
deleted file mode 100644
index 01a2642a5..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/CancelStepperCommandHandler.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * 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.ui.handler;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
-import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.part.EditorPart;
-
-/**
- * Cancel stepper command handler implementation.
- */
-public class CancelStepperCommandHandler extends AbstractHandler implements IExecutableExtension {
-
- private String operation = null;
- private String adaptTo = null;
-
- /* (non-Javadoc)
- * @see com.windriver.te.tcf.ui.handler.AbstractAgentCommandHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- Assert.isNotNull(operation);
-
- // Get the active part
- IWorkbenchPart part = HandlerUtil.getActivePart(event);
- // Get the current selection
- ISelection selection = HandlerUtil.getCurrentSelection(event);
-
- // If the handler is invoked from an editor part, ignore the selection and
- // construct an artificial selection from the active editor input.
- if (part instanceof EditorPart) {
- IEditorInput input = ((EditorPart)part).getEditorInput();
- Object element = input != null ? input.getAdapter(Object.class) : null;
- if (element != null) {
- selection = new StructuredSelection(element);
- }
- }
-
- // If the selection is not empty, iterate over the selection and execute
- // the operation for each peer model node in the selection.
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- Iterator<?> iterator = ((IStructuredSelection)selection).iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- Object adapted = element;
- if (adaptTo != null) {
- Object adapter = Platform.getAdapterManager().getAdapter(element, adaptTo);
- if (adapter != null) adapted = adapter;
- }
- IPropertiesAccessService service = ServiceManager.getInstance().getService(adapted, IPropertiesAccessService.class);
- StepperJob job = service != null ? (StepperJob)service.getProperty(adapted, StepperJob.class.getName() + "." + operation) : null; //$NON-NLS-1$
- if (service == null && adapted instanceof IPropertiesContainer)
- job = (StepperJob)((IPropertiesContainer)adapted).getProperty(StepperJob.class.getName() + "." + operation); //$NON-NLS-1$
- if (job != null)
- job.cancel();
- }
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
- */
- @Override
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- if (data instanceof Map) {
- Map<?,?> dataMap = (Map<?,?>)data;
- if (dataMap.get("operation") instanceof String) { //$NON-NLS-1$
- this.operation = dataMap.get("operation").toString(); //$NON-NLS-1$
- }
- if (dataMap.get("adaptTo") instanceof String) { //$NON-NLS-1$
- this.adaptTo = dataMap.get("adaptTo").toString(); //$NON-NLS-1$
- }
- }
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/StepperCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/StepperCommandHandler.java
index dc96f7bcb..3933c2cce 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/StepperCommandHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/StepperCommandHandler.java
@@ -29,12 +29,14 @@ import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IService;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService;
import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
import org.eclipse.tcf.te.runtime.utils.StatusHelper;
import org.eclipse.tcf.te.ui.activator.UIPlugin;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.part.EditorPart;
@@ -46,6 +48,11 @@ public class StepperCommandHandler extends AbstractHandler implements IExecutabl
protected String operation = null;
protected String adaptTo = null;
+ /**
+ * Part id: Project Explorer view
+ */
+ public static final String PART_ID_PROJECT_VIEW = "org.eclipse.ui.navigator.ProjectExplorer"; //$NON-NLS-1$
+
/* (non-Javadoc)
* @see com.windriver.te.tcf.ui.handler.AbstractAgentCommandHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
@@ -64,13 +71,13 @@ public class StepperCommandHandler extends AbstractHandler implements IExecutabl
Object adapter = Platform.getAdapterManager().getAdapter(element, adaptTo);
if (adapter != null) adapted = adapter;
}
- IStepperService stepperService = getStepperService(adapted, operation);
- if (stepperService != null) {
- IStepContext stepContext = stepperService.getStepContext(adapted, operation);
- String stepGroupId = stepperService.getStepGroupId(adapted, operation);
- String name = stepperService.getStepGroupName(adapted, operation);
- boolean isCancelable = stepperService.isCancelable(adapted, operation);
- IPropertiesContainer data = stepperService.getStepData(adapted, operation);
+ IStepperOperationService stepperOperationService = getStepperService(adapted, operation);
+ if (stepperOperationService != null) {
+ IStepContext stepContext = stepperOperationService.getStepContext(adapted, operation);
+ String stepGroupId = stepperOperationService.getStepGroupId(adapted, operation);
+ String name = stepperOperationService.getStepGroupName(adapted, operation);
+ boolean isCancelable = stepperOperationService.isCancelable(adapted, operation);
+ IPropertiesContainer data = stepperOperationService.getStepData(adapted, operation);
if (stepGroupId != null && stepContext != null) {
scheduleStepperJob(stepContext, data, stepGroupId, name, isCancelable);
@@ -88,16 +95,16 @@ public class StepperCommandHandler extends AbstractHandler implements IExecutabl
* @param operation The operation.
* @return The stepper service or <code>null</code>.
*/
- protected IStepperService getStepperService(Object context, String operation) {
- IService[] services = ServiceManager.getInstance().getServices(context, IStepperService.class, false);
- IStepperService stepperService = null;
+ protected IStepperOperationService getStepperService(Object context, String operation) {
+ IService[] services = ServiceManager.getInstance().getServices(context, IStepperOperationService.class, false);
+ IStepperOperationService stepperOperationService = null;
for (IService service : services) {
- if (service instanceof IStepperService && ((IStepperService)service).isHandledOperation(context, operation)) {
- stepperService = (IStepperService)service;
+ if (service instanceof IStepperOperationService && ((IStepperOperationService)service).isHandledOperation(context, operation)) {
+ stepperOperationService = (IStepperOperationService)service;
break;
}
}
- return stepperService;
+ return stepperOperationService;
}
/**
@@ -123,7 +130,7 @@ public class StepperCommandHandler extends AbstractHandler implements IExecutabl
if (part instanceof EditorPart) {
IEditorInput input = ((EditorPart)part).getEditorInput();
Object element = input != null ? input.getAdapter(Object.class) : null;
- if (element != null) elements.add(element);
+ if (element != null && !elements.contains(element)) elements.add(element);
}
selection = elements.isEmpty() ? new StructuredSelection() : new StructuredSelection(elements);
@@ -170,4 +177,24 @@ public class StepperCommandHandler extends AbstractHandler implements IExecutabl
}
}
}
+
+ public static IStructuredSelection getPartSelection(String partId) {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (partId != null && window != null && window.getActivePage() != null) {
+ ISelection sel = window.getActivePage().getSelection(partId);
+
+ if (sel instanceof IStructuredSelection) {
+ return (IStructuredSelection)sel;
+ }
+ }
+ return null;
+ }
+
+ public static IStructuredSelection getEditorInputSelection() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window != null && window.getActivePage() != null && window.getActivePage().getActiveEditor() != null) {
+ return new StructuredSelection(window.getActivePage().getActiveEditor().getEditorInput());
+ }
+ return null;
+ }
}

Back to the top