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