source: trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/MessageHandler.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.9 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 * Base class to define custom message handlers, for messages that shall be handled differently
9 * during the parsing of usage logs. It provides dummy implementations for all required methods,
10 * such that implementations can only overwrite the parts they actually require and ignore the rest.
11 * </p>
12 *
13 * @author Steffen Herbold
14 * @version 1.0
15 */
16public class MessageHandler {
17
18    /**
19     * <p>
20     * during parsing, a tree of GUI elements is created and adapted.
21     * This is the reference to it.
22     * </p>
23     */
24    private WindowTree windowTree;
25
26    /**
27     * <p>
28     * Constructor. Protected to prohibit initialization of the base class itself.
29     * </p>
30     *
31     * @param windowTree the tree of GUI element specifications to be created and adapted during
32     *                   parsing
33     */
34    protected MessageHandler(WindowTree windowTree) {
35        this.windowTree = windowTree;
36    }
37
38    /**
39     * <p>
40     * Called in the startElement() method of the {@link MFCLogParser} when a msg-node begins.
41     * </p>
42     */
43    public void onStartElement() {}
44
45    /**
46     * <p>
47     * Called by the {@link MFCLogParser} to handle param-nodes.
48     * </p>
49     *
50     * @param name
51     *            name (type) of the parameter
52     * @param value
53     *            value of the parameter
54     */
55    public void onParameter(String name, String value) {}
56
57    /**
58     * <p>
59     * Called in the endElement() method of {@link MFCLogParser} when a msg-node ends.
60     * </p>
61     */
62    public void onEndElement() {}
63
64    /**
65     * @return the window tree created and adapted during parsing
66     */
67    protected WindowTree getWindowTree() {
68        return windowTree;
69    }
70   
71}
Note: See TracBrowser for help on using the repository browser.