RTTI (runtime type information) and qx classes

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RTTI (runtime type information) and qx classes

Bugdog
Gentleman,

I've a question. Let there be a qooxdoo object. How can I check if it
implements a certain functionality, i.e. "instanceof".
I'm implementing test-extensions for Selenium. This means I'm dealing
with non-standard situations where the context probably doesn't obey
standard rules.

Thanks
.
Dmitry

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTTI (runtime type information) and qx classes

Noggin182
Hi,
You can use the javascript "instanceof" just fine. There are quite a few
other static helper functions in qx.Class that will probably help yo do
what you want. Here are just a few

* qx.Class.isSubClassOf(clazz, superClass)
* qx.Class.hasMixin(clazz, mixin)
* qx.Class.hasInterface(clazz, iface)

Check out the API for the others!

HTH,
Matt

Dmitry Pryadkin wrote:

> Gentleman,
>
> I've a question. Let there be a qooxdoo object. How can I check if it
> implements a certain functionality, i.e. "instanceof".
> I'm implementing test-extensions for Selenium. This means I'm dealing
> with non-standard situations where the context probably doesn't obey
> standard rules.
>
> Thanks
> .
> Dmitry
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTTI (runtime type information) and qx classes

thron7
Another thing is that FF3 might interfer with instanceof operations.
Some new security restrictions will produce some wrapper object around
the object you are looking at. Daniel had this exact issue when working
with Selenium.

@Daniel: Can you comment on this?!

Thomas

Matthew Gregory wrote:

> Hi,
> You can use the javascript "instanceof" just fine. There are quite a few
> other static helper functions in qx.Class that will probably help yo do
> what you want. Here are just a few
>
> * qx.Class.isSubClassOf(clazz, superClass)
> * qx.Class.hasMixin(clazz, mixin)
> * qx.Class.hasInterface(clazz, iface)
>
> Check out the API for the others!
>
> HTH,
> Matt
>
> Dmitry Pryadkin wrote:
>  
>> Gentleman,
>>
>> I've a question. Let there be a qooxdoo object. How can I check if it
>> implements a certain functionality, i.e. "instanceof".
>> I'm implementing test-extensions for Selenium. This means I'm dealing
>> with non-standard situations where the context probably doesn't obey
>> standard rules.
>>
>> Thanks
>> .
>> Dmitry
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by:
>> SourcForge Community
>> SourceForge wants to tell your story.
>> http://p.sf.net/sfu/sf-spreadtheword
>>    
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>  

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTTI (runtime type information) and qx classes

Daniel Wagner
Administrator
Yes, I ran into this problem while working with the Simulator contrib
(http://qooxdoo.org/contrib/project/simulator) in Selenium IDE under
Firefox 3. While using a locator that tries to access qooxdoo objects
through their class name, I'd get "invalid 'instanceof' operand" errors
that seemed to originate with FF's XPCSafeJSObjectWrapper object which
apparently was introduced with FF3. The same locator works fine in FF2,
however.

Regards,
Daniel

thron7 schrieb:

> Another thing is that FF3 might interfer with instanceof operations.
> Some new security restrictions will produce some wrapper object around
> the object you are looking at. Daniel had this exact issue when working
> with Selenium.
>
> @Daniel: Can you comment on this?!
>
> Thomas
>
> Matthew Gregory wrote:
>> Hi,
>> You can use the javascript "instanceof" just fine. There are quite a few
>> other static helper functions in qx.Class that will probably help yo do
>> what you want. Here are just a few
>>
>> * qx.Class.isSubClassOf(clazz, superClass)
>> * qx.Class.hasMixin(clazz, mixin)
>> * qx.Class.hasInterface(clazz, iface)
>>
>> Check out the API for the others!
>>
>> HTH,
>> Matt
>>
>> Dmitry Pryadkin wrote:
>>  
>>> Gentleman,
>>>
>>> I've a question. Let there be a qooxdoo object. How can I check if it
>>> implements a certain functionality, i.e. "instanceof".
>>> I'm implementing test-extensions for Selenium. This means I'm dealing
>>> with non-standard situations where the context probably doesn't obey
>>> standard rules.
>>>
>>> Thanks
>>> .
>>> Dmitry
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.net email is sponsored by:
>>> SourcForge Community
>>> SourceForge wants to tell your story.
>>> http://p.sf.net/sfu/sf-spreadtheword
>>>    
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by:
>> SourcForge Community
>> SourceForge wants to tell your story.
>> http://p.sf.net/sfu/sf-spreadtheword
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>>  
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel