// MAGIC: this is the default property, let's just do toString()
return new Variant(toString());
} else if (dispId == 1) {
if ((flags & COM.DISPATCH_METHOD) != 0) {
try {
IDispatch frameWnd =
params[0].getType() == COM.VT_DISPATCH ? params[0].getDispatch() : null;
boolean success = gwtOnLoad(frameWnd);
// boolean return type
return new Variant(success);
} catch (SWTException e) {
throw new HResultException(COM.E_INVALIDARG);
}
} else if ((flags & COM.DISPATCH_PROPERTYGET) != 0) {
// property get on the method itself
try {
Method gwtOnLoadMethod =
getClass().getMethod("gwtOnLoad", new Class[]{IDispatch.class});
MethodAdaptor methodAdaptor = new MethodAdaptor(gwtOnLoadMethod);
IDispatchImpl funcObj = new MethodDispatch(null, methodAdaptor);
IDispatch disp = new IDispatch(funcObj.getAddress());
disp.AddRef();
return new Variant(disp);
} catch (Exception e) {
// just return VT_EMPTY
return new Variant();
}