source: trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/HandlerSetText.java @ 77

Last change on this file since 77 was 75, checked in by sherbold, 14 years ago
  • refactoring
File size: 785 bytes
Line 
1package de.ugoe.cs.eventbench.windows;
2
3import de.ugoe.cs.eventbench.windows.data.WindowTree;
4import de.ugoe.cs.eventbench.windows.data.WindowTreeNode;
5
6public 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.