Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2011-11-12 09:40:41 -0500
committerUwe Stieber2011-11-12 09:40:41 -0500
commit56002d55f8ded2f14bf1b30629e332aefaf747a6 (patch)
tree18d41eb15eceecf1b6dcf12cd3850c97d0f41305
parentf8bdfbc8174a8255d41b8e03183aab2205304243 (diff)
downloadorg.eclipse.tcf-56002d55f8ded2f14bf1b30629e332aefaf747a6.tar.gz
org.eclipse.tcf-56002d55f8ded2f14bf1b30629e332aefaf747a6.tar.xz
org.eclipse.tcf-56002d55f8ded2f14bf1b30629e332aefaf747a6.zip
Target Explorer: Add stepper related extension points
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/managers/ConnectStrategyExtensionPointManager.java13
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepExecutor.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepGroup.java33
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepper.java14
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.concurrent/src/org/eclipse/tm/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java15
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.statushandler/src/org/eclipse/tm/te/runtime/statushandler/internal/StatusHandlerBinding.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/META-INF/MANIFEST.MF4
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/build.properties3
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/plugin.xml9
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/schema/stepGroups.exsd362
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/schema/steppers.exsd206
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/schema/steps.exsd226
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/StepperManager.java73
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/AbstractContextStep.java (renamed from target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/AbstractContextStep.java)32
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/AbstractContextStepExecutor.java (renamed from target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/AbstractContextStepExecutor.java)23
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/AbstractContextStepGroup.java (renamed from target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/AbstractContextStepGroup.java)18
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/AbstractContextStepper.java (renamed from target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/AbstractContextStepper.java)75
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/ContextStepGroup.java814
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/ContextStepGroupable.java (renamed from target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/ContextStepGroupable.java)28
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextManipulator.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStep.java7
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepExecutor.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroup.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroupIterator.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroupable.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IExtendedContextStep.java11
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IStepper.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IVariantDelegate.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepExtensionPointManager.java83
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepGroupExtensionPointManager.java93
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepGroupExtensionProxy.java69
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepperExtensionPointManager.java83
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/nls/Messages.java13
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/nls/Messages.properties13
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.runtime/src/org/eclipse/tm/te/runtime/extensions/ExecutableExtension.java75
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/AbstractLauncherDelegate.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.views/src/org/eclipse/tm/te/ui/views/extensions/EditorPageBinding.java19
37 files changed, 2261 insertions, 215 deletions
diff --git a/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/managers/ConnectStrategyExtensionPointManager.java b/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/managers/ConnectStrategyExtensionPointManager.java
index 7d1ab3f35..868917d3d 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/managers/ConnectStrategyExtensionPointManager.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/managers/ConnectStrategyExtensionPointManager.java
@@ -18,7 +18,6 @@ import org.eclipse.tm.te.core.connection.interfaces.IConnectStrategy;
import org.eclipse.tm.te.core.connection.strategy.ConnectStrategyStepGroup;
import org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager;
import org.eclipse.tm.te.runtime.extensions.ExecutableExtensionProxy;
-import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroup;
/**
@@ -29,7 +28,7 @@ import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroup;
public class ConnectStrategyExtensionPointManager extends AbstractExtensionPointManager<IConnectStrategy> {
protected class ConnectStrategyExtensionPointProxy extends ExecutableExtensionProxy<IConnectStrategy> {
- private final Map<String, IContextStepGroup<IPropertiesContainer>> fStepGroups = new LinkedHashMap<String, IContextStepGroup<IPropertiesContainer>>();
+ private final Map<String, IContextStepGroup> stepGroups = new LinkedHashMap<String, IContextStepGroup>();
public ConnectStrategyExtensionPointProxy(IConfigurationElement element) throws CoreException {
super(element);
@@ -39,10 +38,10 @@ public class ConnectStrategyExtensionPointManager extends AbstractExtensionPoint
private void loadGroups(IConfigurationElement element) {
for (IConfigurationElement stepGroupsElement : element.getChildren("stepGroups")) { //$NON-NLS-1$
for (IConfigurationElement stepGroupElement : stepGroupsElement.getChildren("stepGroup")) { //$NON-NLS-1$
- IContextStepGroup<IPropertiesContainer> stepGroup = new ConnectStrategyStepGroup();
+ IContextStepGroup stepGroup = new ConnectStrategyStepGroup();
try {
stepGroup.setInitializationData(stepGroupElement, stepGroupElement.getName(), null);
- fStepGroups.put(stepGroup.getId(), stepGroup);
+ stepGroups.put(stepGroup.getId(), stepGroup);
}
catch (CoreException e) {
}
@@ -50,8 +49,8 @@ public class ConnectStrategyExtensionPointManager extends AbstractExtensionPoint
}
}
- public IContextStepGroup<IPropertiesContainer> getStepGroup(String stepGroupId) {
- return fStepGroups.get(stepGroupId);
+ public IContextStepGroup getStepGroup(String stepGroupId) {
+ return stepGroups.get(stepGroupId);
}
}
@@ -120,7 +119,7 @@ public class ConnectStrategyExtensionPointManager extends AbstractExtensionPoint
return connectStrategy;
}
- public IContextStepGroup<IPropertiesContainer> getStepGroup(String connectStrategyId, String stepGroupId) {
+ public IContextStepGroup getStepGroup(String connectStrategyId, String stepGroupId) {
if (connectStrategyId == null || stepGroupId == null) {
return null;
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepExecutor.java b/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepExecutor.java
index ac8e9db8f..c087cfc20 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepExecutor.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepExecutor.java
@@ -15,7 +15,7 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.tm.te.core.activator.CoreBundleActivator;
import org.eclipse.tm.te.core.nls.Messages;
import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tm.te.runtime.stepper.AbstractContextStepExecutor;
+import org.eclipse.tm.te.runtime.stepper.extensions.AbstractContextStepExecutor;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContext;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep;
import org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId;
@@ -23,13 +23,13 @@ import org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId;
/**
* Connect strategy step executor implementation.
*/
-public class ConnectStrategyStepExecutor extends AbstractContextStepExecutor<IPropertiesContainer> {
+public class ConnectStrategyStepExecutor extends AbstractContextStepExecutor {
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.stepper.AbstractContextStepExecutor#formatMessage(java.lang.String, int, org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.tm.te.runtime.stepper.interfaces.IContext, java.lang.Object)
+ * @see org.eclipse.tm.te.runtime.stepper.extensions.AbstractContextStepExecutor#formatMessage(java.lang.String, int, org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.tm.te.runtime.stepper.interfaces.IContext, org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer)
*/
@Override
- protected String formatMessage(String message, int severity, IContextStep<IPropertiesContainer> step, IFullQualifiedId id, IContext context, IPropertiesContainer data) {
+ protected String formatMessage(String message, int severity, IContextStep step, IFullQualifiedId id, IContext context, IPropertiesContainer data) {
String template = null;
switch (severity) {
diff --git a/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepGroup.java b/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepGroup.java
index 91516898c..010fa0314 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepGroup.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepGroup.java
@@ -15,35 +15,28 @@ import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.tm.te.runtime.extensions.ExecutableExtensionProxy;
-import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tm.te.runtime.stepper.AbstractContextStepGroup;
-import org.eclipse.tm.te.runtime.stepper.ContextStepGroupable;
+import org.eclipse.tm.te.runtime.stepper.extensions.AbstractContextStepGroup;
+import org.eclipse.tm.te.runtime.stepper.extensions.ContextStepGroupable;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupable;
/**
* Connect strategy step group implementation.
*/
-public class ConnectStrategyStepGroup extends AbstractContextStepGroup<IPropertiesContainer> {
+public class ConnectStrategyStepGroup extends AbstractContextStepGroup {
- private final List<ExecutableExtensionProxy<IContextStep<IPropertiesContainer>>> steps = new ArrayList<ExecutableExtensionProxy<IContextStep<IPropertiesContainer>>>();
+ private final List<ExecutableExtensionProxy<IContextStep>> steps = new ArrayList<ExecutableExtensionProxy<IContextStep>>();
- /**
- * Constructor.
- */
- public ConnectStrategyStepGroup() {
- super();
- }
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.stepper.AbstractContextStepGroup#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ * @see org.eclipse.tm.te.runtime.stepper.extensions.AbstractContextStepGroup#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
*/
@Override
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- super.setInitializationData(config, propertyName, data);
+ public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ super.doSetInitializationData(config, propertyName, data);
for (IConfigurationElement stepElement : config.getChildren("step")) { //$NON-NLS-1$
- ExecutableExtensionProxy<IContextStep<IPropertiesContainer>> step = new ExecutableExtensionProxy<IContextStep<IPropertiesContainer>>(stepElement);
+ ExecutableExtensionProxy<IContextStep> step = new ExecutableExtensionProxy<IContextStep>(stepElement);
steps.add(step);
}
}
@@ -52,12 +45,12 @@ public class ConnectStrategyStepGroup extends AbstractContextStepGroup<IProperti
* @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroup#getSteps(java.lang.String, java.lang.String)
*/
@Override
- public IContextStepGroupable<IPropertiesContainer>[] getSteps(String type, String subType) throws CoreException {
- List<IContextStepGroupable<IPropertiesContainer>> steps = new ArrayList<IContextStepGroupable<IPropertiesContainer>>();
- for (ExecutableExtensionProxy<IContextStep<IPropertiesContainer>> stepProxy : this.steps) {
- IContextStep<IPropertiesContainer> step = stepProxy.newInstance();
+ public IContextStepGroupable[] getSteps(String type, String subType) throws CoreException {
+ List<IContextStepGroupable> steps = new ArrayList<IContextStepGroupable>();
+ for (ExecutableExtensionProxy<IContextStep> stepProxy : this.steps) {
+ IContextStep step = stepProxy.newInstance();
if (step != null) {
- IContextStepGroupable<IPropertiesContainer> groupable = new ContextStepGroupable<IPropertiesContainer>(step);
+ IContextStepGroupable groupable = new ContextStepGroupable(step);
steps.add(groupable);
}
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepper.java b/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepper.java
index adeebe9c4..791588e8f 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepper.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.core/src/org/eclipse/tm/te/core/connection/strategy/ConnectStrategyStepper.java
@@ -16,8 +16,8 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.tm.te.core.connection.interfaces.IConnectStrategy;
import org.eclipse.tm.te.core.connection.managers.ConnectStrategyExtensionPointManager;
import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tm.te.runtime.stepper.AbstractContextStepper;
import org.eclipse.tm.te.runtime.stepper.activator.CoreBundleActivator;
+import org.eclipse.tm.te.runtime.stepper.extensions.AbstractContextStepper;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContext;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepExecutor;
@@ -30,7 +30,7 @@ import org.eclipse.tm.te.runtime.stepper.interfaces.tracing.ITraceIds;
* A connect strategy stepper.
*/
@SuppressWarnings("restriction")
-public class ConnectStrategyStepper extends AbstractContextStepper<IPropertiesContainer> {
+public class ConnectStrategyStepper extends AbstractContextStepper {
public static final String PROPERTY_CONNECT_STRATEGY = "connectStrategy"; //$NON-NLS-1$
@@ -48,7 +48,7 @@ public class ConnectStrategyStepper extends AbstractContextStepper<IPropertiesCo
}
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.stepper.AbstractContextStepper#initialize(java.lang.Object, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ * @see org.eclipse.tm.te.runtime.stepper.extensions.AbstractContextStepper#initialize(org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
public void initialize(IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws IllegalStateException {
@@ -105,15 +105,15 @@ public class ConnectStrategyStepper extends AbstractContextStepper<IPropertiesCo
* @see org.eclipse.tm.te.runtime.stepper.AbstractContextStepper#getVariantDelegate()
*/
@Override
- protected IVariantDelegate<IPropertiesContainer> getVariantDelegate() throws CoreException {
+ protected IVariantDelegate getVariantDelegate() throws CoreException {
return null;
}
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.stepper.AbstractContextStepper#doCreateStepExecutor(org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep, java.lang.String, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId)
+ * @see org.eclipse.tm.te.runtime.stepper.extensions.AbstractContextStepper#doCreateStepExecutor(org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep, java.lang.String, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId)
*/
@Override
- protected IContextStepExecutor<IPropertiesContainer> doCreateStepExecutor(IContextStep<IPropertiesContainer> step, String secondaryId, IFullQualifiedId fullQualifiedStepId) {
+ protected IContextStepExecutor doCreateStepExecutor(IContextStep step, String secondaryId, IFullQualifiedId fullQualifiedStepId) {
return new ConnectStrategyStepExecutor();
}
@@ -121,7 +121,7 @@ public class ConnectStrategyStepper extends AbstractContextStepper<IPropertiesCo
* @see org.eclipse.tm.te.runtime.stepper.AbstractContextStepper#getStepGroup(java.lang.String, java.lang.String, java.lang.String)
*/
@Override
- public IContextStepGroup<IPropertiesContainer> getStepGroup(String connectStrategyId, String stepGroupId, String variant) {
+ public IContextStepGroup getStepGroup(String connectStrategyId, String stepGroupId, String variant) {
CoreBundleActivator.getTraceHandler().trace("ConnectStrategyStepper#getStepGroup:" //$NON-NLS-1$
+ " connectStrategyId = '" + connectStrategyId + "'" //$NON-NLS-1$ //$NON-NLS-2$
+ ", stepGroupId = '" + stepGroupId + "'" //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.concurrent/src/org/eclipse/tm/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.concurrent/src/org/eclipse/tm/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java
index 240bf7e14..756b4a7d9 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.concurrent/src/org/eclipse/tm/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.concurrent/src/org/eclipse/tm/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java
@@ -34,26 +34,19 @@ import org.eclipse.tm.te.runtime.extensions.ExecutableExtension;
/**
* Abstract delegating execution service implementation.
*/
-public abstract class AbstractDelegatingExecutorService extends
- ExecutableExtension implements IExecutor, ExecutorService {
+public abstract class AbstractDelegatingExecutorService extends ExecutableExtension implements IExecutor, ExecutorService {
// The executor service to delegate the API calls to
private ExecutorService delegate;
// The thread pool name prefix
private String threadPoolNamePrefix;
- /**
- * Constructor.
- */
- public AbstractDelegatingExecutorService() {
- }
-
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
*/
@Override
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- super.setInitializationData(config, propertyName, data);
+ public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ super.doSetInitializationData(config, propertyName, data);
if (config != null && data instanceof Map<?, ?>) {
Map<?, ?> params = (Map<?, ?>) data;
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.statushandler/src/org/eclipse/tm/te/runtime/statushandler/internal/StatusHandlerBinding.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.statushandler/src/org/eclipse/tm/te/runtime/statushandler/internal/StatusHandlerBinding.java
index 2ce3b7892..c755db294 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.statushandler/src/org/eclipse/tm/te/runtime/statushandler/internal/StatusHandlerBinding.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.statushandler/src/org/eclipse/tm/te/runtime/statushandler/internal/StatusHandlerBinding.java
@@ -25,11 +25,11 @@ public class StatusHandlerBinding extends ExecutableExtension {
private Expression expression;
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
*/
@Override
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- super.setInitializationData(config, propertyName, data);
+ public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ super.doSetInitializationData(config, propertyName, data);
// Initialize the handler id field by reading the <handler> extension attribute.
// Throws an exception if the id is empty or null.
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/META-INF/MANIFEST.MF
index bf8b1f4a7..73e52ac11 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.tm.te.runtime.stepper
+Bundle-SymbolicName: org.eclipse.tm.te.runtime.stepper;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.eclipse.tm.te.runtime.stepper.activator.CoreBundleActivator
Bundle-Vendor: %providerName
@@ -13,6 +13,8 @@ Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.eclipse.tm.te.runtime.stepper,
org.eclipse.tm.te.runtime.stepper.activator;x-internal:=true,
+ org.eclipse.tm.te.runtime.stepper.extensions,
org.eclipse.tm.te.runtime.stepper.interfaces,
org.eclipse.tm.te.runtime.stepper.interfaces.tracing,
+ org.eclipse.tm.te.runtime.stepper.internal.extensions;x-internal:=true,
org.eclipse.tm.te.runtime.stepper.nls;x-internal:=true
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/build.properties b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/build.properties
index f4ae97015..73a5119ed 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/build.properties
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/build.properties
@@ -2,4 +2,5 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.properties
+ plugin.properties,\
+ plugin.xml
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/plugin.xml b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/plugin.xml
new file mode 100644
index 000000000..b84db06ce
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/plugin.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension-point id="steppers" name="Steppers" schema="schema/steppers.exsd"/>
+ <extension-point id="steps" name="Steps" schema="schema/steps.exsd"/>
+ <extension-point id="stepGroups" name="Step Groups" schema="schema/stepGroups.exsd"/>
+
+</plugin>
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/schema/stepGroups.exsd b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/schema/stepGroups.exsd
new file mode 100644
index 000000000..d2fe50bbe
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/schema/stepGroups.exsd
@@ -0,0 +1,362 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.tm.te.runtime.stepper" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.tm.te.runtime.stepper" id="stepGroups" name="Step Groups"/>
+ </appinfo>
+ <documentation>
+ This extension point is used to contribute step groups.
+&lt;p&gt;
+A step group bundles a set of single steps and/or other step groups into a more complex functionality group.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="stepGroup" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="stepGroup">
+ <annotation>
+ <documentation>
+ Declares a step group contribution.
+ </documentation>
+ </annotation>
+ <complexType>
+ <choice>
+ <element ref="iterator" minOccurs="0" maxOccurs="1"/>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ <element ref="references" minOccurs="0" maxOccurs="1"/>
+ </choice>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ The unique id of the step group contribution.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string">
+ <annotation>
+ <documentation>
+ The label representing the step group within the UI.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="locked" type="boolean" use="default" value="false">
+ <annotation>
+ <documentation>
+ If set to &quot;true&quot;, the whole step group is marked non-modifyable to the user. Once a contribution marked a step group non-modifyable, the state cannot be changed anymore and will stay non-modifyable. Multiple contributions to a locked step group are possible to allow modifications by 3rdParty contributors.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="baseOn" type="string">
+ <annotation>
+ <documentation>
+ Specify an unique step group id to virtually copy the references section from. None of the other step group attributes are inherited.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="identifier" basedOn="org.eclipse.tm.te.runtime.stepper.stepGroups/stepGroup/@id"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="iterator" type="string">
+ <annotation>
+ <documentation>
+ The class that implements &lt;code&gt;org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupIterator&lt;/code&gt;.
+&lt;p&gt;
+The step group iterator implementation class can be specified either by the iterator attribute or the iterator child element!
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupIterator"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="description" type="string">
+ <annotation>
+ <documentation>
+ A short description of the step group to be presented in the UI.
+ </documentation>
+ </annotation>
+ </element>
+
+ <element name="iterator">
+ <annotation>
+ <documentation>
+ Used when creating an &lt;code&gt;IExecutableExtension&lt;/code&gt; with a named parameter, or more than one.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="parameter" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ The class that implements &lt;code&gt;org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupIterator&lt;/code&gt;.
+&lt;p&gt;
+The step group iterator implementation class can be specified either by the iterator attribute or the iterator child element!
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupIterator"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="parameter">
+ <annotation>
+ <documentation>
+ A parameter for an &lt;code&gt;IExecutableExtension&lt;/code&gt;.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ &lt;p&gt;The parameter name.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="value" type="string" use="required">
+ <annotation>
+ <documentation>
+ &lt;p&gt;The parameter value.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="references">
+ <annotation>
+ <documentation>
+ The set of steps or step groups to combine.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="reference" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="reference">
+ <annotation>
+ <appinfo>
+ <meta.element labelAttribute="id"/>
+ </appinfo>
+ <documentation>
+ Reference to a step or step group.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element ref="requires"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ The unique id of the referenced step or step group. This id must exactly match the id of the step or step group definition. If the id is invalid, the whole step group will become invalid and fails execution.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="secondaryId" type="string">
+ <annotation>
+ <documentation>
+ An optional attribute used to distinct between multiple occurrences of the same step or step group. If not set explicitly and multiple occurrences of the same step or step group is detected, the number of occurrence will be automatically used as &lt;i&gt;secondaryId&lt;/i&gt;. The counting of the occurrences starts with &lt;b&gt;1&lt;/b&gt; and each occurrence is counted including the occurrences with explicit set &lt;i&gt;secondaryId&lt;/i&gt;.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="insertBefore" type="string">
+ <annotation>
+ <documentation>
+ The unique id of the step or step group the step is inserted before. The step is added to the end if the referenced id does not exist.
+&lt;p&gt;
+The attribute will have no effect if the attribute &lt;i&gt;overwrite&lt;/i&gt; is set.
+&lt;p&gt;
+Only one of &lt;i&gt;insertBefore&lt;/i&gt; or &lt;i&gt;insertAfter&lt;/i&gt; can be specified. If &lt;i&gt;insertBefore&lt;/i&gt; is set, &lt;i&gt;insertAfter&lt;/i&gt; is ignored.
+&lt;p&gt;
+Use the form &lt;i&gt;&amp;quot;id##secondaryId&amp;quot;&lt;/i&gt; to identify a specific step or step group if multiple occurrences of this step or step groups exist. If the &lt;i&gt;secondaryId&lt;/i&gt; is not explicitly specified and multiple occurrences of the referenced step or step group exist, the first instance found is effected.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="insertAfter" type="string">
+ <annotation>
+ <documentation>
+ The unique id of the step or step group the step is inserted after. The step is added to the end if the referenced id does not exist.
+&lt;p&gt;
+The attribute will have no effect if the attribute &lt;i&gt;overwrite&lt;/i&gt; is set.
+&lt;p&gt;
+Only one of &lt;i&gt;insertBefore&lt;/i&gt; or &lt;i&gt;insertAfter&lt;/i&gt; can be specified. If &lt;i&gt;insertBefore&lt;/i&gt; is set, &lt;i&gt;insertAfter&lt;/i&gt; is ignored.
+&lt;p&gt;
+Use the form &lt;i&gt;&amp;quot;id##secondaryId&amp;quot;&lt;/i&gt; to identify a specific step or step group if multiple occurrences of this step or step groups exist. If the &lt;i&gt;secondaryId&lt;/i&gt; is not explicitly specified and multiple occurrences of the referenced step or step group exist, the first instance found is effected.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="overwrite" type="string">
+ <annotation>
+ <documentation>
+ The unique id of a step or step group to overwrite. Ignored if the referenced id does not exist.
+&lt;p&gt;
+If set, the attributes &lt;i&gt;insertBefore&lt;/i&gt; and &lt;i&gt;insertAfter&lt;/i&gt; are ignored.
+&lt;p&gt;
+Use the form &lt;i&gt;&amp;quot;id##secondaryId&amp;quot;&lt;/i&gt; to identify a specific step or step group if multiple occurrences of this step or step groups exist. If the &lt;i&gt;secondaryId&lt;/i&gt; is not explicitly specified and multiple occurrences of the referenced step or step group exist, the first instance found is effected.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="removable" type="boolean" use="default" value="true">
+ <annotation>
+ <documentation>
+ If set to &quot;false&quot;, the user cannot remove this step from the step group via the UI. Once set to non-removable, other contributions cannot change the state again.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="hidden" type="boolean" use="default" value="false">
+ <annotation>
+ <documentation>
+ If set to &quot;true&quot;, the step is not visible to the user within the UI. Once set to hidden, other contributions cannot change the state again.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="disable" type="boolean" use="default" value="false">
+ <annotation>
+ <documentation>
+ If set to &quot;true&quot;, the referenced step or step group is disabled. Disabled steps or step groups are neither visible to the user within the UI nor will be executed. Once a contribution disabled a step or step group, it cannot be re-enabled by other contributions.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="singleton" type="boolean" use="default" value="false">
+ <annotation>
+ <documentation>
+ Marks the referenced step or step group as singleton. Singleton references can appear only once within a resolved set of steps.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="requires">
+ <annotation>
+ <appinfo>
+ <meta.element labelAttribute="id"/>
+ </appinfo>
+ <documentation>
+ Declares a dependency to a required step or step group.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ The unique id of the required step or step group.
+&lt;p&gt;
+Use the form &lt;i&gt;&amp;quot;id##secondaryId&amp;quot;&lt;/i&gt; to identify a specific step or step group if multiple occurrences of this step or step groups exist. If the &lt;i&gt;secondaryId&lt;/i&gt; is not explicitly specified and multiple occurrences of the referenced step or step group exist, the first instance found is effected.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ Target Explorer 1.0.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ This is an example of the extension point usage:
+&lt;p&gt;
+&lt;pre&gt;
+&lt;extension point=&quot;org.eclipse.tm.te.runtime.stepper.stepGroups&quot;&gt;
+ &lt;stepGroup
+ locked=&quot;false&quot;
+ id=&quot;org.eclipse.tm.te.tcf.processes.group.launchProcess&quot;
+ label=&quot;Launch Process on a Target&quot;&gt;
+ &lt;description&gt;
+ Transfer a process image to a target and initiate the process execution.
+ &lt;/description&gt;
+ &lt;references&gt;
+ &lt;reference
+ id=&quot;org.eclipse.tm.te.tcf.filesystem.copy&quot;
+ removable=&quot;true&quot; hidden=&quot;false&quot; disable=&quot;false&quot;
+ singleton=&quot;true&quot;/&gt;
+ &lt;reference
+ id=&quot;org.eclipse.tm.te.tcf.processes.steps.startProcess&quot;
+ removable=&quot;false&quot; hidden=&quot;true&quot; disable=&quot;false&quot;
+ singleton=&quot;false&quot;/&gt;
+ &lt;/stepGroup&gt;
+ &lt;/extension&gt;
+&lt;/pre&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ The provider of a step group must implement &lt;samp&gt;org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroup&lt;/samp&gt;.
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2011 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.
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/schema/steppers.exsd b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/schema/steppers.exsd
new file mode 100644
index 000000000..694cfb219
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/schema/steppers.exsd
@@ -0,0 +1,206 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.tm.te.runtime.stepper" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.tm.te.runtime.stepper" id="steppers" name="Steppers"/>
+ </appinfo>
+ <documentation>
+ This extension point is used to contribute stepper.
+&lt;p&gt;
+The stepper is responsible for executing a set of steps or step groups in the correct order and deal with possible errors or warnings which might occurred during execution.
+&lt;p&gt;
+Stepper are synchronous where steps are asynchronous.
+&lt;p&gt;
+Stepper must be runnable in worker threads.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="stepper" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="stepper">
+ <annotation>
+ <documentation>
+ Declares a stepper contribution.
+ </documentation>
+ </annotation>
+ <complexType>
+ <choice>
+ <element ref="class" minOccurs="0" maxOccurs="1"/>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ </choice>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ The unique id of the stepper contribution.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string">
+ <annotation>
+ <documentation>
+ The label representing the stepper within the UI.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ The class that implements &lt;code&gt;org.eclipse.tm.te.runtime.stepper.interfaces.IStepper&lt;/code&gt; or extends &lt;code&gt;org.eclipse.tm.te.runtime.stepper.AbstractContextStepper&lt;/code&gt;.
+&lt;p&gt;
+The stepper implementation class must be specified either by the class attribute or the class child element!
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.tm.te.runtime.stepper.AbstractContextStepper:org.eclipse.tm.te.runtime.stepper.interfaces.IStepper"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="description" type="string">
+ <annotation>
+ <documentation>
+ A short description of the stepper to be presented in the UI.
+ </documentation>
+ </annotation>
+ </element>
+
+ <element name="class">
+ <annotation>
+ <documentation>
+ Used when creating an &lt;code&gt;IExecutableExtension&lt;/code&gt; with a named parameter, or more than one.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="parameter" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ The class that implements &lt;code&gt;org.eclipse.tm.te.runtime.stepper.interfaces.IStepper&lt;/code&gt; or extends &lt;code&gt;org.eclipse.tm.te.runtime.stepper.AbstractContextStepper&lt;/code&gt;.
+&lt;p&gt;
+The stepper implementation class must be specified either by the class attribute or the class child element!
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.tm.te.runtime.stepper.AbstractContextStepper:org.eclipse.tm.te.runtime.stepper.interfaces.IStepper"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="parameter">
+ <annotation>
+ <documentation>
+ A parameter for an &lt;code&gt;IExecutableExtension&lt;/code&gt;.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ &lt;p&gt;The parameter name.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="value" type="string" use="required">
+ <annotation>
+ <documentation>
+ &lt;p&gt;The parameter value.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ Target Explorer 1.0.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ This is an example of the extension point usage:
+&lt;p&gt;
+&lt;pre&gt;
+&lt;extension point=&quot;org.eclipse.tm.te.runtime.stepper.steppers&quot;&gt;
+ &lt;stepper
+ id=&quot;org.eclipse.tm.te.runtime.stepper.default&quot;
+ class=&quot;org.eclipse.tm.te.runtime.stepper.DefaultStepper&quot;
+ label=&quot;Default Stepper&quot;&gt;
+ &lt;/stepper&gt;
+&lt;/extension&gt;
+&lt;/pre&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ The provider of a stepper must implement &lt;samp&gt;org.eclipse.tm.te.runtime.stepper.interfaces.IStepper&lt;/samp&gt;.
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2011 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.
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/schema/steps.exsd b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/schema/steps.exsd
new file mode 100644
index 000000000..5418cb79e
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/schema/steps.exsd
@@ -0,0 +1,226 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.tm.te.runtime.stepper" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.tm.te.runtime.stepper" id="steps" name="Steps"/>
+ </appinfo>
+ <documentation>
+ This extension point is used to contribute steps.
+&lt;p&gt;
+A step step defines a specific functionality to be executed during execution of a step group. Possible errors and warnings occuring during execution are passed to the parent stepper.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="step" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="step">
+ <annotation>
+ <documentation>
+ Declares a step contribution.
+ </documentation>
+ </annotation>
+ <complexType>
+ <choice>
+ <element ref="class" minOccurs="0" maxOccurs="1"/>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ <element ref="requires" minOccurs="0" maxOccurs="unbounded"/>
+ </choice>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ The unique id of the step contribution.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string">
+ <annotation>
+ <documentation>
+ The label representing the step within the UI.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ The class that implements &lt;code&gt;org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep&lt;/code&gt; or extends &lt;code&gt;org.eclipse.tm.te.runtime.stepper.AbstractContextStep&lt;/code&gt;.
+&lt;p&gt;
+The step implementation class must be specified either by the class attribute or the class child element!
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.tm.te.runtime.stepper.AbstractContextStep:org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="description" type="string">
+ <annotation>
+ <documentation>
+ A short description of the step to be presented in the UI.
+ </documentation>
+ </annotation>
+ </element>
+
+ <element name="class">
+ <annotation>
+ <documentation>
+ Used when creating an &lt;code&gt;IExecutableExtension&lt;/code&gt; with a named parameter, or more than one.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="parameter" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ The class that implements &lt;code&gt;org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep&lt;/code&gt; or extends &lt;code&gt;org.eclipse.tm.te.runtime.stepper.AbstractContextStep&lt;/code&gt;.
+&lt;p&gt;
+The step implementation class must be specified either by the class attribute or the class child element!
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.tm.te.runtime.stepper.AbstractContextStep:org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="parameter">
+ <annotation>
+ <documentation>
+ A parameter for an &lt;code&gt;IExecutableExtension&lt;/code&gt;.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ &lt;p&gt;The parameter name.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="value" type="string" use="required">
+ <annotation>
+ <documentation>
+ &lt;p&gt;The parameter value.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="requires">
+ <annotation>
+ <documentation>
+ Declares a dependency to a required step or step group.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ The unique id of the required step or step group.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="identifier" basedOn="org.eclipse.tm.te.runtime.stepper.steps/step/@id"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ Target Explorer 1.0.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ This is an example of the extension point usage:
+&lt;p&gt;
+&lt;pre&gt;
+&lt;extension point=&quot;org.eclipse.tm.te.runtime.stepper.steps&quot;&gt;
+ &lt;step
+ id=&quot;org.eclipse.tm.te.tcf.filesystem.copy&quot;
+ class=&quot;org.eclipse.tm.te.tcf.filesystem.steps.CopyStep&quot;
+ label=&quot;Copy Files between Host and Target&quot;&gt;
+ &lt;description&gt;
+ Copy one or more files between the host and the target in both directions.
+ &lt;/description&gt;
+ &lt;/step&gt;
+&lt;/extension&gt;
+&lt;/pre&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ The provider of a step must implement &lt;samp&gt;org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep&lt;/samp&gt;.
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2011 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.
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/StepperManager.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/StepperManager.java
new file mode 100644
index 000000000..ba43d85a1
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/StepperManager.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tm.te.runtime.stepper;
+
+import org.eclipse.tm.te.runtime.stepper.internal.extensions.StepExtensionPointManager;
+import org.eclipse.tm.te.runtime.stepper.internal.extensions.StepGroupExtensionPointManager;
+import org.eclipse.tm.te.runtime.stepper.internal.extensions.StepperExtensionPointManager;
+
+/**
+ * Central manager providing access to the stepper, steps and step groups
+ * contributed via extension points.
+ */
+public final class StepperManager {
+ // References to the extension point managers
+ private final StepExtensionPointManager stepExtManager = new StepExtensionPointManager();
+ private final StepperExtensionPointManager stepperExtManager = new StepperExtensionPointManager();
+ private final StepGroupExtensionPointManager stepGroupExtManager = new StepGroupExtensionPointManager();
+
+ /*
+ * Thread save singleton instance creation.
+ */
+ private static class LazyInstance {
+ public static StepperManager instance = new StepperManager();
+ }
+
+ /**
+ * Constructor.
+ */
+ StepperManager() {
+ super();
+ }
+
+ /**
+ * Returns the singleton instance of the manager.
+ */
+ public static StepperManager getInstance() {
+ return LazyInstance.instance;
+ }
+
+ /**
+ * Returns the step extension point manager instance.
+ *
+ * @return The step extension point manager instance.
+ */
+ public StepExtensionPointManager getStepExtManager() {
+ return stepExtManager;
+ }
+
+ /**
+ * Returns the stepper extension point manager instance.
+ *
+ * @return The stepper extension point manager instance.
+ */
+ public StepperExtensionPointManager getStepperExtManager() {
+ return stepperExtManager;
+ }
+
+ /**
+ * Returns the step group extension point manager instance.
+ *
+ * @return The step group extension point manager instance.
+ */
+ public StepGroupExtensionPointManager getStepGroupExtManager() {
+ return stepGroupExtManager;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/AbstractContextStep.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/AbstractContextStep.java
index 7d161a617..aefb757fe 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/AbstractContextStep.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/AbstractContextStep.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tm.te.runtime.stepper;
+package org.eclipse.tm.te.runtime.stepper.extensions;
import java.util.ArrayList;
import java.util.List;
@@ -22,6 +22,8 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.tm.te.runtime.extensions.ExecutableExtension;
import org.eclipse.tm.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tm.te.runtime.stepper.StepperAttributeUtil;
import org.eclipse.tm.te.runtime.stepper.activator.CoreBundleActivator;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContext;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep;
@@ -32,7 +34,7 @@ import org.eclipse.tm.te.runtime.stepper.nls.Messages;
/**
* An abstract step implementation.
*/
-public abstract class AbstractContextStep<Data extends Object> extends ExecutableExtension implements IExtendedContextStep<Data> {
+public abstract class AbstractContextStep extends ExecutableExtension implements IExtendedContextStep {
// List of string id's of the step dependencies.
private final List<String> dependencies = new ArrayList<String>();
@@ -63,11 +65,11 @@ public abstract class AbstractContextStep<Data extends Object> extends Executabl
}
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
*/
@Override
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- super.setInitializationData(config, propertyName, data);
+ public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ super.doSetInitializationData(config, propertyName, data);
// Read in the list of required step or step id's if specified.
dependencies.clear();
@@ -88,10 +90,10 @@ public abstract class AbstractContextStep<Data extends Object> extends Executabl
}
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.stepper.interfaces.IExtendedContextStep#initializeFrom(org.eclipse.tm.te.runtime.stepper.interfaces.IContext, java.lang.Object, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ * @see org.eclipse.tm.te.runtime.stepper.interfaces.IExtendedContextStep#initializeFrom(org.eclipse.tm.te.runtime.stepper.interfaces.IContext, org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
- public void initializeFrom(IContext context, Data data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) {
+ public void initializeFrom(IContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) {
Assert.isNotNull(context);
Assert.isNotNull(data);
Assert.isNotNull(fullQualifiedId);
@@ -102,27 +104,27 @@ public abstract class AbstractContextStep<Data extends Object> extends Executabl
}
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.stepper.interfaces.IExtendedContextStep#cleanup(org.eclipse.tm.te.runtime.stepper.interfaces.IContext, java.lang.Object, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ * @see org.eclipse.tm.te.runtime.stepper.interfaces.IExtendedContextStep#cleanup(org.eclipse.tm.te.runtime.stepper.interfaces.IContext, org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
- public void cleanup(IContext context, Data data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) {
+ public void cleanup(IContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) {
StepperAttributeUtil.setProperty(SUFFIX_DELAYED_STATUS, fullQualifiedId, data, false);
StepperAttributeUtil.setProperty(SUFFIX_OPERATIONAL, fullQualifiedId, data, false);
}
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.stepper.interfaces.IExtendedContextStep#rollback(org.eclipse.tm.te.runtime.stepper.interfaces.IContext, java.lang.Object, org.eclipse.core.runtime.IStatus, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tm.te.runtime.interfaces.callback.ICallback)
+ * @see org.eclipse.tm.te.runtime.stepper.interfaces.IExtendedContextStep#rollback(org.eclipse.tm.te.runtime.stepper.interfaces.IContext, org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IStatus, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tm.te.runtime.interfaces.callback.ICallback)
*/
@Override
- public void rollback(IContext context, Data data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
+ public void rollback(IContext context, IPropertiesContainer data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
if (callback != null) callback.done(this, Status.OK_STATUS);
}
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep#getTotalWork(org.eclipse.tm.te.runtime.stepper.interfaces.IContext, java.lang.Object)
+ * @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep#getTotalWork(org.eclipse.tm.te.runtime.stepper.interfaces.IContext, org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer)
*/
@Override
- public int getTotalWork(IContext context, Data data) {
+ public int getTotalWork(IContext context, IPropertiesContainer data) {
return 10;
}
@@ -143,7 +145,7 @@ public abstract class AbstractContextStep<Data extends Object> extends Executabl
* @param status
* @param data
*/
- public final void callback(Data stepData, IFullQualifiedId fullQualifiedId, ICallback callback, IStatus status, Object data) {
+ public final void callback(IPropertiesContainer stepData, IFullQualifiedId fullQualifiedId, ICallback callback, IStatus status, Object data) {
Assert.isNotNull(stepData);
Assert.isNotNull(fullQualifiedId);
Assert.isNotNull(callback);
@@ -187,7 +189,7 @@ public abstract class AbstractContextStep<Data extends Object> extends Executabl
*
* @param status The status to delay. Must be not <code>null</code> and either a warning or info status.
*/
- protected void delayStatus(Data data, IFullQualifiedId fullQualifiedId, IStatus status) {
+ protected void delayStatus(IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IStatus status) {
Assert.isNotNull(status);
Assert.isTrue(status.getSeverity() == IStatus.WARNING || status.getSeverity() == IStatus.INFO);
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/AbstractContextStepExecutor.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/AbstractContextStepExecutor.java
index 47ee115ad..c801f0390 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/AbstractContextStepExecutor.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/AbstractContextStepExecutor.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tm.te.runtime.stepper;
+package org.eclipse.tm.te.runtime.stepper.extensions;
import java.util.Date;
@@ -20,6 +20,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.tm.te.runtime.callback.Callback;
import org.eclipse.tm.te.runtime.concurrent.util.ExecutorsUtil;
import org.eclipse.tm.te.runtime.interfaces.ISharedConstants;
+import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tm.te.runtime.stepper.activator.CoreBundleActivator;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContext;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep;
@@ -53,13 +54,13 @@ import org.eclipse.tm.te.runtime.utils.StatusHelper;
* <li><i>org.eclipse.tm.te.runtime.stepper/profile/stepping</i></li>
* </ul>
*/
-public abstract class AbstractContextStepExecutor<Data extends Object> implements IContextStepExecutor<Data> {
+public abstract class AbstractContextStepExecutor implements IContextStepExecutor {
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepExecutor#execute(org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.tm.te.runtime.stepper.interfaces.IContext, java.lang.Object, org.eclipse.core.runtime.IProgressMonitor)
+ * @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepExecutor#execute(org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.tm.te.runtime.stepper.interfaces.IContext, org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
- public final void execute(IContextStep<Data> step, IFullQualifiedId id, final IContext context, final Data data, IProgressMonitor progress) throws CoreException {
+ public final void execute(IContextStep step, IFullQualifiedId id, final IContext context, final IPropertiesContainer data, IProgressMonitor progress) throws CoreException {
Assert.isNotNull(step);
Assert.isNotNull(id);
Assert.isNotNull(context);
@@ -74,7 +75,7 @@ public abstract class AbstractContextStepExecutor<Data extends Object> implement
+ " ***", //$NON-NLS-1$
0, ITraceIds.PROFILE_STEPPING, IStatus.WARNING, this);
- int ticksToUse = (step instanceof IExtendedContextStep) ? ((IExtendedContextStep<Data>)step).getTotalWork(context, data) : IProgressMonitor.UNKNOWN;
+ int ticksToUse = (step instanceof IExtendedContextStep) ? ((IExtendedContextStep)step).getTotalWork(context, data) : IProgressMonitor.UNKNOWN;
progress = ProgressHelper.getProgressMonitor(progress, ticksToUse);
ProgressHelper.beginTask(progress, step.getLabel(), ticksToUse);
@@ -85,8 +86,8 @@ public abstract class AbstractContextStepExecutor<Data extends Object> implement
// Errors are passed through by definition.
try {
// Execute the step. Spawn to the dispatch thread if necessary.
- if (step instanceof IExtendedContextStep<?>) {
- IExtendedContextStep<Data> extendedStep = (IExtendedContextStep<Data>)step;
+ if (step instanceof IExtendedContextStep) {
+ IExtendedContextStep extendedStep = (IExtendedContextStep)step;
// IExtendedContextStep provides protocol for initialization and validation.
extendedStep.initializeFrom(context, data, id, progress);
@@ -131,8 +132,8 @@ public abstract class AbstractContextStepExecutor<Data extends Object> implement
}
// Give the step a chance for cleanup
- if (step instanceof IExtendedContextStep<?>) {
- ((IExtendedContextStep<Data>)step).cleanup(context, data, id, progress);
+ if (step instanceof IExtendedContextStep) {
+ ((IExtendedContextStep)step).cleanup(context, data, id, progress);
}
long endTime = System.currentTimeMillis();
@@ -145,7 +146,7 @@ public abstract class AbstractContextStepExecutor<Data extends Object> implement
}
}
- private void normalizeStatus(IContextStep<Data> step, IFullQualifiedId id, IContext context , Data data, IStatus status) throws CoreException {
+ private void normalizeStatus(IContextStep step, IFullQualifiedId id, IContext context , IPropertiesContainer data, IStatus status) throws CoreException {
Assert.isNotNull(context);
Assert.isNotNull(data);
Assert.isNotNull(id);
@@ -184,6 +185,6 @@ public abstract class AbstractContextStepExecutor<Data extends Object> implement
* @param data The step data.
* @return Formatted message.
*/
- protected abstract String formatMessage(String message, int severity, IContextStep<Data> step, IFullQualifiedId id, IContext context, Data data);
+ protected abstract String formatMessage(String message, int severity, IContextStep step, IFullQualifiedId id, IContext context, IPropertiesContainer data);
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/AbstractContextStepGroup.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/AbstractContextStepGroup.java
index 21bf4d7fd..d8ab17b3a 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/AbstractContextStepGroup.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/AbstractContextStepGroup.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tm.te.runtime.stepper;
+package org.eclipse.tm.te.runtime.stepper.extensions;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -20,14 +20,14 @@ import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupable;
/**
* Abstract context step group implementation.
*/
-public abstract class AbstractContextStepGroup<Data extends Object> extends ExecutableExtension implements IContextStepGroup<Data> {
+public abstract class AbstractContextStepGroup extends ExecutableExtension implements IContextStepGroup {
- private ExecutableExtensionProxy<IContextStepGroupIterator<Data>> iteratorProxy = null;
+ private ExecutableExtensionProxy<IContextStepGroupIterator> iteratorProxy = null;
/**
* Constant to be returned in case the step group contains no steps.
*/
- protected final static IContextStepGroupable<?>[] NO_STEPS = new IContextStepGroupable<?>[0];
+ protected final static IContextStepGroupable[] NO_STEPS = new IContextStepGroupable[0];
/**
* Constructor.
@@ -45,14 +45,14 @@ public abstract class AbstractContextStepGroup<Data extends Object> extends Exec
}
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
*/
@Override
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- super.setInitializationData(config, propertyName, data);
+ public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ super.doSetInitializationData(config, propertyName, data);
if (iteratorProxy == null) {
- iteratorProxy = new ExecutableExtensionProxy<IContextStepGroupIterator<Data>>(config) {
+ iteratorProxy = new ExecutableExtensionProxy<IContextStepGroupIterator>(config) {
@Override
protected String getExecutableExtensionAttributeName() {
return "iterator"; //$NON-NLS-1$
@@ -65,7 +65,7 @@ public abstract class AbstractContextStepGroup<Data extends Object> extends Exec
* @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroup#getStepGroupIterator()
*/
@Override
- public IContextStepGroupIterator<Data> getStepGroupIterator() {
+ public IContextStepGroupIterator getStepGroupIterator() {
return iteratorProxy != null ? iteratorProxy.newInstance() : null;
}
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/AbstractContextStepper.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/AbstractContextStepper.java
index 8ff01db28..83d8084df 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/AbstractContextStepper.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/AbstractContextStepper.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tm.te.runtime.stepper;
+package org.eclipse.tm.te.runtime.stepper.extensions;
import java.text.MessageFormat;
import java.util.ArrayList;
@@ -28,6 +28,7 @@ import org.eclipse.tm.te.runtime.concurrent.util.ExecutorsUtil;
import org.eclipse.tm.te.runtime.extensions.ExecutableExtension;
import org.eclipse.tm.te.runtime.interfaces.ISharedConstants;
import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tm.te.runtime.stepper.StepperAttributeUtil;
import org.eclipse.tm.te.runtime.stepper.activator.CoreBundleActivator;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContext;
import org.eclipse.tm.te.runtime.stepper.interfaces.IContextManipulator;
@@ -48,11 +49,11 @@ import org.eclipse.tm.te.runtime.utils.StatusHelper;
/**
* An abstract stepper implementation.
*/
-public abstract class AbstractContextStepper<Data extends Object> extends ExecutableExtension implements IStepper<Data>, IContextManipulator<Data> {
+public abstract class AbstractContextStepper extends ExecutableExtension implements IStepper, IContextManipulator {
private boolean initialized = false;
private boolean finished = false;
- private Data data = null;
+ private IPropertiesContainer data = null;
private IFullQualifiedId fullQualifiedId = null;
private IProgressMonitor monitor = null;
private String activeContextId = null;
@@ -61,9 +62,9 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
protected class ExecutedContextStep {
final IFullQualifiedId id;
- final IContextStep<Data> step;
+ final IContextStep step;
- public ExecutedContextStep(IFullQualifiedId id, IContextStep<Data> step) {
+ public ExecutedContextStep(IFullQualifiedId id, IContextStep step) {
this.id = id;
this.step = step;
}
@@ -99,23 +100,23 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
/**
* Returns the variant delegate to use or <code>null</code>.
*/
- protected abstract IVariantDelegate<Data> getVariantDelegate() throws CoreException;
+ protected abstract IVariantDelegate getVariantDelegate() throws CoreException;
/**
* Creates a new instance of the step executor to use for executing a step.
*/
- protected abstract IContextStepExecutor<Data> doCreateStepExecutor(IContextStep<Data> step, String secondaryId, IFullQualifiedId fullQualifiedStepId);
+ protected abstract IContextStepExecutor doCreateStepExecutor(IContextStep step, String secondaryId, IFullQualifiedId fullQualifiedStepId);
/**
* Returns the step group for the given arguments.
*/
- protected abstract IContextStepGroup<Data> getStepGroup(String type, String subType, String variant);
+ protected abstract IContextStepGroup getStepGroup(String type, String subType, String variant);
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.stepper.interfaces.IStepper#initialize(java.lang.Object, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ * @see org.eclipse.tm.te.runtime.stepper.interfaces.IStepper#initialize(org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tm.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
- public void initialize(Data data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws IllegalStateException {
+ public void initialize(IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws IllegalStateException {
Assert.isNotNull(data);
Assert.isNotNull(fullQualifiedId);
Assert.isNotNull(monitor);
@@ -258,7 +259,7 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
*
* @return The data or <code>null</code>
*/
- protected final Data getData() {
+ protected final IPropertiesContainer getData() {
return isInitialized() ? data : null;
}
@@ -406,7 +407,7 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
Assert.isNotNull(statusContainer);
// Get the variant delegate
- IVariantDelegate<Data> variantDelegate = getVariantDelegate();
+ IVariantDelegate variantDelegate = getVariantDelegate();
String[] variants = null;
if (variantDelegate != null) {
// Determine the valid variants
@@ -414,7 +415,7 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
}
// Get the step group
- IContextStepGroup<Data> stepGroup = null;
+ IContextStepGroup stepGroup = null;
if (variants != null) {
for (String variant : variants) {
stepGroup = getStepGroup(getType(), getSubType(), variant);
@@ -452,7 +453,7 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
*
* @throws CoreException If the execution fails.
*/
- private void executeStepGroup(IContextStepGroup<Data> stepGroup, List<IStatus> statusContainer, List<ExecutedContextStep> executedSteps, IFullQualifiedId fullQualifiedGroupId) throws CoreException {
+ private void executeStepGroup(IContextStepGroup stepGroup, List<IStatus> statusContainer, List<ExecutedContextStep> executedSteps, IFullQualifiedId fullQualifiedGroupId) throws CoreException {
Assert.isNotNull(stepGroup);
Assert.isNotNull(statusContainer);
Assert.isNotNull(executedSteps);
@@ -467,7 +468,7 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
CoreBundleActivator.getTraceHandler().trace("AbstractContextStepper#execute: step group: '" + stepGroup.getLabel() + "'", //$NON-NLS-1$ //$NON-NLS-2$
0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
- IContextStepGroupIterator<Data> iterator = stepGroup.getStepGroupIterator();
+ IContextStepGroupIterator iterator = stepGroup.getStepGroupIterator();
IFullQualifiedId fullQualifiedIterationId = fullQualifiedGroupId;
int iteration = 0;
@@ -481,7 +482,7 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
fullQualifiedIterationId = fullQualifiedGroupId.createChildId(ID_TYPE_STEP_GROUP_ITERATION_ID, iterator.getId(), ""+iteration); //$NON-NLS-1$
iterator.next(getActiveContext(), getData(), fullQualifiedIterationId, getMonitor());
// set the active context if the step has manipulated it
- if (iterator instanceof IContextManipulator<?>) {
+ if (iterator instanceof IContextManipulator) {
IContext newContext =
(IContext)StepperAttributeUtil.getProperty(IContextManipulator.CONTEXT, fullQualifiedIterationId, getData());
String newContextId =
@@ -496,8 +497,8 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
}
}
// Get the list of steps or step groups to execute.
- IContextStepGroupable<Data>[] groupables = stepGroup.getSteps(getType(), getSubType());
- for (IContextStepGroupable<Data> groupable : groupables) {
+ IContextStepGroupable[] groupables = stepGroup.getSteps(getType(), getSubType());
+ for (IContextStepGroupable groupable : groupables) {
executeGroupable(groupable, statusContainer, executedSteps, fullQualifiedIterationId);
}
iteration++;
@@ -516,7 +517,7 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
*
* @throws CoreException If the execution failed.
*/
- private void executeGroupable(IContextStepGroupable<Data> groupable, List<IStatus> statusContainer, List<ExecutedContextStep> executedSteps, IFullQualifiedId fullQualifiedParentId) throws CoreException {
+ private void executeGroupable(IContextStepGroupable groupable, List<IStatus> statusContainer, List<ExecutedContextStep> executedSteps, IFullQualifiedId fullQualifiedParentId) throws CoreException {
Assert.isNotNull(groupable);
Assert.isNotNull(statusContainer);
Assert.isNotNull(executedSteps);
@@ -539,22 +540,22 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
// Check if all dependencies of the groupable have been executed before
checkForDependenciesExecuted(groupable, executedSteps);
- if (groupable.getExtension() instanceof IContextStepGroup<?>) {
+ if (groupable.getExtension() instanceof IContextStepGroup) {
IFullQualifiedId id = fullQualifiedParentId.createChildId(ID_TYPE_STEP_GROUP_ID, groupable.getExtension().getId(), groupable.getSecondaryId());
// If the passed in groupable is associated with a step group
// -> get the groupable from that group and execute them
- executeStepGroup((IContextStepGroup<Data>)groupable.getExtension(), statusContainer, executedSteps, id);
+ executeStepGroup((IContextStepGroup)groupable.getExtension(), statusContainer, executedSteps, id);
}
- else if (groupable.getExtension() instanceof IContextStep<?>) {
+ else if (groupable.getExtension() instanceof IContextStep) {
// If the passed in groupable is associated with a step
// -> check if the required steps have been executed before,
// create a step executor and invoke the executor.
- IContextStep<Data> step = (IContextStep<Data>)groupable.getExtension();
+ IContextStep step = (IContextStep)groupable.getExtension();
IFullQualifiedId id = fullQualifiedParentId.createChildId(ID_TYPE_STEP_ID, step.getId(), groupable.getSecondaryId());
// Create the step executor now
- IContextStepExecutor<Data> executor = doCreateStepExecutor(step, groupable.getSecondaryId(), id);
+ IContextStepExecutor executor = doCreateStepExecutor(step, groupable.getSecondaryId(), id);
Assert.isNotNull(executor);
try {
@@ -562,7 +563,7 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
// Invoke the executor now
executor.execute(step, id, getActiveContext(), getData(), getMonitor());
// set the active context if the step has manipulated it
- if (step instanceof IContextManipulator<?>) {
+ if (step instanceof IContextManipulator) {
IContext newContext = (IContext)StepperAttributeUtil.getProperty(IContextManipulator.CONTEXT, id, getData());
String newContextId = StepperAttributeUtil.getStringProperty(IContextManipulator.CONTEXT_ID, id, getData());
if (newContext != null) {
@@ -603,15 +604,15 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
*
* @throws CoreException If a dependency has not been executed before.
*/
- protected void checkForDependenciesExecuted(IContextStepGroupable<Data> groupable, List<ExecutedContextStep> executedSteps) throws CoreException {
+ protected void checkForDependenciesExecuted(IContextStepGroupable groupable, List<ExecutedContextStep> executedSteps) throws CoreException {
Assert.isNotNull(groupable);
Assert.isNotNull(executedSteps);
// Build up the complete list of dependencies.
List<String> dependencies = new ArrayList<String>(Arrays.asList(groupable.getDependencies()));
// If the groupable wraps a step, the step can have additional dependencies to check
- if (groupable.getExtension() instanceof IContextStep<?>) {
- dependencies.addAll(Arrays.asList(((IContextStep<?>)groupable.getExtension()).getDependencies()));
+ if (groupable.getExtension() instanceof IContextStep) {
+ dependencies.addAll(Arrays.asList(((IContextStep)groupable.getExtension()).getDependencies()));
}
// Check each dependency now.
@@ -633,7 +634,7 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
if (!requiredStepExecuted) {
throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(),
MessageFormat.format(Messages.AbstractContextStepper_error_requiredStepNotExecuted,
- NLS.bind((groupable.getExtension() instanceof IContextStep<?>
+ NLS.bind((groupable.getExtension() instanceof IContextStep
? Messages.AbstractContextStepper_error_step
: Messages.AbstractContextStepper_error_requiredStepOrGroup), dependency),
NLS.bind(Messages.AbstractContextStepper_error_typeAndSubtype, getType(), getSubType()))));
@@ -667,7 +668,7 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
setProperty(PROPERTY_IS_DONE, false);
ExecutedContextStep executedStep = executedSteps.remove(executedSteps.size()-1);
if (executedStep.step instanceof IExtendedContextStep) {
- IExtendedContextStep<Data> step = (IExtendedContextStep<Data>)executedStep.step;
+ IExtendedContextStep step = (IExtendedContextStep)executedStep.step;
step.rollback(getActiveContext(), getData(), rollBackStatus, executedStep.id, rollbackProgress, this);
}
else {
@@ -695,18 +696,18 @@ public abstract class AbstractContextStepper<Data extends Object> extends Execut
*
* @throws CoreException If the total work of the step group cannot be determined.
*/
- protected int calculateTotalWork(IContextStepGroup<Data> stepGroup) throws CoreException {
+ protected int calculateTotalWork(IContextStepGroup stepGroup) throws CoreException {
Assert.isNotNull(stepGroup);
int totalWork = 0;
// Loop the group steps and summarize the returned total work
- IContextStepGroupable<Data>[] groupables = stepGroup.getSteps(getType(), getSubType());
- for (IContextStepGroupable<Data> groupable : groupables) {
- int work = groupable.getExtension() instanceof IContextStep<?>
- ? ((IContextStep<Data>)groupable.getExtension()).getTotalWork(getActiveContext(), getData())
- : groupable.getExtension() instanceof IContextStepGroup<?>
- ? calculateTotalWork((IContextStepGroup<Data>)groupable.getExtension())
+ IContextStepGroupable[] groupables = stepGroup.getSteps(getType(), getSubType());
+ for (IContextStepGroupable groupable : groupables) {
+ int work = groupable.getExtension() instanceof IContextStep
+ ? ((IContextStep)groupable.getExtension()).getTotalWork(getActiveContext(), getData())
+ : groupable.getExtension() instanceof IContextStepGroup
+ ? calculateTotalWork((IContextStepGroup)groupable.getExtension())
: IProgressMonitor.UNKNOWN;
if (work == IProgressMonitor.UNKNOWN) {
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/ContextStepGroup.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/ContextStepGroup.java
new file mode 100644
index 000000000..626301c7d
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/ContextStepGroup.java
@@ -0,0 +1,814 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tm.te.runtime.stepper.extensions;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+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.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.tm.te.runtime.interfaces.extensions.IExecutableExtension;
+import org.eclipse.tm.te.runtime.stepper.StepperManager;
+import org.eclipse.tm.te.runtime.stepper.activator.CoreBundleActivator;
+import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep;
+import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroup;
+import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupable;
+import org.eclipse.tm.te.runtime.stepper.interfaces.IExtendedContextStep;
+import org.eclipse.tm.te.runtime.stepper.interfaces.tracing.ITraceIds;
+import org.eclipse.tm.te.runtime.stepper.nls.Messages;
+
+/**
+ * A default step group implementation.
+ */
+public class ContextStepGroup extends AbstractContextStepGroup {
+
+ private boolean locked;
+ private String baseOn;
+
+ private final List<ReferenceSubElement> references = new ArrayList<ReferenceSubElement>();
+
+ /**
+ * Step group reference sub element.
+ */
+ protected final static class ReferenceSubElement implements org.eclipse.core.runtime.IExecutableExtension {
+ private String id;
+ private String secondaryId;
+ private String insertBefore;
+ private String insertAfter;
+ private String overwrite;
+ private boolean removable;
+ private boolean hidden;
+ private boolean disable;
+ private boolean singleton;
+ private final List<String> dependencies = new ArrayList<String>();
+
+ /**
+ * Returns the id of the referenced step or step group.
+ *
+ * @return The id of the referenced step or step group.
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Returns the secondary id of the referenced step or step group.
+ *
+ * @return The secondary id or <code>null</code>.
+ */
+ public String getSecondaryId() {
+ return secondaryId;
+ }
+
+ /**
+ * Sets the secondary id of the referenced step or step group.
+ *
+ * @return The secondary id or <code>null</code>.
+ */
+ public void setSecondardId(String secondaryId) {
+ this.secondaryId = secondaryId;
+ }
+
+ /**
+ * Returns the id of the step or step group the referenced
+ * step or group shall be inserted before.
+ *
+ * @return The id or <code>null</code>.
+ */
+ public String getInsertBefore() {
+ return insertBefore;
+ }
+
+ /**
+ * Returns the id of the step or step group the referenced
+ * step or group shall be inserted after.
+ *
+ * @return The id or <code>null</code>.
+ */
+ public String getInsertAfter() {
+ return insertAfter;
+ }
+
+ /**
+ * Returns the id of the step or step group the referenced
+ * step or group do overwrite.
+ *
+ * @return The id or <code>null</code>.
+ */
+ public String getOverwrite() {
+ return overwrite;
+ }
+
+ /**
+ * Returns if or if not the referenced step or step group
+ * can be removed by the user from the group.
+ *
+ * @return <code>True</code> if removable, <code>false</code> otherwise.
+ */
+ public boolean isRemovable() {
+ return removable;
+ }
+
+ /**
+ * Returns if or if not the referenced step or step group
+ * is hidden.
+ *
+ * @return <code>True</code> if hidden, <code>false</code> otherwise.
+ */
+ public boolean isHidden() {
+ return hidden;
+ }
+
+ /**
+ * Returns if or if not to disable the referenced step or step group.
+ *
+ * @return <code>True</code> if to disable, <code>false</code> otherwise.
+ */
+ public boolean isDisable() {
+ return disable;
+ }
+
+ /**
+ * Returns if or if not the referenced step or step group is a singleton.
+ *
+ * @return <code>True</code> if singleton, <code>false</code> otherwise.
+ */
+ public boolean isSingleton() {
+ return singleton;
+ }
+
+ /**
+ * Returns the list of dependencies.
+ * <p>
+ * The step or step group id might be fully qualified using the form
+ * <code>&quot;primaryId##secondaryId</code>. The <code>secondaryId</code> is optional.
+ *
+ * @return The list of dependencies or an empty list.
+ */
+ public String[] getDependencies() {
+ return dependencies.toArray(new String[dependencies.size()]);
+ }
+
+ /* (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 (config == null) {
+ return;
+ }
+
+ String value = config.getAttribute("id"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.id = value.trim();
+ }
+
+ value = config.getAttribute("secondaryId"); //$NON-NLS-1$
+ setSecondardId(value != null && value.trim().length() > 0 ? value.trim() : null);
+
+ value = config.getAttribute("insertBefore"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.insertBefore = value.trim();
+ }
+
+ value = config.getAttribute("insertAfter"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.insertAfter = value.trim();
+ }
+
+ value = config.getAttribute("overwrite"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.overwrite = value.trim();
+ }
+
+ value = config.getAttribute("removable"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.removable = Boolean.parseBoolean(value.trim());
+ }
+
+ value = config.getAttribute("hidden"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.hidden = Boolean.parseBoolean(value.trim());
+ }
+
+ value = config.getAttribute("disable"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.disable = Boolean.parseBoolean(value.trim());
+ }
+
+ value = config.getAttribute("singleton"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.singleton = Boolean.parseBoolean(value.trim());
+ }
+
+ // Read in the list of dependencies if specified.
+ dependencies.clear();
+ IConfigurationElement[] requires = config.getChildren("requires"); //$NON-NLS-1$
+ for (IConfigurationElement require : requires) {
+ value = require.getAttribute("id"); //$NON-NLS-1$
+ if (value == null || value.trim().length() == 0) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ 0,
+ NLS.bind(Messages.AbstractContextStep_error_missingRequiredAttribute,
+ "dependency id (requires)", //$NON-NLS-1$
+ config.getName()),
+ null));
+ }
+ if (!dependencies.contains(value.trim())) {
+ dependencies.add(value.trim());
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (getId() != null && obj instanceof ReferenceSubElement) {
+ boolean secondaryIdEquals = false;
+ if (getSecondaryId() == null) {
+ secondaryIdEquals = ((ReferenceSubElement)obj).getSecondaryId() == null;
+ }
+ else {
+ secondaryIdEquals = getSecondaryId().equals(((ReferenceSubElement)obj).getSecondaryId());
+ }
+
+ return getId().equals(((ReferenceSubElement)obj).getId()) && secondaryIdEquals;
+ }
+ return super.equals(obj);
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return getId() != null ? getId().hashCode() + (getSecondaryId() != null ? getSecondaryId().hashCode() : 0) : super.hashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ StringBuffer buffer = new StringBuffer(getClass().getSimpleName());
+ buffer.append(": "); //$NON-NLS-1$
+ buffer.append("id = " + getId()); //$NON-NLS-1$
+ buffer.append(", secondaryId = " + getSecondaryId()); //$NON-NLS-1$
+ buffer.append(", insertBefore = " + getInsertBefore()); //$NON-NLS-1$
+ buffer.append(", insertAfter = " + getInsertAfter()); //$NON-NLS-1$
+ buffer.append(", overwrite = " + getOverwrite()); //$NON-NLS-1$
+ buffer.append(", removable = " + isRemovable()); //$NON-NLS-1$
+ buffer.append(", hidden = " + isHidden()); //$NON-NLS-1$
+ buffer.append(", disable = " + isDisable()); //$NON-NLS-1$
+ buffer.append(", singleton = " + isSingleton()); //$NON-NLS-1$
+ return buffer.toString();
+ }
+ }
+
+ /**
+ * Constructor.
+ */
+ public ContextStepGroup() {
+ super();
+ locked = false;
+ baseOn = null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.stepper.AbstractContextStepGroup#isLocked()
+ */
+ @Override
+ public boolean isLocked() {
+ return locked;
+ }
+
+ /**
+ * Returns the id of the step group this step group is
+ * initially based on.
+ *
+ * @return The id or <code>null</code>.
+ */
+ protected String getBaseOn() {
+ return baseOn;
+ }
+
+ /**
+ * Returns the references.
+ */
+ protected List<ReferenceSubElement> getReferences() {
+ return references;
+ }
+
+ /**
+ * Check for duplicates of the referenced step or step group. The check
+ * will fail if multiple occurrence of a step or step group are found and
+ * the step or step group is supposed to be a singleton.
+ *
+ * @param steps The list of steps. Must not be <code>null</code>.
+ * @param reference The reference. Must not be <code>null</code>.
+ * @param type The type id. Must not be <code>null</code>.
+ * @param mode The sub type id. Must not be <code>null</code>.
+ *
+ * @throws CoreException If multiple occurrences of singleton references are found.
+ */
+ protected void checkForDuplicates(List<IContextStepGroupable> steps, ReferenceSubElement reference, String type, String mode) throws CoreException {
+ assert steps != null && reference != null;
+
+ // If the reference overwrites another reference, it is not a duplicate
+ String overwrite = reference.getOverwrite();
+ if (overwrite != null && overwrite.length() > 0) {
+ return;
+ }
+
+ boolean checkFailed = false;
+
+ for (IContextStepGroupable step : steps) {
+ if (step.getExtension().getId().equals(reference.getId())) {
+ // We've found an existing groupable with the reference id.
+ // If either the groupable, the reference or the extension is
+ // marked singleton, than this is an failure.
+ checkFailed = step.isSingleton() || reference.isSingleton()
+ || (step.getExtension() instanceof IExtendedContextStep
+ && ((IExtendedContextStep)step.getExtension()).isSingleton());
+ if (checkFailed) {
+ break;
+ }
+ }
+ }
+
+ if (checkFailed) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ MessageFormat.format(Messages.ContextStepGroup_error_multipleSingletonOccurrences,
+ NLS.bind(Messages.ContextStepGroup_error_stepGroup, getLabel()),
+ NLS.bind(Messages.ContextStepGroup_error_referencedStepOrGroup, reference.getId()),
+ NLS.bind(Messages.ContextStepGroup_error_typeAndMode, type, mode))
+ ));
+ }
+ }
+
+ /**
+ * Replace all references to a given step or step group with another one.
+ *
+ * @param steps The list of steps. Must not be <code>null</code>.
+ * @param oldId The id of the step or step group to replace. Must not be <code>null</code>.
+ * @param replacement The replacement. Must not be <code>null</code>.
+ * @param reference The reference sub element. Must not be <code>null</code>.
+ *
+ * @return The list of affected groupable's or an empty list.
+ */
+ protected List<IContextStepGroupable> onOverwrite(List<IContextStepGroupable> steps, String oldId, IExecutableExtension replacement, ReferenceSubElement reference) {
+ assert steps != null && oldId != null && replacement != null && reference != null;
+
+ List<IContextStepGroupable> affected = new ArrayList<IContextStepGroupable>();
+
+ // Isolate primary and secondary id
+ String primaryId = oldId;
+ String secondaryId = null;
+
+ String[] splitted = oldId.split("##", 2); //$NON-NLS-1$
+ if (splitted.length == 2) {
+ primaryId = splitted[0];
+ secondaryId = splitted[1];
+ }
+
+ for (IContextStepGroupable step : steps) {
+ // A step is clearly affected if the primary id and the secondary
+ // id (if any) matches the overwritten id
+ if (step.getExtension().getId().equals(primaryId)
+ && (secondaryId == null || secondaryId.equals(step.getSecondaryId()))) {
+ if (step instanceof ContextStepGroupable) {
+ ContextStepGroupable groupable = ((ContextStepGroupable)step);
+ // Update the grouped extension
+ groupable.setExtension(replacement);
+ // Update the groupable secondary id
+ groupable.setSecondaryId(reference.getSecondaryId());
+ // Add the groupable to the list of affected steps
+ affected.add(step);
+ }
+ }
+
+ // A step is affected as well if the step depends on the overwritten step
+ // In this case we have to update the dependencies.
+ List<String> dependencies = new ArrayList<String>(Arrays.asList(step.getDependencies()));
+ if (dependencies.contains(oldId)) {
+ String fullId = replacement.getId() + (reference.getSecondaryId() != null ? "##" + reference.getSecondaryId() : ""); //$NON-NLS-1$ //$NON-NLS-2$
+ // We have to replace the dependency at the exact position within the list
+ dependencies.set(dependencies.indexOf(oldId), fullId);
+ if (step instanceof ContextStepGroupable) {
+ ((ContextStepGroupable)step).setDependencies(dependencies.toArray(new String[dependencies.size()]));
+ }
+ }
+ }
+
+ return affected;
+ }
+
+ /**
+ * Insert the step before the specified step or step group. If no step or
+ * step group with the given id exist, the step is added to the end.
+ *
+ * @param steps The list of steps. Must not be <code>null</code>.
+ * @param id The id of the step or step group where to insert the new step before. Must not be <code>null</code>.
+ * @param newStep The step to add. Must not be <code>null</code>.
+ * @param reference The reference sub element. Must not be <code>null</code>.
+ *
+ * @return The list of affected groupable's or an empty list.
+ */
+ protected List<IContextStepGroupable> onInsertBefore(List<IContextStepGroupable> steps, String id, IExecutableExtension newStep, ReferenceSubElement reference) {
+ assert steps != null && id != null && newStep != null && reference != null;
+
+ List<IContextStepGroupable> affected = new ArrayList<IContextStepGroupable>();
+
+ // Isolate primary and secondary id
+ String primaryId = id;
+ String secondaryId = null;
+
+ String[] splitted = id.split("##", 2); //$NON-NLS-1$
+ if (splitted.length == 2) {
+ primaryId = splitted[0];
+ secondaryId = splitted[1];
+ }
+
+ // Always loop over all steps in case the anchor step is available
+ // multiple times. In such case, the new step is inserted at all
+ // occurrences.
+ for (int i = 0; i < steps.size(); i++) {
+ IContextStepGroupable step = steps.get(i);
+ if (!step.getExtension().getId().equals(primaryId)) {
+ continue;
+ }
+ if (secondaryId != null && !secondaryId.equals(step.getSecondaryId())) {
+ continue;
+ }
+
+ // Create a new groupable object for inserting
+ IContextStepGroupable groupable = new ContextStepGroupable(newStep, reference.getSecondaryId());
+ // Insert the new step at the current position
+ steps.add(i, groupable);
+ // And increase the counter --> Otherwise we would see the
+ // same step we want to insert before again!
+ i++;
+ // Add the new groupable to the list of affected steps
+ affected.add(groupable);
+ }
+
+ // If the step could not be added, add to the end of the list
+ if (affected.isEmpty()) {
+ IContextStepGroupable groupable = new ContextStepGroupable(newStep, reference.getSecondaryId());
+ steps.add(groupable);
+ }
+
+ return affected;
+ }
+
+ /**
+ * Insert the step after the specified step or step group. If no step or
+ * step group with the given id exist, the step is added to the end.
+ *
+ * @param steps The list of steps. Must not be <code>null</code>.
+ * @param id The id of the step or step group where to insert the new step after. Must not be <code>null</code>.
+ * @param newStep The step to add. Must not be <code>null</code>.
+ * @param reference The reference sub element. Must not be <code>null</code>.
+ *
+ * @return The list of affected groupable's or an empty list.
+ */
+ protected List<IContextStepGroupable> onInsertAfter(List<IContextStepGroupable> steps, String id, IExecutableExtension newStep, ReferenceSubElement reference) {
+ assert steps != null && id != null && newStep != null && reference != null;
+
+ List<IContextStepGroupable> affected = new ArrayList<IContextStepGroupable>();
+
+ // Isolate primary and secondary id
+ String primaryId = id;
+ String secondaryId = null;
+
+ String[] splitted = id.split("##", 2); //$NON-NLS-1$
+ if (splitted.length == 2) {
+ primaryId = splitted[0];
+ secondaryId = splitted[1];
+ }
+
+ // Always loop over all steps in case the anchor step is available
+ // multiple times. In such case, the new step is inserted at all
+ // occurrences.
+ for (int i = 0; i < steps.size(); i++) {
+ IContextStepGroupable step = steps.get(i);
+ if (!step.getExtension().getId().equals(primaryId)) {
+ continue;
+ }
+ if (secondaryId != null && !secondaryId.equals(step.getSecondaryId())) {
+ continue;
+ }
+
+ // Create a new groupable object for inserting
+ IContextStepGroupable groupable = new ContextStepGroupable(newStep, reference.getSecondaryId());
+ // Insert the new groupable after the current step or at the end (if i + 1 == steps.size())
+ steps.add(i + 1, groupable);
+ // Add the new groupable to the list of affected steps
+ affected.add(groupable);
+ }
+
+ // If the step could not be added, add to the end of the list
+ if (affected.isEmpty()) {
+ IContextStepGroupable groupable = new ContextStepGroupable(newStep, reference.getSecondaryId());
+ steps.add(groupable);
+ }
+
+ return affected;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroup#getSteps(java.lang.String, java.lang.String)
+ */
+ @Override
+ public IContextStepGroupable[] getSteps(String type, String mode) throws CoreException {
+ assert type != null && mode != null;
+
+ // The list of resolved steps for the specified type and mode
+ List<IContextStepGroupable> steps = new ArrayList<IContextStepGroupable>();
+
+ // If this step group is based on another step group, we have to get the resolved
+ // steps from there first.
+ if (getBaseOn() != null) {
+ IContextStepGroup baseStepGroup = getStepGroup(getBaseOn());
+ // If the base step group cannot be found, that's an error. We cannot continue
+ // without the base group.
+ if (baseStepGroup == null) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ MessageFormat.format(Messages.ContextStepGroup_error_missingBaseStepGroup,
+ NLS.bind(Messages.ContextStepGroup_error_stepGroup, getLabel()),
+ NLS.bind(Messages.ContextStepGroup_error_referencedBaseGroup, getBaseOn()),
+ NLS.bind(Messages.ContextStepGroup_error_typeAndMode, type, mode))
+ ));
+ }
+
+ // Add all the steps from the base step group now to the list
+ steps.addAll(Arrays.asList(baseStepGroup.getSteps(type, mode)));
+ }
+
+ // Now process the references and modify the steps list accordingly
+ for (ReferenceSubElement reference : getReferences()) {
+ // Get the step or step group for the referenced id. Try the steps first.
+ IExecutableExtension candidate = getStep(reference.getId());
+ if (candidate == null) {
+ candidate = getStepGroup(reference.getId());
+ }
+
+ // If the candidate is null here, that's an error as a referenced step is missing.
+ if (candidate == null) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ MessageFormat.format(Messages.ContextStepGroup_error_missingReferencedStep,
+ NLS.bind(Messages.ContextStepGroup_error_stepGroup, getLabel()),
+ NLS.bind(Messages.ContextStepGroup_error_referencedStepOrGroup, reference.getId()),
+ NLS.bind(Messages.ContextStepGroup_error_typeAndMode, type, mode))
+ ));
+ }
+
+ // Check if the step is valid for the current launch configuration type and mode.
+ if (candidate instanceof IContextStep) {
+ boolean valid = isValidStep(candidate.getId(), type, mode);
+
+ if (!valid) {
+ CoreBundleActivator.getTraceHandler().trace(
+ "StepGroup#getSteps: SKIPPED step = '" + candidate.getLabel() + "'." //$NON-NLS-1$ //$NON-NLS-2$
+ + " Not valid for type id '" + type + "'" //$NON-NLS-1$ //$NON-NLS-2$
+ + " and mode '" + mode + "'", //$NON-NLS-1$ //$NON-NLS-2$
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+ continue;
+ }
+ }
+
+ // Check for duplicates of singleton references.
+ checkForDuplicates(steps, reference, type, mode);
+
+ // Check for the steps own dependencies to be valid for the current type id and mode
+ if (candidate instanceof IContextStep) {
+ checkForDependenciesValid((IContextStep) candidate, type, mode);
+ }
+
+ // Will contain the list of affected groupables from the whole list
+ List<IContextStepGroupable> affectedGroupables = new ArrayList<IContextStepGroupable>();
+
+ // Check first for overwriting groupables
+ String overwrite = reference.getOverwrite();
+ if (overwrite != null && overwrite.length() > 0) {
+ affectedGroupables.addAll(onOverwrite(steps, overwrite, candidate, reference));
+ } else {
+ // overwrite is not set -> process insertBefore or insertAfter
+ String insertBefore = reference.getInsertBefore();
+ String insertAfter = reference.getInsertAfter();
+
+ // If neither one is specified, the step or step group will be to the end of the list
+ if ((insertBefore == null || insertBefore.length() == 0)
+ && (insertAfter == null || insertAfter.length() == 0)) {
+ IContextStepGroupable groupable = new ContextStepGroupable(candidate, reference.getSecondaryId());
+ steps.add(groupable);
+ affectedGroupables.add(groupable);
+ } else {
+ // insertBefore comes first
+ if (insertBefore != null && insertBefore.length() > 0) {
+ affectedGroupables.addAll(onInsertBefore(steps, insertBefore, candidate, reference));
+ } else {
+ affectedGroupables.addAll(onInsertAfter(steps, insertAfter, candidate, reference));
+ }
+ }
+ }
+
+ // Process the groupable attributes on all affected groupables
+ for (IContextStepGroupable step : affectedGroupables) {
+ if (!(step instanceof ContextStepGroupable)) {
+ continue;
+ }
+
+ ContextStepGroupable groupable = (ContextStepGroupable)step;
+ groupable.setDependencies(reference.getDependencies());
+
+ if (!reference.isRemovable() && groupable.isRemovable()) {
+ groupable.setRemovable(reference.isRemovable());
+ }
+ if (reference.isHidden() && !groupable.isHidden()) {
+ groupable.setHidden(reference.isHidden());
+ }
+ if (reference.isDisable() && !groupable.isDisabled()) {
+ groupable.setDisabled(reference.isDisable());
+ }
+ if (reference.isSingleton() && !groupable.isSingleton()) {
+ groupable.setSingleton(reference.isSingleton());
+ }
+ }
+ }
+
+ return !steps.isEmpty() ? steps.toArray(new IContextStepGroupable[steps.size()]) : NO_STEPS;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ references.clear();
+ super.setInitializationData(config, propertyName, data);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.stepper.extensions.AbstractContextStepGroup#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ super.doSetInitializationData(config, propertyName, data);
+
+ if (!locked) {
+ String lockedAttribute = config.getAttribute("locked"); //$NON-NLS-1$
+ if (lockedAttribute != null) {
+ this.locked = Boolean.parseBoolean(lockedAttribute);
+ }
+ }
+
+ if (baseOn == null || baseOn.trim().length() == 0) {
+ String baseOnAttribute = config.getAttribute("baseOn"); //$NON-NLS-1$
+ if (baseOnAttribute != null && baseOnAttribute.trim().length() > 0) {
+ this.baseOn = baseOnAttribute.trim();
+ }
+ }
+
+ Map<String, Integer> occurrences = new HashMap<String, Integer>();
+ IConfigurationElement[] childElements = config.getChildren("references"); //$NON-NLS-1$
+ for (IConfigurationElement childElement : childElements) {
+ IConfigurationElement[] references = childElement.getChildren("reference"); //$NON-NLS-1$
+ for (IConfigurationElement reference : references) {
+ ReferenceSubElement candidate = new ReferenceSubElement();
+ candidate.setInitializationData(reference, reference.getName(), null);
+ // If multiple references to the same step or step group exist, check
+ // for the secondaryId
+ if (occurrences.containsKey(candidate.getId())) {
+ // Occurrences are counted up always
+ int number = occurrences.get(candidate.getId()).intValue() + 1;
+ occurrences.put(candidate.getId(), Integer.valueOf(number));
+
+ if (candidate.getSecondaryId() == null) {
+ // secondaryId not explicitly set -> auto set
+ candidate.setSecondardId(Integer.toString(number));
+ }
+ } else {
+ // remember the occurrence of the reference
+ occurrences.put(candidate.getId(), Integer.valueOf(1));
+ }
+
+ // References are not sorted out here. That's the task of the resolver.
+ this.references.add(candidate);
+ }
+ }
+ }
+
+
+ /**
+ * Checks is all dependencies of the given step are available
+ * and valid for the given type id and mode.
+ *
+ * @param step The step. Must not be <code>null</code>.
+ * @param type The type id. Must not be <code>null</code>.
+ * @param mode The mode. Must not be <code>null</code>.
+ *
+ * @throws CoreException If a required step or step group is not available or not valid.
+ */
+ protected void checkForDependenciesValid(IContextStep step, String type, String mode) throws CoreException {
+ assert step != null && type != null && mode != null;
+
+ String[] dependencies = step.getDependencies();
+ for (String dependency : dependencies) {
+ // Get the step or step group. Try the steps first.
+ IExecutableExtension candidate = getStep(dependency);
+ if (candidate == null) {
+ candidate = getStepGroup(dependency);
+ }
+
+ // If the candidate is null here, that's an error as a required step or step group is missing.
+ if (candidate == null) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ MessageFormat.format(Messages.ContextStepGroup_error_missingRequiredStep,
+ NLS.bind(Messages.ContextStepGroup_error_step, step.getLabel()),
+ NLS.bind(Messages.ContextStepGroup_error_requiredStepOrGroup, dependency),
+ NLS.bind(Messages.ContextStepGroup_error_typeAndMode, type, mode))
+ ));
+ }
+
+ // If the candidate a step, validate the step
+ if (candidate instanceof IContextStep) {
+ IContextStep candidateStep = (IContextStep)candidate;
+ boolean valid = isValidStep(candidateStep.getId(), type, mode);
+ if (!valid) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ MessageFormat.format(Messages.ContextStepGroup_error_invalidRequiredStep,
+ NLS.bind(Messages.ContextStepGroup_error_step, step.getLabel()),
+ NLS.bind(Messages.ContextStepGroup_error_requiredStep, dependency),
+ NLS.bind(Messages.ContextStepGroup_error_typeAndMode, type, mode))
+ ));
+ }
+
+ // Step is valid -> recursively check required steps.
+ checkForDependenciesValid(candidateStep, type, mode);
+ }
+ }
+ }
+
+ /**
+ * Convenience method returning a unique instance of the step
+ * identified by the given id.
+ *
+ * @param id The step id. Must not be <code>null</code>.
+ * @return The step instance or <code>null</code>.
+ */
+ protected IContextStep getStep(String id) {
+ Assert.isNotNull(id);
+ return StepperManager.getInstance().getStepExtManager().getStep(id, true);
+ }
+
+ /**
+ * Convenience method returning a unique instance of the step
+ * group identified by the given id.
+ *
+ * @param id The step id. Must not be <code>null</code>.
+ * @return The step group instance or <code>null</code>.
+ */
+ protected IContextStepGroup getStepGroup(String id) {
+ Assert.isNotNull(id);
+ return StepperManager.getInstance().getStepGroupExtManager().getStepGroup(id, true);
+ }
+
+ /**
+ * Returns if or if not the step identified by the given id is valid.
+ * <p>
+ * <b>Note:</b> The default implementation returns always <code>true</code>.
+ *
+ * @param id The step id. Must not be <code>null</code>.
+ * @param type The type id. Must not be <code>null</code>.
+ * @param mode The mode. Must not be <code>null</code>.
+ *
+ * @return <code>True</code> if the step is valid, <code>false</code> otherwise.
+ */
+ protected boolean isValidStep(String id, String type, String mode) {
+ return true;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/ContextStepGroupable.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/ContextStepGroupable.java
index 8874955b0..58901087e 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/ContextStepGroupable.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/extensions/ContextStepGroupable.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tm.te.runtime.stepper;
+package org.eclipse.tm.te.runtime.stepper.extensions;
import java.util.ArrayList;
import java.util.Arrays;
@@ -20,7 +20,7 @@ import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupable;
/**
* Context step groupable implementation.
*/
-public class ContextStepGroupable<Data extends Object> implements IContextStepGroupable<Data> {
+public class ContextStepGroupable implements IContextStepGroupable {
private String secondaryId = null;
private boolean disabled = false;
private boolean hidden = false;
@@ -51,8 +51,7 @@ public class ContextStepGroupable<Data extends Object> implements IContextStepGr
setSecondaryId(secondaryId);
}
- /*
- * (non-Javadoc)
+ /* (non-Javadoc)
* @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupable#getExtension()
*/
@Override
@@ -70,8 +69,7 @@ public class ContextStepGroupable<Data extends Object> implements IContextStepGr
this.extension = extension;
}
- /*
- * (non-Javadoc)
+ /* (non-Javadoc)
* @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupable#getSecondaryId()
*/
@Override
@@ -88,8 +86,7 @@ public class ContextStepGroupable<Data extends Object> implements IContextStepGr
this.secondaryId = secondaryId;
}
- /*
- * (non-Javadoc)
+ /* (non-Javadoc)
* @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupable#isDisabled()
*/
@Override
@@ -110,8 +107,7 @@ public class ContextStepGroupable<Data extends Object> implements IContextStepGr
this.disabled = disabled;
}
- /*
- * (non-Javadoc)
+ /* (non-Javadoc)
* @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupable#isHidden()
*/
@Override
@@ -132,8 +128,7 @@ public class ContextStepGroupable<Data extends Object> implements IContextStepGr
this.hidden = hidden;
}
- /*
- * (non-Javadoc)
+ /* (non-Javadoc)
* @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupable#isRemovable()
*/
@Override
@@ -154,8 +149,7 @@ public class ContextStepGroupable<Data extends Object> implements IContextStepGr
this.removable = removable;
}
- /*
- * (non-Javadoc)
+ /* (non-Javadoc)
* @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupable#isSingleton()
*/
@Override
@@ -174,8 +168,7 @@ public class ContextStepGroupable<Data extends Object> implements IContextStepGr
this.singleton = singleton;
}
- /*
- * (non-Javadoc)
+ /* (non-Javadoc)
* @see org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroupable#getDependencies()
*/
@Override
@@ -199,8 +192,7 @@ public class ContextStepGroupable<Data extends Object> implements IContextStepGr
this.dependencies.addAll(Arrays.asList(dependencies));
}
- /*
- * (non-Javadoc)
+ /* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextManipulator.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextManipulator.java
index 4ebfbf012..0fcb558df 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextManipulator.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextManipulator.java
@@ -13,7 +13,7 @@ package org.eclipse.tm.te.runtime.stepper.interfaces;
* A step or step group capable of modifying the context the steps or step
* groups are operating on.
*/
-public interface IContextManipulator<Data extends Object> {
+public interface IContextManipulator {
/**
* The suffix to append to the full qualified step id to
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStep.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStep.java
index eb5510dfc..168ef34f9 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStep.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStep.java
@@ -13,6 +13,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.tm.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tm.te.runtime.interfaces.extensions.IExecutableExtension;
+import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
/**
* A single step associated with a context.
@@ -26,7 +27,7 @@ import org.eclipse.tm.te.runtime.interfaces.extensions.IExecutableExtension;
* The status object is mandatory and cannot be <code>null</code>. If the step
* execution succeeds, an status with severity {@link IStatus#OK} is expected.
*/
-public interface IContextStep <Data extends Object> extends IExecutableExtension {
+public interface IContextStep extends IExecutableExtension {
/**
* Additional data property for ICallback.
@@ -42,14 +43,14 @@ public interface IContextStep <Data extends Object> extends IExecutableExtension
* @param monitor The progress monitor. Must not be <code>null</code>.
* @param callback The callback to invoke if finished. Must not be <code>null</code>.
*/
- public void execute(IContext context, Data data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback);
+ public void execute(IContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback);
/**
* Returns the number of total work the step is consuming.
*
* @return The number of total work or {@link IProgressMonitor#UNKNOWN}.
*/
- public int getTotalWork(IContext context, Data data);
+ public int getTotalWork(IContext context, IPropertiesContainer data);
/**
* Returns the list of required context step or context step group id's. The
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepExecutor.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepExecutor.java
index 40c13311a..7e90440b4 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepExecutor.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepExecutor.java
@@ -11,22 +11,23 @@ package org.eclipse.tm.te.runtime.stepper.interfaces;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
/**
* A step executor.
*/
-public interface IContextStepExecutor<Data extends Object> {
+public interface IContextStepExecutor {
/**
- * Executes the associated launch step.
+ * Executes the associated step.
*
* @param step The step to execute. Must not be <code>null</code>.
* @param id The full qualified step id. Must not be <code>null</code>.
- * @param context The launch context. Must not be <code>null</code>.
+ * @param context The context. Must not be <code>null</code>.
* @param data The data. Must not be <code>null</code>.
* @param monitor The progress monitor. Must not be <code>null</code>.
*
* @throws CoreException if the execution cannot be continue. The associated status should describe the failure cause.
*/
- public void execute(IContextStep<Data> step, IFullQualifiedId id, IContext context, Data data, IProgressMonitor monitor) throws CoreException;
+ public void execute(IContextStep step, IFullQualifiedId id, IContext context, IPropertiesContainer data, IProgressMonitor monitor) throws CoreException;
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroup.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroup.java
index e99319ee0..b13bc8382 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroup.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroup.java
@@ -18,7 +18,7 @@ import org.eclipse.tm.te.runtime.interfaces.extensions.IExecutableExtension;
* <p>
* A step group is a set of single steps or other step groups.
*/
-public interface IContextStepGroup<Data extends Object> extends IExecutableExtension {
+public interface IContextStepGroup extends IExecutableExtension {
/**
* Returns if or if not the step group is locked for user modifications.
@@ -38,11 +38,11 @@ public interface IContextStepGroup<Data extends Object> extends IExecutableExten
*
* @throws CoreException If the steps cannot be determined.
*/
- public IContextStepGroupable<Data>[] getSteps(String type, String subType) throws CoreException;
+ public IContextStepGroupable[] getSteps(String type, String subType) throws CoreException;
/**
* Return the step group iterator or <code>null</code>. The step group iterator can be used to
* generate loops and conditions for a step group.
*/
- public IContextStepGroupIterator<Data> getStepGroupIterator();
+ public IContextStepGroupIterator getStepGroupIterator();
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroupIterator.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroupIterator.java
index 711caeebf..124029fc9 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroupIterator.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroupIterator.java
@@ -12,11 +12,12 @@ package org.eclipse.tm.te.runtime.stepper.interfaces;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.tm.te.runtime.interfaces.extensions.IExecutableExtension;
+import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
/**
* A step group iterator.
*/
-public interface IContextStepGroupIterator<Data extends Object> extends IExecutableExtension {
+public interface IContextStepGroupIterator extends IExecutableExtension {
/**
* Initialize the iterator.
@@ -26,7 +27,7 @@ public interface IContextStepGroupIterator<Data extends Object> extends IExecuta
* @param fullQualifiedId The full qualified id for this step. Must be not <code>null</code>.
* @param monitor The progress monitor. Must be not <code>null</code>.
*/
- public void initialize(IContext context, Data data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor);
+ public void initialize(IContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor);
/**
* Return the number of calculated iterations. If the iterator was not initialized,
@@ -43,7 +44,7 @@ public interface IContextStepGroupIterator<Data extends Object> extends IExecuta
* @param monitor The progress monitor. Must be not <code>null</code>.
* @return <code>true</code> if another iteration is possible.
*/
- public boolean hasNext(IContext context, Data data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor);
+ public boolean hasNext(IContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor);
/**
* Set the next iteration to the data using the full qualified id.
@@ -54,5 +55,5 @@ public interface IContextStepGroupIterator<Data extends Object> extends IExecuta
* @param monitor The progress monitor. Must be not <code>null</code>.
* @throws CoreException
*/
- public void next(IContext context, Data data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException;
+ public void next(IContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException;
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroupable.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroupable.java
index acab911f8..6e49d7f56 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroupable.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IContextStepGroupable.java
@@ -14,7 +14,7 @@ import org.eclipse.tm.te.runtime.interfaces.extensions.IExecutableExtension;
/**
* A step groupable.
*/
-public interface IContextStepGroupable<Data extends Object> {
+public interface IContextStepGroupable {
/**
* Returns the grouped extension instance.
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IExtendedContextStep.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IExtendedContextStep.java
index a7899172a..7e4622a9a 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IExtendedContextStep.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IExtendedContextStep.java
@@ -13,11 +13,12 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.tm.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
/**
* Extended single step providing additional life cycle methods.
*/
-public interface IExtendedContextStep<Data extends Object> extends IContextStep<Data> {
+public interface IExtendedContextStep extends IContextStep {
/**
* Returns if or if not this step can have multiple references within step groups. If
@@ -39,7 +40,7 @@ public interface IExtendedContextStep<Data extends Object> extends IContextStep<
* @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
* @param monitor The progress monitor. Must not be <code>null</code>.
*/
- public void initializeFrom(IContext context, Data data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor);
+ public void initializeFrom(IContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor);
/**
* Validate execution conditions.
@@ -56,7 +57,7 @@ public interface IExtendedContextStep<Data extends Object> extends IContextStep<
*
* @throws CoreException if the execution cannot be continue. The associated status should describe the failure cause.
*/
- public void validateExecute(IContext context, Data data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException;
+ public void validateExecute(IContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException;
/**
* Cleanup intermediate data of the step.
@@ -68,7 +69,7 @@ public interface IExtendedContextStep<Data extends Object> extends IContextStep<
* @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
* @param monitor The progress monitor. Must not be <code>null</code>.
*/
- public void cleanup(IContext context, Data data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor);
+ public void cleanup(IContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor);
/**
* Called from the stepper engine once an error occurred during the stepping. Gives
@@ -87,5 +88,5 @@ public interface IExtendedContextStep<Data extends Object> extends IContextStep<
* @param monitor The progress monitor. Must not be <code>null</code>.
* @param callback The callback to invoke if finished. Must not be <code>null</code>.
*/
- public void rollback(IContext context, Data data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback);
+ public void rollback(IContext context, IPropertiesContainer data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback);
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IStepper.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IStepper.java
index ea35449bd..7a1fb99d4 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IStepper.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IStepper.java
@@ -14,6 +14,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.tm.te.runtime.interfaces.IConditionTester;
import org.eclipse.tm.te.runtime.interfaces.extensions.IExecutableExtension;
+import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
/**
@@ -27,7 +28,7 @@ import org.eclipse.tm.te.runtime.interfaces.extensions.IExecutableExtension;
* <p>
* Stepper must run in worker threads.
*/
-public interface IStepper<Data extends Object> extends IExecutableExtension {
+public interface IStepper extends IExecutableExtension {
public static final String ID_TYPE_STEPPER_ID = "Stepper"; //$NON-NLS-1$
public static final String ID_TYPE_CONTEXT_ID = "Context"; //$NON-NLS-1$
@@ -39,14 +40,14 @@ public interface IStepper<Data extends Object> extends IExecutableExtension {
* Condition Tester to test for finished execution of the associated stepper.
*/
public static class ExecutionFinishedConditionTester implements IConditionTester {
- private final IStepper<?> stepper;
+ private final IStepper stepper;
/**
* Constructor.
*
* @param stepper The stepper. Must not be <code>null</code>.
*/
- public ExecutionFinishedConditionTester(IStepper<?> stepper) {
+ public ExecutionFinishedConditionTester(IStepper stepper) {
Assert.isNotNull(stepper);
this.stepper = stepper;
}
@@ -78,7 +79,7 @@ public interface IStepper<Data extends Object> extends IExecutableExtension {
*
* @throws IllegalStateException If called if the stepper is in initialized state already.
*/
- public void initialize(Data data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws IllegalStateException;
+ public void initialize(IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws IllegalStateException;
/**
* Returns if or if not the stepper got initialized for a new run.
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IVariantDelegate.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IVariantDelegate.java
index 72a2e12f9..fff92271b 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IVariantDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/interfaces/IVariantDelegate.java
@@ -10,12 +10,13 @@
package org.eclipse.tm.te.runtime.stepper.interfaces;
import org.eclipse.tm.te.runtime.interfaces.extensions.IExecutableExtension;
+import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
/**
* The variant delegate is providing variants to the main modes. Variants can influence the executed
* steps or step groups.
*/
-public interface IVariantDelegate<Data extends Object> extends IExecutableExtension {
+public interface IVariantDelegate extends IExecutableExtension {
/**
* Returns the valid mode variants for the current context The returned list of variants is
@@ -26,5 +27,5 @@ public interface IVariantDelegate<Data extends Object> extends IExecutableExtens
*
* @return The valid variants or an empty array.
*/
- public String[] getValidVariants(IContext context, Data data);
+ public String[] getValidVariants(IContext context, IPropertiesContainer data);
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepExtensionPointManager.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepExtensionPointManager.java
new file mode 100644
index 000000000..9a68b880d
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepExtensionPointManager.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tm.te.runtime.stepper.internal.extensions;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager;
+import org.eclipse.tm.te.runtime.extensions.ExecutableExtensionProxy;
+import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStep;
+
+/**
+ * Step extension point manager implementation.
+ */
+public class StepExtensionPointManager extends AbstractExtensionPointManager<IContextStep> {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager#getExtensionPointId()
+ */
+ @Override
+ protected String getExtensionPointId() {
+ return "org.eclipse.tm.te.runtime.stepper.steps"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager#getConfigurationElementName()
+ */
+ @Override
+ protected String getConfigurationElementName() {
+ return "step"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the list of all contributed steps.
+ *
+ * @param unique If <code>true</code>, the method returns new instances for each
+ * contributed step.
+ *
+ * @return The list of contributed steps, or an empty array.
+ */
+ public IContextStep[] getSteps(boolean unique) {
+ List<IContextStep> contributions = new ArrayList<IContextStep>();
+ Collection<ExecutableExtensionProxy<IContextStep>> delegates = getExtensions().values();
+ for (ExecutableExtensionProxy<IContextStep> delegate : delegates) {
+ IContextStep instance = unique ? delegate.newInstance() : delegate.getInstance();
+ if (instance != null && !contributions.contains(instance)) {
+ contributions.add(instance);
+ }
+ }
+
+ return contributions.toArray(new IContextStep[contributions.size()]);
+ }
+
+ /**
+ * Returns the step identified by its unique id. If no step with the specified id is registered,
+ * <code>null</code> is returned.
+ *
+ * @param id The unique id of the step or <code>null</code>
+ * @param unique If <code>true</code>, the method returns new instances of the step contribution.
+ *
+ * @return The step instance or <code>null</code>.
+ */
+ public IContextStep getStep(String id, boolean unique) {
+ Assert.isNotNull(id);
+ IContextStep contribution = null;
+ if (getExtensions().containsKey(id)) {
+ ExecutableExtensionProxy<IContextStep> proxy = getExtensions().get(id);
+ // Get the extension instance
+ contribution = unique ? proxy.newInstance() : proxy.getInstance();
+ }
+
+ return contribution;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepGroupExtensionPointManager.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepGroupExtensionPointManager.java
new file mode 100644
index 000000000..bd3fa31ab
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepGroupExtensionPointManager.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tm.te.runtime.stepper.internal.extensions;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager;
+import org.eclipse.tm.te.runtime.extensions.ExecutableExtensionProxy;
+import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroup;
+
+/**
+ * Step group extension manager implementation.
+ */
+public class StepGroupExtensionPointManager extends AbstractExtensionPointManager<IContextStepGroup> {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager#getExtensionPointId()
+ */
+ @Override
+ protected String getExtensionPointId() {
+ return "org.eclipse.tm.te.runtime.stepper.stepGroups"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager#getConfigurationElementName()
+ */
+ @Override
+ protected String getConfigurationElementName() {
+ return "stepGroup"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager#doCreateExtensionProxy(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected ExecutableExtensionProxy<IContextStepGroup> doCreateExtensionProxy(IConfigurationElement element) throws CoreException {
+ return new StepGroupExtensionProxy(element);
+ }
+
+ /**
+ * Returns the step group identified by its unique id. If no step group with the specified id is
+ * registered, <code>null</code> is returned.
+ *
+ * @param id The step group unique id. Must not be <code>null</code>
+ * @param unique If <code>true</code>, the method returns new instances of the step group contribution.
+ *
+ * @return The step group instance or <code>null</code>.
+ */
+ public IContextStepGroup getStepGroup(String id, boolean unique) {
+ Assert.isNotNull(id);
+ IContextStepGroup contribution = null;
+ if (getExtensions().containsKey(id)) {
+ ExecutableExtensionProxy<IContextStepGroup> proxy = getExtensions().get(id);
+ // Get the extension instance
+ contribution = unique ? proxy.newInstance() : proxy.getInstance();
+ }
+
+ return contribution;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager#doStoreExtensionTo(java.util.Map, org.eclipse.tm.te.runtime.extensions.ExecutableExtensionProxy, org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected void doStoreExtensionTo(Map<String, ExecutableExtensionProxy<IContextStepGroup>> extensions, ExecutableExtensionProxy<IContextStepGroup> candidate, IConfigurationElement element) throws CoreException {
+ Assert.isNotNull(extensions);
+ Assert.isNotNull(candidate);
+ Assert.isNotNull(element);
+
+ // If no extension with this id had been registered before, register now.
+ if (!extensions.containsKey(candidate.getId())) {
+ extensions.put(candidate.getId(), candidate);
+ }
+ else if (extensions.get(candidate.getId()) instanceof StepGroupExtensionProxy) {
+ StepGroupExtensionProxy proxy = (StepGroupExtensionProxy)extensions.get(candidate.getId());
+ proxy.addGroupExtension(element);
+ }
+ else {
+ super.doStoreExtensionTo(extensions, candidate, element);
+ }
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepGroupExtensionProxy.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepGroupExtensionProxy.java
new file mode 100644
index 000000000..0b6c1ffd2
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepGroupExtensionProxy.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tm.te.runtime.stepper.internal.extensions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.tm.te.runtime.extensions.ExecutableExtensionProxy;
+import org.eclipse.tm.te.runtime.stepper.activator.CoreBundleActivator;
+import org.eclipse.tm.te.runtime.stepper.extensions.ContextStepGroup;
+import org.eclipse.tm.te.runtime.stepper.interfaces.IContextStepGroup;
+
+/**
+ * Step group extension proxy implementation.
+ */
+public class StepGroupExtensionProxy extends ExecutableExtensionProxy<IContextStepGroup> {
+ private List<IConfigurationElement> groupExtensions = new ArrayList<IConfigurationElement>();
+
+ /**
+ * Constructor.
+ *
+ * @param element The configuration element. Must not be <code>null</code>.
+ */
+ public StepGroupExtensionProxy(IConfigurationElement element) throws CoreException {
+ super(element);
+ }
+
+ /**
+ * Add a duplicate group extension that should be used to extend the launch group.
+ *
+ * @param element The configuration element. Must not be <code>null</code>.
+ */
+ public void addGroupExtension(IConfigurationElement element) {
+ Assert.isNotNull(element);
+ groupExtensions.add(element);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtensionProxy#newInstance()
+ */
+ @Override
+ public IContextStepGroup newInstance() {
+ // Create the instance
+ ContextStepGroup instance = new ContextStepGroup();
+ // and initialize
+ try {
+ instance.setInitializationData(getConfigurationElement(), getConfigurationElement().getName(), null);
+ for (IConfigurationElement groupExtension : groupExtensions) {
+ instance.doSetInitializationData(groupExtension, groupExtension.getName(), null);
+ }
+ } catch (CoreException e) {
+ // initialization failed -> reset instance
+ Platform.getLog(CoreBundleActivator.getContext().getBundle()).log(e.getStatus());
+ instance = null;
+ }
+ return instance;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepperExtensionPointManager.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepperExtensionPointManager.java
new file mode 100644
index 000000000..1d60e9cd0
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/internal/extensions/StepperExtensionPointManager.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tm.te.runtime.stepper.internal.extensions;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager;
+import org.eclipse.tm.te.runtime.extensions.ExecutableExtensionProxy;
+import org.eclipse.tm.te.runtime.stepper.interfaces.IStepper;
+
+/**
+ * Stepper extension point manager implementation.
+ */
+public class StepperExtensionPointManager extends AbstractExtensionPointManager<IStepper> {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager#getExtensionPointId()
+ */
+ @Override
+ protected String getExtensionPointId() {
+ return "org.eclipse.tm.te.runtime.stepper.steppers"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager#getConfigurationElementName()
+ */
+ @Override
+ protected String getConfigurationElementName() {
+ return "stepper"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the list of all contributed stepper.
+ *
+ * @param unique If <code>true</code>, the method returns new instances for each
+ * contributed stepper.
+ *
+ * @return The list of contributed stepper, or an empty array.
+ */
+ public IStepper[] getStepper(boolean unique) {
+ List<IStepper> contributions = new ArrayList<IStepper>();
+ Collection<ExecutableExtensionProxy<IStepper>> delegates = getExtensions().values();
+ for (ExecutableExtensionProxy<IStepper> delegate : delegates) {
+ IStepper instance = unique ? delegate.newInstance() : delegate.getInstance();
+ if (instance != null && !contributions.contains(instance)) {
+ contributions.add(instance);
+ }
+ }
+
+ return contributions.toArray(new IStepper[contributions.size()]);
+ }
+
+ /**
+ * Returns the stepper identified by its unique id. If no stepper with the specified id is registered,
+ * <code>null</code> is returned.
+ *
+ * @param id The unique id of the stepper or <code>null</code>
+ * @param unique If <code>true</code>, the method returns new instances of the stepper contribution.
+ *
+ * @return The stepper instance or <code>null</code>.
+ */
+ public IStepper getStepper(String id, boolean unique) {
+ Assert.isNotNull(id);
+ IStepper contribution = null;
+ if (getExtensions().containsKey(id)) {
+ ExecutableExtensionProxy<IStepper> proxy = getExtensions().get(id);
+ // Get the extension instance
+ contribution = unique ? proxy.newInstance() : proxy.getInstance();
+ }
+
+ return contribution;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/nls/Messages.java b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/nls/Messages.java
index d71417807..314555f08 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/nls/Messages.java
@@ -45,4 +45,17 @@ public class Messages extends NLS {
public static String AbstractContextStepper_multiStatus_finishedWithErrors;
public static String AbstractContextStepper_error_missingRequiredStep;
public static String AbstractContextStepper_error_requiredStepNotExecuted;
+
+ public static String ContextStepGroup_error_missingBaseStepGroup;
+ public static String ContextStepGroup_error_missingReferencedStep;
+ public static String ContextStepGroup_error_missingRequiredStep;
+ public static String ContextStepGroup_error_invalidRequiredStep;
+ public static String ContextStepGroup_error_multipleSingletonOccurrences;
+ public static String ContextStepGroup_error_typeAndMode;
+ public static String ContextStepGroup_error_step;
+ public static String ContextStepGroup_error_stepGroup;
+ public static String ContextStepGroup_error_requiredStep;
+ public static String ContextStepGroup_error_referencedBaseGroup;
+ public static String ContextStepGroup_error_referencedStepOrGroup;
+ public static String ContextStepGroup_error_requiredStepOrGroup;
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/nls/Messages.properties
index ea29e1c55..c54d8c5f4 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime.stepper/src/org/eclipse/tm/te/runtime/stepper/nls/Messages.properties
@@ -21,3 +21,16 @@ AbstractContextStepper_error_missingRequiredStep=Step execution failed. \
Required step or step group does not exist.\n\n{0}\n{1}\n\n{2}
AbstractContextStepper_error_requiredStepNotExecuted=Step execution failed. \
Required step or step group not executed before.\n\n{0}\n{1}\n\n{2}
+
+ContextStepGroup_error_missingBaseStepGroup=Cannot determine steps for execution. Referenced base step group does not exist.\n\n{0}\n{1}\n\n{2}
+ContextStepGroup_error_missingReferencedStep=Cannot determine steps for execution. Referenced step or step group does not exist.\n\n{0}\n{1}\n\n{2}
+ContextStepGroup_error_missingRequiredStep=Invalid step. Required step or step group does not exist.\n\n{0}\n{1}\n\n{2}
+ContextStepGroup_error_invalidRequiredStep=Invalid step. Required step is invalid.\n\n{0}\n{1}\n\n{2}
+ContextStepGroup_error_multipleSingletonOccurrences=Cannot determine steps for execution. Only one reference allowed.\n\n{0}\n{1}\n\n{2}
+ContextStepGroup_error_typeAndMode=Type:\n\t{0}\nMode:\n\t{1}
+ContextStepGroup_error_step=Step:\n\t{0}
+ContextStepGroup_error_stepGroup=Step group:\n\t{0}
+ContextStepGroup_error_requiredStep=Required Step:\n\t{0}
+ContextStepGroup_error_referencedBaseGroup=Referenced Base Step Group:\n\t{0}
+ContextStepGroup_error_referencedStepOrGroup=Referenced Step or Step Group:\n\t{0}
+ContextStepGroup_error_requiredStepOrGroup=Required Step or Step Group:\n\t{0}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.runtime/src/org/eclipse/tm/te/runtime/extensions/ExecutableExtension.java b/target_explorer/plugins/org.eclipse.tm.te.runtime/src/org/eclipse/tm/te/runtime/extensions/ExecutableExtension.java
index 8b5761ae7..731168a2c 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.runtime/src/org/eclipse/tm/te/runtime/extensions/ExecutableExtension.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.runtime/src/org/eclipse/tm/te/runtime/extensions/ExecutableExtension.java
@@ -9,6 +9,8 @@
*******************************************************************************/
package org.eclipse.tm.te.runtime.extensions;
+import java.util.Hashtable;
+
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -26,9 +28,10 @@ import org.eclipse.tm.te.runtime.nls.Messages;
public class ExecutableExtension extends PlatformObject implements IExecutableExtension {
// The mandatory id of the extension
private String id = null;
-
- // The configuration element
- private IConfigurationElement configElement = null;
+ // The label of the extension
+ private String label = null;
+ // The description of the extension
+ private String description = null;
/**
* Clone the initialization data to the given executable extension instance.
@@ -38,7 +41,8 @@ public class ExecutableExtension extends PlatformObject implements IExecutableEx
public void cloneInitializationData(ExecutableExtension other) {
Assert.isNotNull(other);
other.id = id;
- other.configElement = configElement;
+ other.label = label;
+ other.description = description;
}
/* (non-Javadoc)
@@ -46,15 +50,44 @@ public class ExecutableExtension extends PlatformObject implements IExecutableEx
*/
@Override
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- // Remember the configuration element
- configElement = config;
+ if (config != null) doSetInitializationData(config, propertyName, data);
+ }
+
+ /**
+ * Executes the {@link #setInitializationData(IConfigurationElement, String, Object)}.
+ *
+ * @param config The configuration element. Must not be <code>null</code>.
+ * @param propertyName The name of an attribute of the configuration element used on the <code>createExecutableExtension(String)<code> call.
+ * This argument can be used in the cases where a single configuration element is used to define multiple
+ * executable extensions.
+ * @param data Adapter data in the form of a String, a {@link Hashtable}, or <code>null</code>.
+ *
+ * @throws CoreException - if error(s) detected during initialization processing
+ */
+ public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ Assert.isNotNull(config);
// Initialize the id field by reading the <id> extension attribute.
// Throws an exception if the id is empty or null.
- id = configElement != null ? configElement.getAttribute("id") : null; //$NON-NLS-1$
+ id = config != null ? config.getAttribute("id") : null; //$NON-NLS-1$
if (id == null || (id != null && "".equals(id.trim()))) { //$NON-NLS-1$
throw createMissingMandatoryAttributeException("id", config.getContributor().getName()); //$NON-NLS-1$
}
+
+ // Try the "label" attribute first
+ String label = config != null ? config.getAttribute("label") : null; //$NON-NLS-1$
+ // If "label" is not found or empty, try the "name" attribute as fallback
+ if (label == null || "".equals(label.trim())) { //$NON-NLS-1$
+ label = config != null ? config.getAttribute("name") : null; //$NON-NLS-1$
+ }
+
+ // Read the description text from the "<description>" child element
+ IConfigurationElement[] children = config != null ? config.getChildren("description") : null; //$NON-NLS-1$
+ // Only one description element is allow. All other will be ignored
+ if (children != null && children.length > 0) {
+ IConfigurationElement element = children[0];
+ description = element.getValue();
+ }
}
/**
@@ -85,28 +118,11 @@ public class ExecutableExtension extends PlatformObject implements IExecutableEx
return id;
}
- /**
- * Returns the configuration element of the extension. The method
- * does return <code>null</code> if {@link #setInitializationData(IConfigurationElement, String, Object)}
- * has not been called yet.
- *
- * @return The configuration element or <code>null</code> if none.
- */
- protected final IConfigurationElement getConfigElement() {
- return configElement;
- }
-
/* (non-Javadoc)
* @see org.eclipse.tm.te.runtime.interfaces.extensions.IExecutableExtension#getLabel()
*/
@Override
public String getLabel() {
- // Try the "label" attribute first
- String label = configElement != null ? configElement.getAttribute("label") : null; //$NON-NLS-1$
- // If "label" is not found or empty, try the "name" attribute as fallback
- if (label == null || "".equals(label.trim())) { //$NON-NLS-1$
- label = configElement != null ? configElement.getAttribute("name") : null; //$NON-NLS-1$
- }
return label != null ? label.trim() : ""; //$NON-NLS-1$
}
@@ -115,15 +131,6 @@ public class ExecutableExtension extends PlatformObject implements IExecutableEx
*/
@Override
public String getDescription() {
- // Read the description text from the "<description>" child element
- IConfigurationElement[] children = configElement != null ? configElement.getChildren("description") : null; //$NON-NLS-1$
- // Only one description element is allow. All other will be ignored
- if (children != null && children.length > 0) {
- IConfigurationElement description = children[0];
- String value = description.getValue();
- return value != null ? value.trim() : ""; //$NON-NLS-1$
- }
-
- return ""; //$NON-NLS-1$
+ return description != null ? description.trim() : ""; //$NON-NLS-1$
}
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/AbstractLauncherDelegate.java b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/AbstractLauncherDelegate.java
index 253977a19..ececb356e 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/AbstractLauncherDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/AbstractLauncherDelegate.java
@@ -24,11 +24,11 @@ public abstract class AbstractLauncherDelegate extends ExecutableExtension imple
private Expression expression;
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
*/
@Override
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- super.setInitializationData(config, propertyName, data);
+ public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ super.doSetInitializationData(config, propertyName, data);
// Read the sub elements of the extension
IConfigurationElement[] children = config != null ? config.getChildren() : null;
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.views/src/org/eclipse/tm/te/ui/views/extensions/EditorPageBinding.java b/target_explorer/plugins/org.eclipse.tm.te.ui.views/src/org/eclipse/tm/te/ui/views/extensions/EditorPageBinding.java
index b43b7ad1f..9a5d6c0ca 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.ui.views/src/org/eclipse/tm/te/ui/views/extensions/EditorPageBinding.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.views/src/org/eclipse/tm/te/ui/views/extensions/EditorPageBinding.java
@@ -21,15 +21,19 @@ import org.eclipse.tm.te.runtime.extensions.ExecutableExtension;
public class EditorPageBinding extends ExecutableExtension {
// The mandatory page identifier
private String pageId;
+ // The insertBefore element
+ private String insertBefore;
+ // The insertAfter element
+ private String insertAfter;
// The converted expression
private Expression expression;
/* (non-Javadoc)
- * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ * @see org.eclipse.tm.te.runtime.extensions.ExecutableExtension#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
*/
@Override
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- super.setInitializationData(config, propertyName, data);
+ public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ super.doSetInitializationData(config, propertyName, data);
// Initialize the page id field by reading the <pageId> extension attribute.
// Throws an exception if the id is empty or null.
@@ -44,6 +48,11 @@ public class EditorPageBinding extends ExecutableExtension {
if (children != null && children.length > 0) {
expression = ExpressionConverter.getDefault().perform(children[0]);
}
+
+ // Read the "insertBefore" attribute
+ insertBefore = config != null ? config.getAttribute("insertBefore") : null; //$NON-NLS-1$
+ // Read the "insertAfter" attribute
+ insertAfter = config != null ? config.getAttribute("insertAfter") : null; //$NON-NLS-1$
}
/**
@@ -70,8 +79,6 @@ public class EditorPageBinding extends ExecutableExtension {
* @return The &quot;insertBefore&quot; property or an empty string.
*/
public String getInsertBefore() {
- // Read the "insertBefore" attribute
- String insertBefore = getConfigElement() != null ? getConfigElement().getAttribute("insertBefore") : null; //$NON-NLS-1$
return insertBefore != null ? insertBefore.trim() : ""; //$NON-NLS-1$
}
@@ -81,8 +88,6 @@ public class EditorPageBinding extends ExecutableExtension {
* @return The &quot;insertAfter&quot; property or an empty string.
*/
public String getInsertAfter() {
- // Read the "insertAfter" attribute
- String insertAfter = getConfigElement() != null ? getConfigElement().getAttribute("insertAfter") : null; //$NON-NLS-1$
return insertAfter != null ? insertAfter.trim() : ""; //$NON-NLS-1$
}
}

Back to the top