// Path: org.spotter.eclipse.ui/src/org/spotter/eclipse/ui/model/xml/MeasurementEnvironmentFactory.java
// public final class MeasurementEnvironmentFactory {
// 
// 	private static final Logger LOGGER = LoggerFactory.getLogger(MeasurementEnvironmentFactory.class);
// 
// 	private static MeasurementEnvironmentFactory instance;
// 
// 	/**
// 	 * @return singleton instance
// 	 */
// 	public static MeasurementEnvironmentFactory getInstance() {
// 		if (instance == null) {
// 			instance = new MeasurementEnvironmentFactory();
// 		}
// 		return instance;
// 	}
// 
// 	private MeasurementEnvironmentFactory() {
// 	}
// 
// 	/**
// 	 * Reads the file from disk specified by the given <code>fileName</code> and
// 	 * parses it for creation of an {@link XMeasurementEnvironment}.
// 	 * 
// 	 * @param fileName
// 	 *            specifies the name of the XML file containing the measurement
// 	 *            environment description
// 	 * @return the <code>XMeasurementEnvironment</code> object
// 	 * @throws UICoreException
// 	 *             when either file could not be found or when there was an
// 	 *             error parsing the file
// 	 */
// 	public XMeasurementEnvironment parseXMLFile(String fileName) throws UICoreException {
// 		try {
// 			return JAXBUtil.parseXMLFile(fileName, ObjectFactory.class.getPackage().getName());
// 		} catch (FileNotFoundException e) {
// 			String message = "Could not find file '" + fileName + "'!";
// 			LOGGER.error(message);
// 			throw new UICoreException(message, e);
// 		} catch (JAXBException e) {
// 			String message = "Failed to parse measurement environment description file '" + fileName + "'!";
// 			LOGGER.error(message + " Cause: {}", e.getMessage());
// 			throw new UICoreException(message, e);
// 		}
// 	}
// 
// 	/**
// 	 * Creates an empty instance of a measurement environment. This factory
// 	 * method initializes the fields with empty lists.
// 	 * 
// 	 * @return an empty instance
// 	 */
// 	public XMeasurementEnvironment createMeasurementEnvironment() {
// 		XMeasurementEnvironment env = new XMeasurementEnvironment();
// 
// 		List<XMeasurementEnvObject> instrumentationControllers = new LinkedList<>();
// 		List<XMeasurementEnvObject> measurementControllers = new LinkedList<>();
// 		List<XMeasurementEnvObject> workloadAdapters = new LinkedList<>();
// 
// 		env.setInstrumentationController(instrumentationControllers);
// 		env.setMeasurementController(measurementControllers);
// 		env.setWorkloadAdapter(workloadAdapters);
// 
// 		return env;
// 	}
// 
// 	/**
// 	 * Creates a copy of the given measurement environment object.
// 	 * 
// 	 * @param envObj
// 	 *            the object to copy
// 	 * @return the copy of the given object
// 	 */
// 	public XMeasurementEnvObject copyMeasurementEnvObject(XMeasurementEnvObject envObj) {
// 		XMeasurementEnvObject envObjCopy = new XMeasurementEnvObject();
// 		envObjCopy.setExtensionName(envObj.getExtensionName());
// 		if (envObj.getConfig() != null) {
// 			envObjCopy.setConfig(SpotterUtils.copyConfigurationList(envObj.getConfig()));
// 		}
// 		return envObjCopy;
// 	}
// 
// }
// 
// Path: org.spotter.shared/src/org/spotter/shared/environment/model/XMeasurementEnvObject.java
// @XmlAccessorType(XmlAccessType.FIELD)
// @XmlType(name = "MeasurementEnvObject", propOrder = { "extensionName", "config" })
// public class XMeasurementEnvObject {
// 
// 	@XmlElement(name = "extensionName", required = true)
// 	private String extensionName;
// 
// 	private List<XMConfiguration> config;
// 
// 	/**
// 	 * @return the extensionName
// 	 */
// 	public String getExtensionName() {
// 		return extensionName;
// 	}
// 
// 	/**
// 	 * @param extensionName
// 	 *            the extensionName to set
// 	 */
// 	public void setExtensionName(String extensionName) {
// 		this.extensionName = extensionName;
// 	}
// 
// 	/**
// 	 * @return the config
// 	 */
// 	public List<XMConfiguration> getConfig() {
// 		return config;
// 	}
// 
// 	/**
// 	 * @param config
// 	 *            the config to set
// 	 */
// 	public void setConfig(List<XMConfiguration> config) {
// 		this.config = config;
// 	}
// 
// }


import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.spotter.eclipse.ui.UICoreException;
import org.spotter.eclipse.ui.model.xml.MeasurementEnvironmentFactory;
import org.spotter.eclipse.ui.navigator.SpotterProjectConfigMeasurement;
import org.spotter.shared.environment.model.XMeasurementEnvObject;
import org.spotter.shared.environment.model.XMeasurementEnvironment;
/**
 * Copyright 2014 SAP AG
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.spotter.eclipse.ui.editors;



/**
 * Editor input for the Measurement Editor.
 * 
 * @author Denis Knoepfle
 * 
 */
public class MeasurementEditorInput extends AbstractSpotterEditorInput {

	private static final String NAME = "Measurement Satellite Adapter";
	private static final String IMAGE_PATH = SpotterProjectConfigMeasurement.IMAGE_PATH;

	private List<XMeasurementEnvObject> measurementControllers;

