1 /*******************************************************************************
2 * Copyright (c) 2016 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
.internal
.tmf
.analysis
.xml
.ui
.views
;
11 import org
.eclipse
.jdt
.annotation
.NonNull
;
12 import org
.eclipse
.jface
.dialogs
.IDialogSettings
;
13 import org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.ui
.Activator
;
14 import org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.ui
.module
.TmfXmlAnalysisOutputSource
;
17 * Abstract class to manage information about a view for an XML analysis
19 * @author Jean-Christian Kouame
21 public abstract class AbstractXmlViewInfo
{
23 private final String fViewId
;
31 public AbstractXmlViewInfo(String viewId
) {
36 * Get this view property section from the settings. The property section is
39 * @return The property section
41 protected IDialogSettings
getPersistentPropertyStore() {
42 IDialogSettings settings
= Activator
.getDefault().getDialogSettings();
43 IDialogSettings section
= settings
.getSection(fViewId
);
44 if (section
== null) {
45 section
= settings
.addNewSection(fViewId
);
46 if (section
== null) {
47 throw new IllegalStateException("The persistent property section could not be added"); //$NON-NLS-1$
54 * Set the data for this view and retrieves from it the parameter the view needs
57 * A string of the form "param1" +
58 * {@link TmfXmlAnalysisOutputSource#DATA_SEPARATOR} +
61 public abstract void setViewData(@NonNull String data
);
64 * Save this view persistent data into the settings. For example, user could
65 * save the view ID or the label, ...
67 protected abstract void savePersistentData();