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