Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-08-22 12:46:55 +0000
committerTobias Schwarz2013-08-22 12:46:55 +0000
commit10ae6658d7cc152ec5c2f0c4e76704120e4c3f3e (patch)
tree8bac8a420ec7324cf5b098cd3d9bfc8ea7a55084 /target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper
parent8796c44601d50beb69595a2957e112bee0e1633e (diff)
downloadorg.eclipse.tcf-10ae6658d7cc152ec5c2f0c4e76704120e4c3f3e.tar.gz
org.eclipse.tcf-10ae6658d7cc152ec5c2f0c4e76704120e4c3f3e.tar.xz
org.eclipse.tcf-10ae6658d7cc152ec5c2f0c4e76704120e4c3f3e.zip
Target Explorer: rework ProcessesV1 support
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/schema/stepGroups.exsd7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java25
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroupable.java9
3 files changed, 41 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/schema/stepGroups.exsd b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/schema/stepGroups.exsd
index ff76c8206..20a5e7ce3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/schema/stepGroups.exsd
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/schema/stepGroups.exsd
@@ -280,6 +280,13 @@ Use the form <i>"id##secondaryId"</i> to identify
</documentation>
</annotation>
</attribute>
+ <attribute name="optional" type="boolean">
+ <annotation>
+ <documentation>
+ Optional references will be ignored if not available.
+ </documentation>
+ </annotation>
+ </attribute>
</complexType>
</element>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java
index f89c2af6f..601b4246e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java
@@ -71,6 +71,7 @@ public class StepGroup extends ExecutableExtension implements IStepGroup {
private boolean disable;
private boolean singleton;
private boolean savePoint;
+ private boolean optional;
private final List<String> dependencies = new ArrayList<String>();
private Expression expression;
private Map<String,String> parameters = new HashMap<String, String>();
@@ -180,6 +181,15 @@ public class StepGroup extends ExecutableExtension implements IStepGroup {
}
/**
+ * If a reference is marked as optional, the step or step group will be
+ * ignored if not known.
+ * @return <code>true</code> if reference should be ignored when not known.
+ */
+ public boolean isOptional() {
+ return optional;
+ }
+
+ /**
* Returns the list of dependencies.
* <p>
* The step or step group id might be fully qualified using the form
@@ -266,6 +276,11 @@ public class StepGroup extends ExecutableExtension implements IStepGroup {
this.savePoint = Boolean.parseBoolean(value.trim());
}
+ value = config.getAttribute("optional"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.optional = Boolean.parseBoolean(value.trim());
+ }
+
// Read in the list of dependencies if specified.
dependencies.clear();
IConfigurationElement[] requires = config.getChildren("requires"); //$NON-NLS-1$
@@ -346,6 +361,7 @@ public class StepGroup extends ExecutableExtension implements IStepGroup {
buffer.append(", disable = " + isDisable()); //$NON-NLS-1$
buffer.append(", singleton = " + isSingleton()); //$NON-NLS-1$
buffer.append(", savePoint = " + isSavePoint()); //$NON-NLS-1$
+ buffer.append(", optional = " + isOptional()); //$NON-NLS-1$
buffer.append(", parameters = " + getParameters()); //$NON-NLS-1$
return buffer.toString();
}
@@ -645,6 +661,12 @@ public class StepGroup extends ExecutableExtension implements IStepGroup {
// If the candidate is null here, that's an error as a referenced step is missing.
if (candidate == null) {
+ if (reference.isOptional()) {
+ CoreBundleActivator.getTraceHandler().trace(
+ "StepGroup#getSteps: SKIPPED optional not existing reference = '" + reference.getId(), //$NON-NLS-1$
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+ continue;
+ }
throw new CoreException(new Status(IStatus.ERROR,
CoreBundleActivator.getUniqueIdentifier(),
MessageFormat.format(Messages.StepGroup_error_missingReferencedStep,
@@ -724,6 +746,9 @@ public class StepGroup extends ExecutableExtension implements IStepGroup {
if (reference.isSavePoint() && !groupable.isSavePoint()) {
groupable.setIsSavePoint(reference.isSavePoint());
}
+ if (reference.isOptional() && !groupable.isOptional()) {
+ groupable.setOptional(reference.isOptional());
+ }
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroupable.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroupable.java
index f84a63ab7..f447061fb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroupable.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroupable.java
@@ -27,6 +27,7 @@ public class StepGroupable implements IStepGroupable {
private boolean removable = true;
private boolean singleton = false;
private boolean savePoint = false;
+ private boolean optional = false;
private final List<String> dependencies = new ArrayList<String>();
private IExecutableExtension extension;
@@ -209,6 +210,14 @@ public class StepGroupable implements IStepGroupable {
return savePoint;
}
+ public void setOptional(boolean optional) {
+ this.optional = optional;
+ }
+
+ public boolean isOptional() {
+ return optional;
+ }
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/

Back to the top