diff options
author | Tobias Schwarz | 2014-04-16 10:54:58 +0000 |
---|---|---|
committer | Tobias Schwarz | 2014-04-16 10:54:58 +0000 |
commit | 7c62c4fa18a8391e669bb6ad2b7fb9e24b52815b (patch) | |
tree | a845c3f664ef406cc451429bee670f57299ff575 /target_explorer/plugins | |
parent | b951f0b227bcd2aae8c74468e6d72899abf968d6 (diff) | |
download | org.eclipse.tcf-7c62c4fa18a8391e669bb6ad2b7fb9e24b52815b.tar.gz org.eclipse.tcf-7c62c4fa18a8391e669bb6ad2b7fb9e24b52815b.tar.xz org.eclipse.tcf-7c62c4fa18a8391e669bb6ad2b7fb9e24b52815b.zip |
Target Explorer: add possibility to not add a stepper run to the history
Diffstat (limited to 'target_explorer/plugins')
5 files changed, 36 insertions, 2 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 8ac1180e8..cfa2f8059 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 @@ -46,8 +46,13 @@ public interface IStepAttributes { public static final String ATTR_HISTORY_DATA = ATTR_PREFIX + ".history_data"; //$NON-NLS-1$ /** + * Marker for stepper data to not add this run into the laus run history. + */ + public static final String PROP_SKIP_LAST_RUN_HISTORY = ATTR_PREFIX + ".skip_last_run_history"; //$NON-NLS-1$ + + /** * History id used by the stepper to remember the last run. */ - public static final String PROP_LAST_RUN_HISTORY_ID = ATTR_PREFIX + ".last_run_history"; //$NON-NLS-1$ + public static final String PROP_LAST_RUN_HISTORY_ID = ATTR_PREFIX + ".last_run_history_id"; //$NON-NLS-1$ } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperOperationService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperOperationService.java index 0035fc365..a563b8399 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperOperationService.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepperOperationService.java @@ -74,6 +74,14 @@ public interface IStepperOperationService extends IService { public boolean isCancelable(Object context, String operation); /** + * Returns <code>true</code> if this stepper run should be added to the action history. + * @param context The context. Must not be <code>null</code>. + * @param operation The operation. Must not be <code>null</code>. + * @return <code>true</code> if the stepper run should be added to the action history. + */ + public boolean addToActionHistory(Object context, String operation); + + /** * Validates the step data to be used for the given context and operation. * @param context The context. Must not be <code>null</code>. * @param operation The operation. Must not be <code>null</code>. 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 97f8564f5..effbba95e 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,9 +172,12 @@ public class Stepper implements IStepper { // but not finished yet this.finished = false; + boolean skipLastRunHistory = data.getBooleanProperty(IStepAttributes.PROP_SKIP_LAST_RUN_HISTORY); + data.setProperty(IStepAttributes.PROP_SKIP_LAST_RUN_HISTORY, null); if (!data.isEmpty()) { data.setProperty(IStepAttributes.ATTR_STEP_GROUP_ID, stepGroupId); data.setProperty(IStepAttributes.ATTR_HISTORY_DATA, DataHelper.encodePropertiesContainer(data)); + data.setProperty(IStepAttributes.PROP_SKIP_LAST_RUN_HISTORY, skipLastRunHistory); } // call the hook for the subclasses to initialize themselves @@ -354,8 +357,13 @@ public class Stepper implements IStepper { // save execution to history String historyData = data.getStringProperty(IStepAttributes.ATTR_HISTORY_DATA); if (historyData != null) { + // this is the history for each step group used by action dialogs to prefill the values if no usable selection is available HistoryManager.getInstance().add(stepGroupId + "@" + context.getId(), historyData, 1); //$NON-NLS-1$ - HistoryManager.getInstance().add(IStepAttributes.PROP_LAST_RUN_HISTORY_ID + "@" + context.getId(), historyData, 10); //$NON-NLS-1$ + if (!data.getBooleanProperty(IStepAttributes.PROP_SKIP_LAST_RUN_HISTORY)) { + // this is the history used for the list of history actions and the history dialog + + HistoryManager.getInstance().add(IStepAttributes.PROP_LAST_RUN_HISTORY_ID + "@" + context.getId(), historyData, 10); //$NON-NLS-1$ + } } // start execution diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/utils/StepperHelper.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/utils/StepperHelper.java index 1957cccc0..de0a9a4fe 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/utils/StepperHelper.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/utils/StepperHelper.java @@ -15,6 +15,7 @@ import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback; import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; import org.eclipse.tcf.te.runtime.services.ServiceManager; import org.eclipse.tcf.te.runtime.services.interfaces.IService; +import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepAttributes; import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext; import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService; import org.eclipse.tcf.te.runtime.stepper.job.StepperJob; @@ -41,6 +42,10 @@ public final class StepperHelper { String stepGroupId = service.getStepGroupId(context, operation); String name = service.getStepGroupName(context, operation); boolean isCancelable = service.isCancelable(context, operation); + boolean addToActionHistory = service.addToActionHistory(context, operation); + if (!addToActionHistory) { + data.setProperty(IStepAttributes.PROP_SKIP_LAST_RUN_HISTORY, true); + } if (stepGroupId != null && stepContext != null) { StepperJob job = new StepperJob(name != null ? name : "", //$NON-NLS-1$ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/StepperOperationService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/StepperOperationService.java index 36de4937d..871fcf806 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/StepperOperationService.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/StepperOperationService.java @@ -37,6 +37,14 @@ public class StepperOperationService extends org.eclipse.tcf.te.runtime.stepper. } /* (non-Javadoc) + * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService#addToActionHistory(java.lang.Object, java.lang.String) + */ + @Override + public boolean addToActionHistory(Object context, String operation) { + return false; + } + + /* (non-Javadoc) * @see org.eclipse.tcf.te.runtime.services.interfaces.IStepperService#getStepGroupId(java.lang.Object, java.lang.String) */ @Override |