String componentListenerInfo = "";
Windows ws = Windows.getWindows(ureq);
Window window = ws.getWindow(ureq);
if (window != null) {
Component target = window.getAndClearLatestDispatchedComponent();
if (target != null) {
// there was a component id given, and a matching target could be found
componentListenerInfo = "<dispatchinfo>\n\t<componentinfo>\n\t\t<compname>" + target.getComponentName() + "</compname>\n\t\t<compclass>"
+ target.getClass().getName() + "</compclass>\n\t\t<extendedinfo>" + target.getExtendedDebugInfo()
+ "</extendedinfo>\n\t\t<event>";
Event latestEv = target.getAndClearLatestFiredEvent();
if (latestEv != null) {
componentListenerInfo += "\n\t\t\t<class>"+latestEv.getClass().getName()+"</class>\n\t\t\t<command>"+latestEv.getCommand()+"</command>\n\t\t\t<tostring>"+latestEv+"</tostring>";
}
componentListenerInfo += "\n\t\t</event>\n\t</componentinfo>\n\t<controllerinfo>";
Controller c = target.getLatestDispatchedController();
if (c != null) {
// can be null if the error occured in the component itself
// componentListenerInfo += c.toString();
//WindowControl control = c.getWindowControl();
// sorry, getting windowcontrol on a controller which does not have one (all should have one, legacy) throws an exception