package com.mindoo.ec09.example5.ca;

/**
 * This bean contains all the properties and actions that the SampleView viewpart knows to
 * communicate with external CA components.
 * 
 * @author Karsten Lehmann
 */
public class SampleViewBean extends ViewBean {
	//data string for a data view of our legacy application
	private String m_viewData;
	private String m_removeActionSets;
	private String m_closeViews;
	
	public SampleViewBean() {
		super();
		m_viewData="";
		m_removeActionSets="";
		m_closeViews="";
	}
	
	public String getViewData() {
		return m_viewData;
	}
	
	public void setViewData(String data) {
		queuePropertyChange("viewData", m_viewData, data);
		m_viewData=data;
		firePropertyChange();
	}
	
	public void setRemoveActionSets(String data) {
		queuePropertyChange("removeActionSets", m_removeActionSets, data);
		m_removeActionSets=data;
		firePropertyChange();
	}
	
	public String getRemoveActionSets() {
		return m_removeActionSets;
	}
	
	public void setCloseViews(String data) {
		//Enforce every incoming property to be accepted, although it may have been sent before
		if (data!=null && data.equals(m_closeViews))
			setCloseViews(null);
		
		queuePropertyChange("closeViews", m_closeViews, data);
		m_closeViews=data;
		firePropertyChange();
	}
	
	public String getCloseViews() {
		return m_closeViews;
	}
}
