// Path: org.spotter.shared/src/org/spotter/shared/hierarchy/model/XPerformanceProblem.java
// @XmlAccessorType(XmlAccessType.FIELD)
// @XmlType(name = "PerformanceProblem", propOrder = { "extensionName", "uniqueId", "config", "problem" })
// @XmlRootElement(name = "root")
// public class XPerformanceProblem implements Serializable {
// 
// 	private static final long serialVersionUID = -3934559836199225205L;
// 
// 	@XmlElement(name = "extensionName", required = false)
// 	private String extensionName;
// 	
// 	/**
// 	 * The unique id is always required and is used to identify
// 	 * problem instances.
// 	 */
// 	@XmlElement(name = "uniqueId", required = true)
// 	private String uniqueId;
// 
// 	/**
// 	 * The configuration is always required. At least, the property
// 	 * if this node is detectable must be set.
// 	 */
// 	@XmlElement(name = "config", required = true)
// 	private List<XMConfiguration> config;
// 
// 	/**
// 	 * A sub node for a problem is not required, as
// 	 * a {@link XPerformanceProblem} can be a root-cause. A
// 	 * root-cause of a performance problem does not contain
// 	 * more problems.
// 	 */
// 	@XmlElement(name = "problem", required = false)
// 	private List<XPerformanceProblem> problem;
// 	
// 	/**
// 	 * @return the extensionName
// 	 */
// 	public String getExtensionName() {
// 		return extensionName;
// 	}
// 	
// 	/**
// 	 * @param extensionName the extensionName to set
// 	 */
// 	public void setExtensionName(String extensionName) {
// 		this.extensionName = extensionName;
// 	}
// 
// 	/**
// 	 * @return the uniqueId
// 	 */
// 	public String getUniqueId() {
// 		return uniqueId;
// 	}
// 	
// 	/**
// 	 * @param uniqueId the uniqueId to set
// 	 */
// 	public void setUniqueId(String uniqueId) {
// 		this.uniqueId = uniqueId;
// 	}
// 	
// 	/**
// 	 * @return the config
// 	 */
// 	public List<XMConfiguration> getConfig() {
// 		return config;
// 	}
// 	
// 	/**
// 	 * @param config the config to set
// 	 */
// 	public void setConfig(List<XMConfiguration> config) {
// 		this.config = config;
// 	}
// 	
// 	/**
// 	 * @return the problem
// 	 */
// 	public List<XPerformanceProblem> getProblem() {
// 		return problem;
// 	}
// 	
// 	/**
// 	 * @param problem the problem to set
// 	 */
// 	public void setProblem(List<XPerformanceProblem> problem) {
// 		this.problem = problem;
// 	}
// 
// }


import org.eclipse.swt.graphics.Image;
import org.spotter.eclipse.ui.Activator;
import org.spotter.eclipse.ui.model.IExtensionItem;
import org.spotter.shared.hierarchy.model.XPerformanceProblem;
import org.spotter.shared.result.model.ResultsContainer;
import org.spotter.shared.result.model.SpotterResult;
/**
 * 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.providers;


/**
 * An image provider for extension items displayed in the results view.
 * 
 * @author Denis Knoepfle
 * 
 */
public class ResultExtensionsImageProvider extends SpotterExtensionsImageProvider {

	private static final Image IMG_NO_LOOKUP = Activator.getImage("icons/exclamation.png");
	private static final Image IMG_DETECTED = Activator.getImage("icons/flag-red.png");
	private static final Image IMG_NOT_DETECTED = Activator.getImage("icons/flag-green.png");

	private ResultsContainer resultsContainer;

	/**
	 * Set the results container.
	 * 
	 * @param resultsContainer
	 *            The results container to set
	 */
	public void setResultsContainer(ResultsContainer resultsContainer) {
		this.resultsContainer = resultsContainer;
	}

