Last change
on this file since 644 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.7 KB
|
Rev | Line | |
---|
[619] | 1 |
|
---|
[434] | 2 | package de.ugoe.cs.quest.plugin.mfc;
|
---|
[1] | 3 |
|
---|
[619] | 4 | import de.ugoe.cs.quest.plugin.mfc.guimodel.WindowTree;
|
---|
[1] | 5 |
|
---|
[171] | 6 | /**
|
---|
| 7 | * <p>
|
---|
| 8 | * Handles {@code WM_SETTEXT} messages. Handler maintains the {@link WindowTree}.
|
---|
| 9 | * </p>
|
---|
| 10 | *
|
---|
| 11 | * @author Steffen Herbold
|
---|
| 12 | * @version 1.0
|
---|
| 13 | */
|
---|
[1] | 14 | public class HandlerSetText extends MessageHandler {
|
---|
| 15 |
|
---|
[619] | 16 | /**
|
---|
| 17 | * <p>
|
---|
| 18 | * Constructor. Creates a new HanderSetText.
|
---|
| 19 | * </p>
|
---|
| 20 | *
|
---|
| 21 | * @param windowTree
|
---|
| 22 | * the tree of GUI element specifications to be created and adapted during parsing
|
---|
| 23 | */
|
---|
| 24 | public HandlerSetText(WindowTree windowTree) {
|
---|
| 25 | super(windowTree);
|
---|
| 26 | }
|
---|
[1] | 27 |
|
---|
[619] | 28 | /**
|
---|
| 29 | * <p>
|
---|
| 30 | * New name of the window.
|
---|
| 31 | * </p>
|
---|
| 32 | */
|
---|
| 33 | private String windowName;
|
---|
[171] | 34 |
|
---|
[619] | 35 | /**
|
---|
| 36 | * <p>
|
---|
| 37 | * HWND of the window.
|
---|
| 38 | * </p>
|
---|
| 39 | */
|
---|
| 40 | private long hwnd;
|
---|
[1] | 41 |
|
---|
[619] | 42 | /*
|
---|
| 43 | * (non-Javadoc)
|
---|
| 44 | *
|
---|
| 45 | * @see de.ugoe.cs.quest.plugin.mfc.MessageHandler#onEndElement()
|
---|
| 46 | */
|
---|
| 47 | @Override
|
---|
| 48 | public void onEndElement() {
|
---|
| 49 | if (hwnd != 0) {
|
---|
| 50 | super.getWindowTree().setName(hwnd, windowName);
|
---|
| 51 | }
|
---|
| 52 | }
|
---|
[1] | 53 |
|
---|
[619] | 54 | /*
|
---|
| 55 | * (non-Javadoc)
|
---|
| 56 | *
|
---|
| 57 | * @see de.ugoe.cs.quest.plugin.mfc.MessageHandler#onParameter(java.lang.String ,
|
---|
| 58 | * java.lang.String)
|
---|
| 59 | */
|
---|
| 60 | @Override
|
---|
| 61 | public void onParameter(String name, String value) {
|
---|
| 62 | if (name.equals("window.hwnd")) {
|
---|
| 63 | hwnd = Long.parseLong(value);
|
---|
| 64 | }
|
---|
| 65 | else if (name.equals("window.newText")) {
|
---|
| 66 | windowName = value;
|
---|
| 67 | }
|
---|
| 68 | }
|
---|
[1] | 69 |
|
---|
[619] | 70 | /*
|
---|
| 71 | * (non-Javadoc)
|
---|
| 72 | *
|
---|
| 73 | * @see de.ugoe.cs.quest.plugin.mfc.MessageHandler#onStartElement()
|
---|
| 74 | */
|
---|
| 75 | @Override
|
---|
| 76 | public void onStartElement() {
|
---|
| 77 | windowName = "";
|
---|
| 78 | hwnd = 0;
|
---|
| 79 | }
|
---|
[1] | 80 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.