1 /*******************************************************************************
2 * Copyright (c) 2016 Ecole Polytechnique de Montreal, Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 ******************************************************************************/
9 package org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.core
.model
;
11 import java
.util
.Map
.Entry
;
13 import org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.core
.pattern
.stateprovider
.XmlPatternStateProvider
;
14 import org
.eclipse
.tracecompass
.statesystem
.core
.statevalue
.ITmfStateValue
;
15 import org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.core
.module
.IXmlStateSystemContainer
;
16 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
19 * This action will reset the value of each stored values to a null
20 * {@link ITmfStateValue} in the state system
24 public class ResetStoredFieldsAction
implements ITmfXmlAction
{
26 private final IXmlStateSystemContainer fParent
;
32 * The state system container this action belongs to
34 public ResetStoredFieldsAction(IXmlStateSystemContainer parent
) {
39 public void execute(ITmfEvent event
, TmfXmlScenarioInfo scenarioInfo
) {
40 if (fParent
instanceof XmlPatternStateProvider
) {
41 for (Entry
<String
, String
> entry
: ((XmlPatternStateProvider
) fParent
).getStoredFields().entrySet()) {
42 ((XmlPatternStateProvider
) fParent
).getHistoryBuilder().resetStoredFields(fParent
, entry
.getValue(), scenarioInfo
, event
);