	@Override
	public Image getImage(IExtensionItem item) {
		Object xmlModel = item.getModelWrapper().getXMLModel();
// Path: org.spotter.shared/src/org/spotter/shared/hierarchy/model/XPerformanceProblem.java
// @XmlAccessorType(XmlAccessType.FIELD)
// @XmlType(name = "PerformanceProblem", propOrder = { "extensionName", "uniqueId", "config", "problem" })
// @XmlRootElement(name = "root")
// public class XPerformanceProblem implements Serializable {
// 
// 	private static final long serialVersionUID = -3934559836199225205L;
// 
// 	@XmlElement(name = "extensionName", required = false)
// 	private String extensionName;
// 	
// 	/**
// 	 * The unique id is always required and is used to identify
// 	 * problem instances.
// 	 */
// 	@XmlElement(name = "uniqueId", required = true)
// 	private String uniqueId;
// 
// 	/**
// 	 * The configuration is always required. At least, the property
// 	 * if this node is detectable must be set.
// 	 */
// 	@XmlElement(name = "config", required = true)
// 	private List<XMConfiguration> config;
// 
// 	/**
// 	 * A sub node for a problem is not required, as
// 	 * a {@link XPerformanceProblem} can be a root-cause. A
// 	 * root-cause of a performance problem does not contain
// 	 * more problems.
// 	 */
// 	@XmlElement(name = "problem", required = false)
// 	private List<XPerformanceProblem> problem;
// 	
// 	/**
// 	 * @return the extensionName
// 	 */
// 	public String getExtensionName() {
// 		return extensionName;
// 	}
// 	
// 	/**
// 	 * @param extensionName the extensionName to set
// 	 */
// 	public void setExtensionName(String extensionName) {
// 		this.extensionName = extensionName;
// 	}
// 
// 	/**
// 	 * @return the uniqueId
// 	 */
// 	public String getUniqueId() {
// 		return uniqueId;
// 	}
// 	
// 	/**
// 	 * @param uniqueId the uniqueId to set
// 	 */
// 	public void setUniqueId(String uniqueId) {
// 		this.uniqueId = uniqueId;
// 	}
// 	
// 	/**
// 	 * @return the config
// 	 */
// 	public List<XMConfiguration> getConfig() {
// 		return config;
// 	}
// 	
// 	/**
// 	 * @param config the config to set
// 	 */
// 	public void setConfig(List<XMConfiguration> config) {
// 		this.config = config;
// 	}
// 	
// 	/**
// 	 * @return the problem
// 	 */
// 	public List<XPerformanceProblem> getProblem() {
// 		return problem;
// 	}
// 	
// 	/**
// 	 * @param problem the problem to set
// 	 */
// 	public void setProblem(List<XPerformanceProblem> problem) {
// 		this.problem = problem;
// 	}
// 
// }


// Path: org.spotter.eclipse.ui/src/org/spotter/eclipse/ui/providers/ResultExtensionsImageProvider.java
import org.eclipse.swt.graphics.Image;
import org.spotter.eclipse.ui.Activator;
import org.spotter.eclipse.ui.model.IExtensionItem;
import org.spotter.shared.hierarchy.model.XPerformanceProblem;
import org.spotter.shared.result.model.ResultsContainer;
import org.spotter.shared.result.model.SpotterResult;

/**
 * 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.providers;


/**
 * An image provider for extension items displayed in the results view.
 * 
 * @author Denis Knoepfle
 * 
 */
public class ResultExtensionsImageProvider extends SpotterExtensionsImageProvider {

	private static final Image IMG_NO_LOOKUP = Activator.getImage("icons/exclamation.png");
	private static final Image IMG_DETECTED = Activator.getImage("icons/flag-red.png");
	private static final Image IMG_NOT_DETECTED = Activator.getImage("icons/flag-green.png");

	private ResultsContainer resultsContainer;

	/**
	 * Set the results container.
	 * 
	 * @param resultsContainer
	 *            The results container to set
	 */
	public void setResultsContainer(ResultsContainer resultsContainer) {
		this.resultsContainer = resultsContainer;
	}

	@Override
	public Image getImage(IExtensionItem item) {
		Object xmlModel = item.getModelWrapper().getXMLModel();
		if (resultsContainer == null || !(xmlModel instanceof XPerformanceProblem)) {