}
final String buttonName = ButtonEventConfig.getButtonName(event);
final ClassLoader cl = this.getClassLoader(pos);
if (buttonName != null) {
final SwingWorker worker = new SwingWorker() {
public Object construct() {
if (cl != null) {
Thread.currentThread().setContextClassLoader(cl);
}
try {
ButtonEventConfig.invokeButtonEvent(buttonName, pos, event);
} catch (ButtonEventConfig.ButtonEventNotFound e) {
Debug.logWarning(e, "Button not found - " + buttonName, module);
} catch (ButtonEventConfig.ButtonEventException e) {
Debug.logError(e, "Button invocation exception - " + buttonName, module);
}
return null;
}
};
worker.start();
} else {
Debug.logWarning("No button name found for buttonPressed event", module);
}
}