source: trunk/quest-ui-core/src/de/ugoe/cs/quest/plugin/mfc/HandlerDestroy.java @ 434

Last change on this file since 434 was 434, checked in by sherbold, 12 years ago
  • renamed packages to fit QUEST project structure
File size: 1.2 KB
Line 
1package de.ugoe.cs.quest.plugin.mfc;
2
3import de.ugoe.cs.quest.plugin.mfc.eventcore.WindowTree;
4
5/**
6 * <p>
7 * Handler for {@code WM_DESTROY} message. The handler maintains the
8 * {@link WindowTree}.
9 * </p>
10 *
11 * @author Steffen Herbold
12 * @version 1.0
13 */
14public class HandlerDestroy extends MessageHandler {
15
16        /**
17         * <p>
18         * Constructor. Creates a new HandlerDestroy.
19         * </p>
20         */
21        public HandlerDestroy() {
22                super();
23        }
24
25        /**
26         * <p>
27         * HWND of the window that is destroyed.
28         * </p>
29         */
30        private int hwnd;
31
32        /*
33         * (non-Javadoc)
34         *
35         * @see de.ugoe.cs.quest.plugin.mfc.MessageHandler#onEndElement()
36         */
37        @Override
38        public void onEndElement() {
39                if (hwnd != 0) {
40                        WindowTree.getInstance().remove(hwnd);
41                }
42        }
43
44        /*
45         * (non-Javadoc)
46         *
47         * @see
48         * de.ugoe.cs.quest.plugin.mfc.MessageHandler#onParameter(java.lang.String
49         * , java.lang.String)
50         */
51        @Override
52        public void onParameter(String name, String value) {
53                if (name.equals("window.hwnd")) {
54                        hwnd = Integer.parseInt(value);
55                }
56        }
57
58        /*
59         * (non-Javadoc)
60         *
61         * @see de.ugoe.cs.quest.plugin.mfc.MessageHandler#onStartElement()
62         */
63        @Override
64        public void onStartElement() {
65                hwnd = 0;
66        }
67
68}
Note: See TracBrowser for help on using the repository browser.