	/**
	 * Creates a new instance of this class.
	 * 
	 * @param file
	 *            the associated file.
	 */
	public MeasurementEditorInput(IFile file) {
		super(file);
// Path: org.spotter.eclipse.ui/src/org/spotter/eclipse/ui/model/xml/MeasurementEnvironmentFactory.java
// public final class MeasurementEnvironmentFactory {
// 
// 	private static final Logger LOGGER = LoggerFactory.getLogger(MeasurementEnvironmentFactory.class);
// 
// 	private static MeasurementEnvironmentFactory instance;
// 
// 	/**
// 	 * @return singleton instance
// 	 */
// 	public static MeasurementEnvironmentFactory getInstance() {
// 		if (instance == null) {
// 			instance = new MeasurementEnvironmentFactory();
// 		}
// 		return instance;
// 	}
// 
// 	private MeasurementEnvironmentFactory() {
// 	}
// 
// 	/**
// 	 * Reads the file from disk specified by the given <code>fileName</code> and
// 	 * parses it for creation of an {@link XMeasurementEnvironment}.
// 	 * 
// 	 * @param fileName
// 	 *            specifies the name of the XML file containing the measurement
// 	 *            environment description
// 	 * @return the <code>XMeasurementEnvironment</code> object
// 	 * @throws UICoreException
// 	 *             when either file could not be found or when there was an
// 	 *             error parsing the file
// 	 */
// 	public XMeasurementEnvironment parseXMLFile(String fileName) throws UICoreException {
// 		try {
// 			return JAXBUtil.parseXMLFile(fileName, ObjectFactory.class.getPackage().getName());
// 		} catch (FileNotFoundException e) {
// 			String message = "Could not find file '" + fileName + "'!";
// 			LOGGER.error(message);
// 			throw new UICoreException(message, e);
// 		} catch (JAXBException e) {
// 			String message = "Failed to parse measurement environment description file '" + fileName + "'!";
// 			LOGGER.error(message + " Cause: {}", e.getMessage());
// 			throw new UICoreException(message, e);
// 		}
// 	}
// 
// 	/**
// 	 * Creates an empty instance of a measurement environment. This factory
// 	 * method initializes the fields with empty lists.
// 	 * 
// 	 * @return an empty instance
// 	 */
// 	public XMeasurementEnvironment createMeasurementEnvironment() {
// 		XMeasurementEnvironment env = new XMeasurementEnvironment();
// 
// 		List<XMeasurementEnvObject> instrumentationControllers = new LinkedList<>();
// 		List<XMeasurementEnvObject> measurementControllers = new LinkedList<>();
// 		List<XMeasurementEnvObject> workloadAdapters = new LinkedList<>();
// 
// 		env.setInstrumentationController(instrumentationControllers);
// 		env.setMeasurementController(measurementControllers);
// 		env.setWorkloadAdapter(workloadAdapters);
// 
// 		return env;
// 	}
// 
// 	/**
// 	 * Creates a copy of the given measurement environment object.
// 	 * 
// 	 * @param envObj
// 	 *            the object to copy
// 	 * @return the copy of the given object
// 	 */
// 	public XMeasurementEnvObject copyMeasurementEnvObject(XMeasurementEnvObject envObj) {
// 		XMeasurementEnvObject envObjCopy = new XMeasurementEnvObject();
// 		envObjCopy.setExtensionName(envObj.getExtensionName());
// 		if (envObj.getConfig() != null) {
// 			envObjCopy.setConfig(SpotterUtils.copyConfigurationList(envObj.getConfig()));
// 		}
// 		return envObjCopy;
// 	}
// 
// }
// 
// Path: org.spotter.shared/src/org/spotter/shared/environment/model/XMeasurementEnvObject.java
// @XmlAccessorType(XmlAccessType.FIELD)
// @XmlType(name = "MeasurementEnvObject", propOrder = { "extensionName", "config" })
// public class XMeasurementEnvObject {
// 
// 	@XmlElement(name = "extensionName", required = true)
// 	private String extensionName;
// 
// 	private List<XMConfiguration> config;
// 
// 	/**
// 	 * @return the extensionName
// 	 */
// 	public String getExtensionName() {
// 		return extensionName;
// 	}
// 
// 	/**
// 	 * @param extensionName
// 	 *            the extensionName to set
// 	 */
// 	public void setExtensionName(String extensionName) {
// 		this.extensionName = extensionName;
// 	}
// 
// 	/**
// 	 * @return the config
// 	 */
// 	public List<XMConfiguration> getConfig() {
// 		return config;
// 	}
// 
// 	/**
// 	 * @param config
// 	 *            the config to set
// 	 */
// 	public void setConfig(List<XMConfiguration> config) {
// 		this.config = config;
// 	}
// 
// }


// Path: org.spotter.eclipse.ui/src/org/spotter/eclipse/ui/editors/MeasurementEditorInput.java
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.spotter.eclipse.ui.UICoreException;
import org.spotter.eclipse.ui.model.xml.MeasurementEnvironmentFactory;
import org.spotter.eclipse.ui.navigator.SpotterProjectConfigMeasurement;
import org.spotter.shared.environment.model.XMeasurementEnvObject;
import org.spotter.shared.environment.model.XMeasurementEnvironment;

/**
 * Copyright 2014 SAP AG
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.spotter.eclipse.ui.editors;



/**
 * Editor input for the Measurement Editor.
 * 
 * @author Denis Knoepfle
 * 
 */
public class MeasurementEditorInput extends AbstractSpotterEditorInput {

	private static final String NAME = "Measurement Satellite Adapter";
	private static final String IMAGE_PATH = SpotterProjectConfigMeasurement.IMAGE_PATH;

	private List<XMeasurementEnvObject> measurementControllers;

	/**
	 * Creates a new instance of this class.
	 * 
	 * @param file
	 *            the associated file.
	 */
	public MeasurementEditorInput(IFile file) {
		super(file);
		MeasurementEnvironmentFactory factory = MeasurementEnvironmentFactory.getInstance();