[927] | 1 | // Copyright 2012 Georg-August-Universität Göttingen, Germany
|
---|
| 2 | //
|
---|
| 3 | // Licensed under the Apache License, Version 2.0 (the "License");
|
---|
| 4 | // you may not use this file except in compliance with the License.
|
---|
| 5 | // You may obtain a copy of the License at
|
---|
| 6 | //
|
---|
| 7 | // http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 8 | //
|
---|
| 9 | // Unless required by applicable law or agreed to in writing, software
|
---|
| 10 | // distributed under the License is distributed on an "AS IS" BASIS,
|
---|
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
| 12 | // See the License for the specific language governing permissions and
|
---|
| 13 | // limitations under the License.
|
---|
| 14 |
|
---|
[922] | 15 | package de.ugoe.cs.autoquest.plugin.mfc;
|
---|
[1] | 16 |
|
---|
[940] | 17 | import de.ugoe.cs.autoquest.plugin.mfc.guimodel.MFCWindowTree;
|
---|
[619] | 18 |
|
---|
[171] | 19 | /**
|
---|
| 20 | * <p>
|
---|
[619] | 21 | * Base class to define custom message handlers, for messages that shall be handled differently
|
---|
| 22 | * during the parsing of usage logs. It provides dummy implementations for all required methods,
|
---|
| 23 | * such that implementations can only overwrite the parts they actually require and ignore the rest.
|
---|
[171] | 24 | * </p>
|
---|
| 25 | *
|
---|
| 26 | * @author Steffen Herbold
|
---|
| 27 | * @version 1.0
|
---|
| 28 | */
|
---|
| 29 | public class MessageHandler {
|
---|
[1] | 30 |
|
---|
[619] | 31 | /**
|
---|
| 32 | * <p>
|
---|
| 33 | * during parsing, a tree of GUI elements is created and adapted.
|
---|
| 34 | * This is the reference to it.
|
---|
| 35 | * </p>
|
---|
| 36 | */
|
---|
[940] | 37 | private MFCWindowTree windowTree;
|
---|
[171] | 38 |
|
---|
[619] | 39 | /**
|
---|
| 40 | * <p>
|
---|
| 41 | * Constructor. Protected to prohibit initialization of the base class itself.
|
---|
| 42 | * </p>
|
---|
| 43 | *
|
---|
| 44 | * @param windowTree the tree of GUI element specifications to be created and adapted during
|
---|
| 45 | * parsing
|
---|
| 46 | */
|
---|
[940] | 47 | protected MessageHandler(MFCWindowTree windowTree) {
|
---|
[619] | 48 | this.windowTree = windowTree;
|
---|
| 49 | }
|
---|
[171] | 50 |
|
---|
[619] | 51 | /**
|
---|
| 52 | * <p>
|
---|
| 53 | * Called in the startElement() method of the {@link MFCLogParser} when a msg-node begins.
|
---|
| 54 | * </p>
|
---|
| 55 | */
|
---|
| 56 | public void onStartElement() {}
|
---|
[171] | 57 |
|
---|
[619] | 58 | /**
|
---|
| 59 | * <p>
|
---|
| 60 | * Called by the {@link MFCLogParser} to handle param-nodes.
|
---|
| 61 | * </p>
|
---|
| 62 | *
|
---|
| 63 | * @param name
|
---|
| 64 | * name (type) of the parameter
|
---|
| 65 | * @param value
|
---|
| 66 | * value of the parameter
|
---|
| 67 | */
|
---|
| 68 | public void onParameter(String name, String value) {}
|
---|
| 69 |
|
---|
| 70 | /**
|
---|
| 71 | * <p>
|
---|
| 72 | * Called in the endElement() method of {@link MFCLogParser} when a msg-node ends.
|
---|
| 73 | * </p>
|
---|
| 74 | */
|
---|
| 75 | public void onEndElement() {}
|
---|
| 76 |
|
---|
| 77 | /**
|
---|
| 78 | * @return the window tree created and adapted during parsing
|
---|
| 79 | */
|
---|
[940] | 80 | protected MFCWindowTree getWindowTree() {
|
---|
[619] | 81 | return windowTree;
|
---|
| 82 | }
|
---|
| 83 |
|
---|
[1] | 84 | }
|
---|