// Path: src/java/com/idega/xformsmanager/business/component/ComponentSelect.java
// public interface ComponentSelect extends Component {
// 
// 	public abstract PropertiesSelect getProperties();
// }
// 
// Path: src/java/com/idega/xformsmanager/business/component/properties/PropertiesSelect.java
// public interface PropertiesSelect extends PropertiesComponent {
// 	
// 	public static final int LOCAL_DATA_SRC = 1;
// 	public static final int EXTERNAL_DATA_SRC = 2;
// 	
// 	public abstract LocalizedItemsetBean getItemset();
// 
// 	public abstract String getExternalDataSrc();
// 
// 	public abstract void setExternalDataSrc(String external_data_src);
// 
// 	public abstract Integer getDataSrcUsed();
// 
// 	public abstract void setDataSrcUsed(Integer data_src_used);
// }
// 
// Path: src/java/com/idega/xformsmanager/component/properties/impl/ComponentPropertiesSelect.java
// public class ComponentPropertiesSelect extends ComponentProperties implements PropertiesSelect {
// 	
// 	private String external_data_src;
// 	private LocalizedItemsetBean itemset;
// 	private Integer data_src_used;
// 	
// 	public LocalizedItemsetBean getItemset() {
// 		return itemset;
// 	}
// 	public void setItemsetPlain(LocalizedItemsetBean itemset) {
// 		this.itemset = itemset;
// 	}
// 	public String getExternalDataSrc() {
// 		return external_data_src;
// 	}
// 	/**
// 	 * @param external_data_src - source to xml, containing data source<br />
// 	 * <b>IMPORTANT:</b> xml data structure should validate against 
// 	 * select-data-src.xsd (look somewhere around for it, probably in resources/templates).
// 	 * See also select-data-src.xml for example.
// 	 * 
// 	 */
// 	public void setExternalDataSrc(String external_data_src) {
// 		this.external_data_src = external_data_src;
// 		component.update(ConstUpdateType.EXTERNAL_DATA_SRC);
// 	}
// 	public void setExternalDataSrcPlain(String external_data_src) {
// 		this.external_data_src = external_data_src;
// 	}
// 	public Integer getDataSrcUsed() {
// 		return data_src_used;
// 	}
// 	public void setDataSrcUsed(Integer data_src_used) {
// 		
// 		if(data_src_used != LOCAL_DATA_SRC && data_src_used != EXTERNAL_DATA_SRC)
// 			throw new IllegalArgumentException("Neither LOCAL_DATA_SRC, nor EXTERNAL_DATA_SRC provided.");
// 		
// 		this.data_src_used = data_src_used;
// 		component.update(ConstUpdateType.DATA_SRC_USED);
// 	}
// 	public void setDataSrcUsedPlain(Integer data_src_used) {
// 		
// 		if(data_src_used != null && data_src_used != LOCAL_DATA_SRC && data_src_used != EXTERNAL_DATA_SRC)
// 			throw new IllegalArgumentException("Neither LOCAL_DATA_SRC, nor EXTERNAL_DATA_SRC provided.");
// 		
// 		this.data_src_used = data_src_used;
// 	}
// }
// 
// Path: src/java/com/idega/xformsmanager/component/properties/impl/ConstUpdateType.java
// public enum ConstUpdateType {
// 	
// 	LABEL,
// 	CONSTRAINT_REQUIRED,
// 	CALCULATE,
// 	CALCULATE_EXP,
// 	ERROR_MSG,
// 	P3P_TYPE,
// 	ITEMSET,
// 	EXTERNAL_DATA_SRC,
// 	THANKYOU_TEXT,
// 	AUTOFILL_KEY,
// 	HELP_TEXT,
// //	READ_ONLY,
// 	TEXT,
// 	STEPS_VISUALIZATION_USED,
// 	SUBMISSION_ACTION,
// 	VARIABLE_NAME,
// 	BUTTON_REFER_TO_ACTION,
// 	DATA_SRC_USED,
// 	ADD_BUTTON_LABEL,
// 	REMOVE_BUTTON_LABEL,
// 	DESCRIPTION_BUTTON_LABEL,
// 	UPLOADING_FILE_DESC,
// 	UPLOADER_HEADER_TEXT,
// 	HTML_EDITOR;
// //	VALIDATION;
// }
// 
// Path: src/java/com/idega/xformsmanager/manager/XFormsManagerSelect.java
// public interface XFormsManagerSelect extends XFormsManager {
// 
// 	public abstract Integer getDataSrcUsed(FormComponent component);
// 
// 	public abstract String getExternalDataSrc(FormComponent component);
// 
// 	public abstract LocalizedItemsetBean getItemset(FormComponent component);
// 
// 	public abstract void removeSelectComponentSourcesFromXFormsDocument(
// 			FormComponent component);
// }


