source: trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/HandlerDestroy.java @ 619

Last change on this file since 619 was 619, checked in by pharms, 12 years ago
  • adapted implementation to now generate a full GUI model as well as concrete GUI interaction events
File size: 1.5 KB
Line 
1
2package de.ugoe.cs.quest.plugin.mfc;
3
4import de.ugoe.cs.quest.plugin.mfc.guimodel.WindowTree;
5
6/**
7 * <p>
8 * Handler for {@code WM_DESTROY} message. The handler maintains the {@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     * @param windowTree
22     *            the tree of GUI element specifications to be created and adapted during parsing
23     */
24    public HandlerDestroy(WindowTree windowTree) {
25        super(windowTree);
26    }
27
28    /**
29     * <p>
30     * HWND of the window that is destroyed.
31     * </p>
32     */
33    private long hwnd;
34
35    /*
36     * (non-Javadoc)
37     *
38     * @see de.ugoe.cs.quest.plugin.mfc.MessageHandler#onEndElement()
39     */
40    @Override
41    public void onEndElement() {
42        if (hwnd != 0) {
43            super.getWindowTree().remove(hwnd);
44        }
45    }
46
47    /*
48     * (non-Javadoc)
49     *
50     * @see de.ugoe.cs.quest.plugin.mfc.MessageHandler#onParameter(java.lang.String ,
51     * java.lang.String)
52     */
53    @Override
54    public void onParameter(String name, String value) {
55        if (name.equals("window.hwnd")) {
56            hwnd = Long.parseLong(value);
57        }
58    }
59
60    /*
61     * (non-Javadoc)
62     *
63     * @see de.ugoe.cs.quest.plugin.mfc.MessageHandler#onStartElement()
64     */
65    @Override
66    public void onStartElement() {
67        hwnd = 0;
68    }
69
70}
Note: See TracBrowser for help on using the repository browser.