true
if reference should be ignored when not known.
+ */
+ public boolean isOptional() {
+ return optional;
+ }
+
/**
* Returns the list of dependencies.
*
@@ -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