import com.idega.xformsmanager.business.component.ComponentSelect;
import com.idega.xformsmanager.business.component.properties.PropertiesSelect;
import com.idega.xformsmanager.component.properties.impl.ComponentPropertiesSelect;
import com.idega.xformsmanager.component.properties.impl.ConstUpdateType;
import com.idega.xformsmanager.manager.XFormsManagerSelect;
package com.idega.xformsmanager.component.impl;


/**
 * @author <a href="mailto:civilis@idega.com">Vytautas Čivilis</a>
 * @version $Revision: 1.2 $
 * 
 *          Last modified: $Date: 2008/11/03 12:57:37 $ by $Author: civilis $
 */
public class FormComponentSelectImpl extends FormComponentImpl implements
		ComponentSelect {

	@Override
	public XFormsManagerSelect getXFormsManager() {

		return getFormDocument().getContext().getXformsManagerFactory()
				.getXformsManagerSelect();
	}

	@Override
	public PropertiesSelect getProperties() {

		if (properties == null) {
			ComponentPropertiesSelect properties = new ComponentPropertiesSelect();
			properties.setComponent(this);
			this.properties = properties;
		}

		return (PropertiesSelect) properties;
	}

	@Override
	protected void setProperties() {

		super.setProperties();

// Path: src/java/com/idega/xformsmanager/business/component/ComponentSelect.java
// public interface ComponentSelect extends Component {
// 
// 	public abstract PropertiesSelect getProperties();
// }
// 
// Path: src/java/com/idega/xformsmanager/business/component/properties/PropertiesSelect.java
// public interface PropertiesSelect extends PropertiesComponent {
// 	
// 	public static final int LOCAL_DATA_SRC = 1;
// 	public static final int EXTERNAL_DATA_SRC = 2;
// 	
// 	public abstract LocalizedItemsetBean getItemset();
// 
// 	public abstract String getExternalDataSrc();
// 
// 	public abstract void setExternalDataSrc(String external_data_src);
// 
// 	public abstract Integer getDataSrcUsed();
// 
// 	public abstract void setDataSrcUsed(Integer data_src_used);
// }
// 
// Path: src/java/com/idega/xformsmanager/component/properties/impl/ComponentPropertiesSelect.java
// public class ComponentPropertiesSelect extends ComponentProperties implements PropertiesSelect {
// 	
// 	private String external_data_src;
// 	private LocalizedItemsetBean itemset;
// 	private Integer data_src_used;
// 	
// 	public LocalizedItemsetBean getItemset() {
// 		return itemset;
// 	}
// 	public void setItemsetPlain(LocalizedItemsetBean itemset) {
// 		this.itemset = itemset;
// 	}
// 	public String getExternalDataSrc() {
// 		return external_data_src;
// 	}
// 	/**
// 	 * @param external_data_src - source to xml, containing data source<br />
// 	 * <b>IMPORTANT:</b> xml data structure should validate against 
// 	 * select-data-src.xsd (look somewhere around for it, probably in resources/templates).
// 	 * See also select-data-src.xml for example.
// 	 * 
// 	 */
// 	public void setExternalDataSrc(String external_data_src) {
// 		this.external_data_src = external_data_src;
// 		component.update(ConstUpdateType.EXTERNAL_DATA_SRC);
// 	}
// 	public void setExternalDataSrcPlain(String external_data_src) {
// 		this.external_data_src = external_data_src;
// 	}
// 	public Integer getDataSrcUsed() {
// 		return data_src_used;
// 	}
// 	public void setDataSrcUsed(Integer data_src_used) {
// 		
// 		if(data_src_used != LOCAL_DATA_SRC && data_src_used != EXTERNAL_DATA_SRC)
// 			throw new IllegalArgumentException("Neither LOCAL_DATA_SRC, nor EXTERNAL_DATA_SRC provided.");
// 		
// 		this.data_src_used = data_src_used;
// 		component.update(ConstUpdateType.DATA_SRC_USED);
// 	}
// 	public void setDataSrcUsedPlain(Integer data_src_used) {
// 		
// 		if(data_src_used != null && data_src_used != LOCAL_DATA_SRC && data_src_used != EXTERNAL_DATA_SRC)
// 			throw new IllegalArgumentException("Neither LOCAL_DATA_SRC, nor EXTERNAL_DATA_SRC provided.");
// 		
// 		this.data_src_used = data_src_used;
// 	}
// }
// 
// Path: src/java/com/idega/xformsmanager/component/properties/impl/ConstUpdateType.java
// public enum ConstUpdateType {
// 	
// 	LABEL,
// 	CONSTRAINT_REQUIRED,
// 	CALCULATE,
// 	CALCULATE_EXP,
// 	ERROR_MSG,
// 	P3P_TYPE,
// 	ITEMSET,
// 	EXTERNAL_DATA_SRC,
// 	THANKYOU_TEXT,
// 	AUTOFILL_KEY,
// 	HELP_TEXT,
// //	READ_ONLY,
// 	TEXT,
// 	STEPS_VISUALIZATION_USED,
// 	SUBMISSION_ACTION,
// 	VARIABLE_NAME,
// 	BUTTON_REFER_TO_ACTION,
// 	DATA_SRC_USED,
// 	ADD_BUTTON_LABEL,
// 	REMOVE_BUTTON_LABEL,
// 	DESCRIPTION_BUTTON_LABEL,
// 	UPLOADING_FILE_DESC,
// 	UPLOADER_HEADER_TEXT,
// 	HTML_EDITOR;
// //	VALIDATION;
// }
// 
// Path: src/java/com/idega/xformsmanager/manager/XFormsManagerSelect.java
// public interface XFormsManagerSelect extends XFormsManager {
// 
// 	public abstract Integer getDataSrcUsed(FormComponent component);
// 
// 	public abstract String getExternalDataSrc(FormComponent component);
// 
// 	public abstract LocalizedItemsetBean getItemset(FormComponent component);
// 
// 	public abstract void removeSelectComponentSourcesFromXFormsDocument(
// 			FormComponent component);
// }


// Path: src/java/com/idega/xformsmanager/component/impl/FormComponentSelectImpl.java
import com.idega.xformsmanager.business.component.ComponentSelect;
import com.idega.xformsmanager.business.component.properties.PropertiesSelect;
import com.idega.xformsmanager.component.properties.impl.ComponentPropertiesSelect;
import com.idega.xformsmanager.component.properties.impl.ConstUpdateType;
import com.idega.xformsmanager.manager.XFormsManagerSelect;

package com.idega.xformsmanager.component.impl;


/**
 * @author <a href="mailto:civilis@idega.com">Vytautas Čivilis</a>
 * @version $Revision: 1.2 $
 * 
 *          Last modified: $Date: 2008/11/03 12:57:37 $ by $Author: civilis $
 */
public class FormComponentSelectImpl extends FormComponentImpl implements
		ComponentSelect {

	@Override
	public XFormsManagerSelect getXFormsManager() {

		return getFormDocument().getContext().getXformsManagerFactory()
				.getXformsManagerSelect();
	}

	@Override
	public PropertiesSelect getProperties() {

		if (properties == null) {
			ComponentPropertiesSelect properties = new ComponentPropertiesSelect();
			properties.setComponent(this);
			this.properties = properties;
		}

		return (PropertiesSelect) properties;
	}

	@Override
	protected void setProperties() {

		super.setProperties();

		ComponentPropertiesSelect properties = (ComponentPropertiesSelect) getProperties();