package de.dass_it.vanhelsing.gui;

import de.dass_it.vanhelsing.gui.items.ItemType;
import de.dass_it.vanhelsing.gui.items.UserObjectItem;
import de.dass_it.vanhelsing.gui.ValidationItem.*;

public class ViewItem extends ItemType implements UserObjectItem {
	private String key;
	private String keyValue;
	private String inputText;
	private String selectOneMenu;
	private boolean necessary;
	private String renderer;
	private String dataType;
	
	public ViewItem(){
		inputText = null;
		selectOneMenu = null;
	}
	
	public boolean isNecessary() {
		return necessary;
	}

	public void setNecessary(boolean necessary) {
		this.necessary = necessary;
	}

	public String getRenderer() {
		return renderer;
	}

	public void setRenderer(String renderer) {
		this.renderer = renderer;
	}

	public String getDataType() {
		return dataType;
	}

	public void setDataType(String dataType) {
		this.dataType = dataType;
	}

	
	//Methoden aus ItemType für die Zuordnung von Änderungen
	public int getResId(){
		return super.getResId();
	}
	public void setResId(int id){
		super.setResId(id);
	}
	public String getResType(){
		return super.getResType();
	}
	public void setResType(String resType){
		super.setResType(resType);
	}
	//eigene Felder für die Tabellenspalten
	public void setKey(String key) {
		this.key = key;
	}

	public String getKey() {
		return key;
	}
	
	public String getKeyValue() {
		return keyValue;
	}

	public void setKeyValue(String keyValue) {
		this.keyValue = keyValue;
	}

	public void setInputText(String inputText) {
		this.inputText = inputText;
	}

	public String getInputText() {
		return inputText;
	}

	public void setSelectOneMenu(String selectOneMenu) {
		this.selectOneMenu = selectOneMenu;
	}

	public String getSelectOneMenu() {
		return selectOneMenu;
	}
	public void setRendererFlag(String r){
		if (r.equals("inputText")) {
			this.inputText = new String("bernd");
			this.selectOneMenu = null;
		}
		if (r.equals("selectOneMenu")){
			this.selectOneMenu = new String ("bernd");
			this.inputText = null;
		}
	}
}
