1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.xulux.guilayer.swing.listeners;
17
18 import java.awt.event.KeyAdapter;
19 import java.awt.event.KeyEvent;
20
21 import org.xulux.api.core.IPart;
22 import org.xulux.api.core.PartRequest;
23 import org.xulux.api.gui.IWidget;
24 import org.xulux.api.rules.IRuleEngine;
25 import org.xulux.core.XuluxContext;
26 import org.xulux.rules.impl.WidgetRequestImpl;
27
28
29
30
31
32
33
34
35 public class ImmidiateListener extends KeyAdapter {
36
37
38
39 private IWidget widget;
40
41
42
43 private IPart part;
44
45
46
47
48 public ImmidiateListener() {
49 }
50
51
52
53
54
55 public ImmidiateListener(IWidget widget) {
56 this.widget = widget;
57 this.part = widget.getPart();
58 }
59
60
61
62
63 public void keyTyped(KeyEvent e) {
64 WidgetRequestImpl impl = new WidgetRequestImpl(widget, PartRequest.ACTION_VALUE_CHANGED);
65 XuluxContext.getRuleEngine().fireFieldRequests(impl, IRuleEngine.EXECUTE_REQUEST);
66 }
67
68
69
70
71
72 public IWidget getWidget() {
73 return widget;
74 }
75
76
77
78
79
80 public void setWidget(IWidget widget) {
81 this.widget = widget;
82 }
83
84 }