Changeset 277 for trunk/JFCMonitor/src/de/ugoe
- Timestamp:
- 12/06/11 11:46:11 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JFCMonitor/src/de/ugoe/cs/eventbench/jfcmonitor/JFCListener.java
r271 r277 101 101 */ 102 102 private void addSourceInfo(StringBuilder builder, AWTEvent event) { 103 builder.append(" <param name=\"Source\" value=\"" 103 builder.append(" <source>" + ENDLINE); 104 builder.append(" <param name=\"toString\" value=\"" 104 105 + event.getSource().toString() + "\" />" + ENDLINE); 105 106 if (event.getSource() instanceof Component) { 106 107 Component source = (Component) event.getSource(); 107 addComponentInfo(builder, source, "Source"); 108 addComponentInfo(builder, source.getParent(), "Parent"); 108 addComponentInfo(builder, source); 109 builder.append(" <parent>" + ENDLINE); 110 addComponentInfo(builder, source.getParent()); 111 builder.append(" </parent>" + ENDLINE); 109 112 } 113 builder.append(" </source>" + ENDLINE); 110 114 } 111 115 … … 120 124 * @param component 121 125 * component whose information is appended 122 * @param prefix123 * prefix to give further information about the component124 126 */ 125 private void addComponentInfo(StringBuilder builder, Component component, 126 String prefix) { 127 builder.append(" <param name=\"" + prefix + "Name\" value=\"" 127 private void addComponentInfo(StringBuilder builder, Component component) { 128 builder.append(" <param name=\"getName\" value=\"" 128 129 + component.getName() + "\" />" + ENDLINE); 129 130 for (Method method : component.getClass().getMethods()) { … … 132 133 String text = (String) method.invoke(component, 133 134 new Object[] {}); 134 builder.append(" <param name=\"" + prefix 135 + "Text\" value=\"" + text + "\" />" + ENDLINE); 135 builder.append(" <param name=\"getText\" value=\"" + text + "\" />" + ENDLINE); 136 136 } 137 137 if (method.getName() == "getTitle") { 138 138 String title = (String) method.invoke(component, 139 139 new Object[] {}); 140 builder.append(" <param name=\"" + prefix 141 + "Title\" value=\"" + title + "\" />" + ENDLINE); 140 builder.append(" <param name=\"getTitle\" value=\"" + title + "\" />" + ENDLINE); 142 141 } 143 142 } catch (IllegalArgumentException e) {
Note: See TracChangeset
for help on using the changeset viewer.