Re: do somebody know how to access private field and method in gwt widget using jsni from custom class ?

2008-08-28 Thread Rene
public static native TreeItem getTreeRoot(Tree tree) /*-{
 return  [EMAIL PROTECTED]::root;
}-*/;

cool :)

On Thu, Aug 28, 2008 at 12:29 PM, Rene [EMAIL PROTECTED] wrote:

 can I access also fields this way ?


 On Wed, Aug 27, 2008 at 9:55 PM, Rene [EMAIL PROTECTED] wrote:

 thanx I missed that double ()() . Dont care about compatibility if classes
 are final and I am accessing protected members of super type , so protected
 members are part of api and are not to change , why implemented classes are
 final , I dont know.


 On Wed, Aug 27, 2008 at 12:32 PM, Reinier Zwitserloot [EMAIL PROTECTED]
  wrote:


 Just access it. In JSNI, 'final', and 'private' do not exist.

 You'll need to read up on JSNI. Here's an example:

 public static native callGetSplitElement(HorizontalSplitPanel panel) /
 *-{
   [EMAIL PROTECTED]::getSplitElement()
 ();
 }-*/;


 Note the double ()(). The first () is part of the getSplitElement
 signature (namely, the parameter list). The second () is the actual
 parameters. In this case, getSplitElement has no parameters, so it's
 just ()().


 Also, you're still using private parts of an API. If you use these
 tricks, your code is most likely not going to work with the next
 version of GWT. Even a small point release might change things around.
 You've been warned!


 On Aug 27, 1:23 am, Rene [EMAIL PROTECTED] wrote:
  I tryed everything and allways som exception or so. There is
  getSplitElement() in HorizontalSplitPanel , how to access it , and or
  some field also.  I beleve that it will be very helpful also to
  others.
 



 --
 Rene Dohan

 http://inno-a-dev.blogspot.com/




 --
 Rene Dohan

 http://inno-a-dev.blogspot.com/




-- 
Rene Dohan

http://inno-a-dev.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: do somebody know how to access private field and method in gwt widget using jsni from custom class ?

2008-08-27 Thread Reinier Zwitserloot

Just access it. In JSNI, 'final', and 'private' do not exist.

You'll need to read up on JSNI. Here's an example:

public static native callGetSplitElement(HorizontalSplitPanel panel) /
*-{
   [EMAIL PROTECTED]::getSplitElement()
();
}-*/;


Note the double ()(). The first () is part of the getSplitElement
signature (namely, the parameter list). The second () is the actual
parameters. In this case, getSplitElement has no parameters, so it's
just ()().


Also, you're still using private parts of an API. If you use these
tricks, your code is most likely not going to work with the next
version of GWT. Even a small point release might change things around.
You've been warned!


On Aug 27, 1:23 am, Rene [EMAIL PROTECTED] wrote:
 I tryed everything and allways som exception or so. There is
 getSplitElement() in HorizontalSplitPanel , how to access it , and or
 some field also.  I beleve that it will be very helpful also to
 others.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---