diff options
author | Tobias Schwarz | 2014-04-15 11:45:27 +0000 |
---|---|---|
committer | Tobias Schwarz | 2014-04-15 11:45:27 +0000 |
commit | 40a80b8b7408d584a9e73c67fe79c07a3abf0c4a (patch) | |
tree | 350cd379b5e9da6237c49f8ce12667cae2010aee /target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper | |
parent | a94360980e202068af5fd3c0853da81ce1da04c0 (diff) | |
download | org.eclipse.tcf-40a80b8b7408d584a9e73c67fe79c07a3abf0c4a.tar.gz org.eclipse.tcf-40a80b8b7408d584a9e73c67fe79c07a3abf0c4a.tar.xz org.eclipse.tcf-40a80b8b7408d584a9e73c67fe79c07a3abf0c4a.zip |
Target Explorer: rework action history after review session
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper')
2 files changed, 9 insertions, 19 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java index 2853044de..8ac1180e8 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java @@ -35,10 +35,9 @@ public interface IStepAttributes { public static final String ATTR_STEPPER_JOB_OPERATION = ATTR_PREFIX + ".stepper_job_operation"; //$NON-NLS-1$ /** - * The id to persist the data of stepper execution to the history. - * If this attribute is not set, it is filled automatically with <stepGroupId>@<stepContextId> + * The initial step group. */ - public static final String ATTR_HISTORY_ID = ATTR_PREFIX + ".history_id"; //$NON-NLS-1$ + public static final String ATTR_STEP_GROUP_ID = ATTR_PREFIX + ".step_group_id"; //$NON-NLS-1$ /** * The data to persist to the history. @@ -47,8 +46,8 @@ public interface IStepAttributes { public static final String ATTR_HISTORY_DATA = ATTR_PREFIX + ".history_data"; //$NON-NLS-1$ /** - * The number of entries in the history. - * If this attribute is not set, the history manager default is used. + * History id used by the stepper to remember the last run. */ - public static final String ATTR_HISTORY_COUNT = ATTR_PREFIX + ".history_count"; //$NON-NLS-1$ + public static final String PROP_LAST_RUN_HISTORY_ID = ATTR_PREFIX + ".last_run_history"; //$NON-NLS-1$ + } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java index eb3e870d2..d33bb5cdc 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java @@ -172,12 +172,10 @@ public class Stepper implements IStepper { // but not finished yet this.finished = false; - if (!data.containsKey(IStepAttributes.ATTR_HISTORY_DATA)) { + if (!data.isEmpty()) { + data.setProperty(IStepAttributes.ATTR_STEP_GROUP_ID, stepGroupId); data.setProperty(IStepAttributes.ATTR_HISTORY_DATA, DataHelper.encodePropertiesContainer(data)); } - if (!data.containsKey(IStepAttributes.ATTR_HISTORY_ID)) { - data.setProperty(IStepAttributes.ATTR_HISTORY_ID, stepGroupId + "@" + context.getId()); //$NON-NLS-1$ - } // call the hook for the subclasses to initialize themselves onInitialize(this.data, fullQualifiedId, this.monitor); @@ -354,16 +352,9 @@ public class Stepper implements IStepper { List<IStatus> statusContainer = new ArrayList<IStatus>(); // save execution to history - String historyId = data.getStringProperty(IStepAttributes.ATTR_HISTORY_ID); String historyData = data.getStringProperty(IStepAttributes.ATTR_HISTORY_DATA); - int historyCount = data.getIntProperty(IStepAttributes.ATTR_HISTORY_COUNT); - if (historyId != null && historyData != null) { - if (historyCount > 0) { - HistoryManager.getInstance().add(historyId, historyData, historyCount); - } - else { - HistoryManager.getInstance().add(historyId, historyData); - } + if (historyData != null) { + HistoryManager.getInstance().add(IStepAttributes.PROP_LAST_RUN_HISTORY_ID + "@" + context.getId(), historyData, 10); //$NON-NLS-1$ } // start execution |