1 package jp.ac.aiit.xdf.component.swing.mappers;
3 import java.util.HashMap;
6 import javax.swing.JTextArea;
7 import javax.swing.border.Border;
9 import jp.ac.aiit.xdf.component.swing.attribute.AttributeProcessingUnit;
10 import jp.ac.aiit.xdf.component.swing.attribute.GetterAttributeProcessor;
11 import jp.ac.aiit.xdf.component.swing.attribute.SetterAttributeProcessor;
12 import jp.ac.aiit.xdf.component.swing.event.KeyEventHandler;
13 import jp.ac.aiit.xdf.component.swing.event.SwingEventHandler;
14 import jp.ac.aiit.xdf.component.swing.event.SwingEventType;
15 import jp.ac.aiit.xdf.component.swing.typeconvert.BorderConverter;
16 import jp.ac.aiit.xdf.core.action.EventHandler;
17 import jp.ac.aiit.xdf.core.typeconvert.BooleanConverter;
18 import jp.ac.aiit.xdf.core.typeconvert.IntegerConverter;
19 import jp.ac.aiit.xdf.core.typeconvert.StringConverter;
22 * textareaタグをSwingのJTextAreaとしてマッピングするクラス
26 public class JTextAreaMapper extends SwingComponentMapperTemplate {
29 protected Map<String, AttributeProcessingUnit> initProcessingUnits() {
30 Map<String, AttributeProcessingUnit> result = new HashMap<String, AttributeProcessingUnit>();
31 result.put("value", new AttributeProcessingUnit(new SetterAttributeProcessor("setText", false), new GetterAttributeProcessor("getText"), new StringConverter()));
32 result.put("rows", new AttributeProcessingUnit(new SetterAttributeProcessor("setRows", true), new GetterAttributeProcessor("getRows"), new IntegerConverter()));
33 result.put("columns", new AttributeProcessingUnit(new SetterAttributeProcessor("setColumns", true), new GetterAttributeProcessor("getColumns"), new IntegerConverter()));
34 result.put("border", new AttributeProcessingUnit(new SetterAttributeProcessor("setBorder", Border.class), new GetterAttributeProcessor("getBorder"), new BorderConverter()));
35 result.put("editable", new AttributeProcessingUnit(new SetterAttributeProcessor("setEditable", true), new GetterAttributeProcessor("isEditable"), new BooleanConverter()));
41 protected Object newComponent() {
42 return new JTextArea();
46 protected void processingChildComponents() { }
49 protected Map<String, EventHandler> intiProcessingAction() {
50 Map<String, EventHandler> action = SwingEventHandler.commonEvent();
51 action.put("edit", new KeyEventHandler(SwingEventType.EDIT));