Component.java 1.82 KB
Newer Older
Naung1 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
package com.csc.library.components;


import com.csc.library.utilities.MyLog;

public class Component {

	TagManager genTag;
	ComponentManager cm;

	
	public String getInput() {
		return this.genTag.getInput();
	}
	public void setSpace(int space) {
		this.genTag.setSpace(space);
	}
	public String getUI() {
		return this.genTag.process();
	}
	public String getLabel() {
		return this.genTag.getLabel();
	}
	public void process(ComponentManager cm) {
		String comtype =cm.getComType();
		
			if (("password").equalsIgnoreCase(comtype)) {
				genTag = new Password(cm);
				
			} else if (("label").equalsIgnoreCase(comtype)) {
				Label label1 = new Label(cm);
				label1.setLabel(cm.getProperty("value"));
				genTag = (TagManager) label1;
				
			} else if (("text").equalsIgnoreCase(comtype)) {
				genTag = new Text(cm);
				
			} else if (("radio").equalsIgnoreCase(comtype)) {
				genTag = new Radio(cm);
				
			} else if (("checkbox").equalsIgnoreCase(comtype)) {
				genTag = new CheckBox(cm);
				
			} else if (("menu").equalsIgnoreCase(comtype)) {
				genTag = new Menu(cm);
				
			} else if (("list").equalsIgnoreCase(comtype)) {
				genTag = new ListBox(cm);
				
			} else if (("textarea").equalsIgnoreCase(comtype)) {
				genTag = new Textarea(cm);
				
			} else if (("hidden").equalsIgnoreCase(comtype)) {
				genTag = new Hidden(cm);
				
			} else if (("tel").equalsIgnoreCase(comtype)) {
				genTag = new Tel(cm);
				
			} else if (("mobile").equalsIgnoreCase(comtype)) {
				genTag = new Mobile(cm);
				
			} else if (("calendar").equalsIgnoreCase(comtype)) {
				genTag = new Calendar(cm);
				
			} else if (("fileupload").equalsIgnoreCase(comtype)) {
				genTag = new Fileupload(cm);
				
			} else {
				MyLog.warn(this, "Component type not found");
			}

	} // process
	public TagManager getTag() {
		return genTag;
	}
} // component