1 package jp.ac.aiit.xdf.component.swing.event;
3 import javax.swing.AbstractButton;
4 import javax.swing.JTextField;
6 import jp.ac.aiit.xdf.core.action.Action;
7 import jp.ac.aiit.xdf.core.model.ObjectModel;
11 * Swing コンポーネントにActionEventにて、ユーザ定義アクションをバンディングする
15 public class ActionEventHandler extends SwingEventHandler{
16 private SwingEventType event;
20 * @param eventtype イベントタイプ:ユーザガイドのアクションの実装にイベント名を示しているもの
22 public ActionEventHandler(SwingEventType eventtype){
23 this.event = eventtype;
27 public void setEvent(ObjectModel target, Object component, Action action) {
28 UIEventListener listener = new UIEventListener(target, event, action);
29 if (target.tagname().equals("textfield")){
30 ((JTextField)component).addActionListener(listener);
32 ((AbstractButton) component).addActionListener(listener);