On 27 oct, 17:30, r a f t <[EMAIL PROTECTED]> wrote: > hello, > > i'm trying to implement a custom widget. it seems more natural and > easy to extend a standard gwt widget and modify necessary parts.
It depends... it might be better to extend Composite (or eventually implement the Widget "from scratch"). > however it seems as gwt widgets aren't designed for this purpose and > most of the useful functionality is in package private methods. > > i've found that (and indeed very surprised) if i change my package > name to com.google.gwt.user.client.ui i can use such methods as if my > widget is in that package. i'm not sure how that became possible. as > far as i know, classes from different sources are treated as different > packages even if they have the same package name. That's the case in "assembly worlds" (.NET), where actually you can have "assembly-protected" classes and methods but not "namespace- protected" things; but not in Java, which AFAIK treats the classpath as a single entity, whichever JAR or directory a resource comes from. > so what do you think ? can i count on this ? You can count on the fact that placing a class in one package gives it visibility on package-protected classes and methods; that's how Java works. The GWT-Incubator project *is* using this "feature" of Java (I for one call it a bug, but it's how it's been designed, so you have to live with it). > or am i somehow hacking the system ? If things are package-protected in GWT, they should be considered "internals" and can change without notice in the next version, so yes you're somehow "hacking the system" (or GWT for what it's worth). What are you trying to do that requires package-protected access? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
