Line | |
---|
1 | package de.ugoe.cs.eventbench.windows;
|
---|
2 |
|
---|
3 | import de.ugoe.cs.eventbench.windows.data.WindowTree;
|
---|
4 | import de.ugoe.cs.eventbench.windows.data.WindowTreeNode;
|
---|
5 |
|
---|
6 | public class HandlerSetText extends MessageHandler {
|
---|
7 |
|
---|
8 | public HandlerSetText() {
|
---|
9 | super();
|
---|
10 | }
|
---|
11 |
|
---|
12 | private String windowName;
|
---|
13 | private int hwnd;
|
---|
14 |
|
---|
15 | @Override
|
---|
16 | public void onEndElement() {
|
---|
17 | if (hwnd != 0) {
|
---|
18 | WindowTreeNode node = WindowTree.getInstance().find(hwnd);
|
---|
19 | node.setName(windowName);
|
---|
20 | }
|
---|
21 | }
|
---|
22 |
|
---|
23 | @Override
|
---|
24 | public void onParameter(String name, String value) {
|
---|
25 | if (name.equals("window.hwnd")) {
|
---|
26 | hwnd = Integer.parseInt(value);
|
---|
27 | } else if (name.equals("window.newText")) {
|
---|
28 | windowName = value;
|
---|
29 | }
|
---|
30 | }
|
---|
31 |
|
---|
32 | @Override
|
---|
33 | public void onStartElement() {
|
---|
34 | windowName = "";
|
---|
35 | hwnd = 0;
|
---|
36 | }
|
---|
37 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.