Re: RESTful URL with GWT

2009-01-15 Thread Harald Pehl

On 14 Jan., 02:44, zhouxing fang fangzhoux...@gmail.com wrote:
 hi,Harald,can you give more detail of your project? Is it possible to use
 RESTful service with Ext-GWT?

We're using the following architecture / frameworks:
1. Server: Restlet  Spring
2. Client: Restlet-GWT module  GXT (http://extjs.com/products/gxt/)


A typical request / response could be something like that (assuming
that we're using XML):

Client / UserService.java:
public class UserService
{
public void getUsers()
{
new Client(Protocol.HTTP).get(http://server/users; new
Callback()
{
public void onEvent(Request request, Response response)
{
XmlRepresentation xmlRepresentation =
response.getEntityAsXml();
Document doc = xmlRepresentation.getDocument();
[parse XML]
}
});
}
}

Server / UsersResource.java (registered to handle http://server/
users):
public class UsersResource extends Resource
{
public void UsersResource(Context context, Request request,
Response response)
{
super(context, request, response);
getVariants().add(new Variant(MediaType.TEXT_XML));
}

public Representation represent(Variant variant) throws
ResourceException
{
Representation result = new DomRepresentation
(diaType.TEXT_XML);
Document doc = rep.getDocument();
[Populate doc with users...]
return result;
}

At the client side we parse the XML and turn it into ModelData
instances so we can use them in the GXT widgets.
In case of POST or PUT requests, we use forms at the client side and
the Spring validation framework on the server side to validate and
convert the form into POJOs.

I'm not that familiar with GWT-EXT, but as they are very similiar in
turn of classes / concepts, you should be able to use a similar
approach.

There's a preety good example of the Restlet-GWT module available at:
http://wiki.restlet.org/docs_1.1/13-restlet/144-restlet/188-restlet.html

Hope that helps!

Greetings
Harald
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



application (with custom shell servlet) is not working at external tomcat

2009-01-15 Thread Hasan Turksoy
Hi all,

i've implemented a custom servlet (which is extending from GWTShellServlet)
only to response my main gwt page requests, otherwise, will call super.doGet
or super.doPost. it is like this;

/**
 * Custom servlet which extends GWT's one to make it possible to use other
 * formats(like JSP, FreeMarker) as application main page.
 *
 * @author Hasan
 */
public class CustomShellServlet extends GWTShellServlet {
@Override
protected void doGet(final HttpServletRequest request, final
HttpServletResponse response) throws ServletException, IOException {
if (processIfMyCustomRequest(request, response))
return;
super.doGet(request, response);
}

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
if (processIfMyCustomRequest(request, response))
return;
super.doPost(request, response);
}
...
}

this is working at hosted mode but not working when i want to deploy my app
to an external tomcat instance. When i made my custom request (in fact,
which will generate the main gwt html file with some additional script
codes), it is entering my custom servlet, responding main application html
normally but i see an empty screen whose html source (view source) seems
normal - as below;

request: http://localhost:8080/apiks/ApiksApp.do
response:

html
  head
meta http-equiv=content-type content=text/html; charset=UTF-8
meta name=gwt:property content=locale=tr
!--   --

!-- Any title is fine --
!--   --
titleApiksApp/title

script type=text/javascript language=javascript
var parameters = {
action: ,
id: 
};
/script

!--   --
!-- This script loads your compiled module.   --
!-- If you add any GWT meta tags, they must   --
!-- be added before this line.--

!--   --
script type=text/javascript language=javascript
src=edu.hacettepe.bote.ApiksApp.nocache.js/script
  /head

  !--   --
  !-- The body can have arbitrary html, or  --
  !-- you can leave the body empty if you want  --
  !-- to create a completely dynamic UI.--
  !--   --

  body

!-- OPTIONAL: include this if you want history support --
iframe src=javascript:'' id=__gwt_historyFrame tabIndex='-1'
style=position:absolute;width:0;height:0;border:0/iframe

  /body
/html

result: empty screen!

web.xml content:

!-- custom servlet extending from GWTShellServlet --
servlet
servlet-nameshell/servlet-name

servlet-classedu.hacettepe.bote.server.servlet.CustomShellServlet/servlet-class
/servlet

servlet-mapping
servlet-nameshell/servlet-name
url-pattern/*/url-pattern
/servlet-mapping

!-- servlet class to implement RPC calls--
servlet
servlet-nameApiksService/servlet-name

servlet-classedu.hacettepe.bote.server.service.ApiksServiceImpl/servlet-class
/servlet

servlet-mapping
servlet-nameApiksService/servlet-name
url-pattern/ApiksService/url-pattern
/servlet-mapping
--

seems it's not loading gwt script file... or something i can not see...
anybody knows? what may be the problem?

Thanks in advance,

Hasan...

--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Effect of using implementations rather than interfaces in client data model

2009-01-15 Thread Ravi M

Hi all

I have a couple of somewhat basic, related and possibly duh! type
questions (which the subject of this post doesn't articulate very
well!) that I can't seem to find answers to on the forum etc. Couple
of points before the actual questions.

1. This is using GWT 1.4.6x, if that makes a difference.
2. Am not talking about RPC/serializable classes, but about data
objects that are used purely on the client side.

1. When designing the client side data model, does it make a
difference in terms of performance/optimization whether one uses
concrete implementations rather than interfaces (especially for things
in the collections framework)? More specifically, suppose I have a
data model class defined like so:

public class DataModel {
private String aString;
private List aList = new ArrayList();
private Map aMap = new HashMap();

// Methods that provide access to the data
}

Is there any advantage in terms of ease of compilation/client
performance/size of compiled Javascript if the above is declared like
so, instead:

public class DataModel {
private String aString;
private ArrayList aList = new ArrayList();
private HashMap aMap = new HashMap();

// Methods that provide access to the data
}

2. Does using the @gwt.typeArgs annotation in any way affect the
behaviour/performance of pure client side data objects? For example,
would doing like so:

public class DataModel {
private String aString;
/**
 * @gwt.typeArgs com.foo.client.model.Bar
 */
private ArrayList aList = new ArrayList();
/**
 * @gwt.typeArgs java.lang.String, com.foo.client.model.Bar
 */
private HashMap aMap = new HashMap();
// Methods that provide access to the data
}

help in any way? AFAIK, the @gwt.typeArgs annotation has to do _only_
with RPC for GWT serializable objects and remote interfaces.

Thanks and regards

Ravi
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT for SOA development

2009-01-15 Thread Paranoid Android

Thank you gregor, I think your advices could be very useful to me.
My biggest concern, anyway, is not to run on multiple clients. Even if
I can't discard this possibility by now, it has not yet been
identified as a requirements of the application.
The biggest concern is to expose a set of features that future
developers that want to add some higher level functionalities can use
with no or minimal changes to the underlying architecture.
As I said, specifically to the domain of the application, something
pretty similar to Google OpenSocial Apis, but using standars like web
services.
This is the biggest concern, than the system should be scalable and
maybe distributed, so the architecture must be
thought in a way that it will not be a problem if users scale from 100
to 10.
This is the general picture. So, thinking about it, maybe an ESB is
not really what I need, anyway I must expose feature both locally and
remotely and thus I'm going to look for other technologies to achieve
that, maybe EJB's as you suggested..
Only a thing make me doubtful: the project manager suggest that a
message/event driven architecture may be a better solution over a
classical MVC architecture, but I can't find another solution for a
good message driven solution other than an ESB..


On Jan 14, 7:06 pm, gregor greg.power...@googlemail.com wrote:
 Paranoid,

 1) ESB's are good at, and designed for, orchestrating business
 transactions across multiple third party systems that otherwise could
 not talk to each other easily, whilst providing clients with a single
 view of and interface with that process. Other than that, they offer
 nothing really. By now you probably get the impression that I think
 you need an ESB like you need a hole in the head!

 2) You should adhere to YAGNI. For each iteration of a project you
 should define precise objectives for each use case you intend to
 implement *for that iteration*, and equally important you should
 define non-objectives (constraints), things you are definitely not
 going to do this time, if ever. Then you do not write a line of code
 nor use any library that does not directly contribute something
 tangible to these stated objectives, and secondly you meet these
 objectives in the simplest and quickest way you possibly can. That's
 so you get feedback from real users as early as possible which will
 almost certainly give you some surprises.

 For example, it seems to me that one of your biggest concerns is
 running on multiple clients, e.g. mobile devices, as well as standard
 browsers. OK, so you might define an primary objective that the system
 must be fully functional for a given set of use cases in both a
 standard browser and on, say, an iPhone, something running Android, or
 whatever. By doing that you will a) focus your development effort on
 practical application of the technologies you need to use to meet this
 specific objective, and b) your server side architecture will
 automatically evolve to support these two different client interfaces
 as the practical issues become clear to you. Subsequently adding a
 third or fourth will then be straight forward, but you don't have to
 worry about that now.

 If you don't focus like this, you are in danger of never really
 getting started, never mind finishing.

 regards
 gregor

 On Jan 14, 4:30 pm, Paranoid Android paranoid.fa...@gmail.com wrote:

  Thank you gregor, your post is very interesting and I basically agree
  with your point of view.
  Cause I'm a newby in SOA solutions, I'm reading and reading things and
  asking to more expert people like you.
  In fact I think I need little of integration of different systems (no
  legacy systems to integrate etc).
  But the key in my project is that I must provide interfaces for the
  future development of functionalities, in a similar way as OpenSocial
  by Google does, but using other standards.
  So my project is not completely SOA, in the sense that not
  everything in my system must be distributed, orchestred, exposed etc,
  but a portion of it does.
  I though that ESB's like, for example, Apache ServiceMix can be useful
  because they provide a way to implements services as POJO's and take
  care to expose remote interfaces (bindings) for different types of
  consumer that will be developed in the future and because they provide
  a way to route messages through services etc..
  But I'm wondering if they provide a way to interact with services that
  are local through a local interface (i.e. the model inside my app will
  interact with such services through a local interface exposed by the
  ESD, while other remote consumers that will eventually be developed in
  the future can access these services through, for example, REST or
  SOAP without the need to wrap these functionalities).
  For these reasons I'm thinking about a SOA solution, even if not
  everything will be a service etc...
  The general, high level architecture I'm thinking about is something
  like this:

 

how to listen to ESC key for popup

2009-01-15 Thread aragorn

My application displays a popup whenevr a particular button is
clicked. Now i can hide the popup whenever the user clicks the mouse
outside of it using the default popup-panel property provided by GWT.
Apart from that I also need to listen to keyboard so that if the user
hits ESC on the keyboard my popup should disappear from the screen.
Any idea how to implement in gwt?

--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



set fixed size for popup and enable scrolling within it

2009-01-15 Thread aragorn

I have a popuppanel which wraps a flowpanel within itself. Now i want
this popup to occupy only some portion of the screen. In case the
flowpanel exceeds the mentioned limits, the popup should display a
scrollbar. I tried setting this using CSS by usinf overflow:auto but
it doesnt work. If u know any way t do it plz let me know
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT and Business Intelligence.

2009-01-15 Thread Kevin Tarn
GWT is just a framework that can let a Java developer utilize OOP to develop
a web service easily. Under this benefit, it also easily integrate existing
server part technology or any other services already opened in internet.

Before GWT, there are a lot of 3rd party libraries implemented by AJAX. The
web designer who familiar with javascript may not be required to familiar
with OO design. So your question is concerned by what type and capability of
your human resource in your organization.

As we can foresee, more and more web services or javascript libraries will
have a wrapper in GWT. There are also bunch of growing libraries that are
implemented in purely GWT and opened source. It will minimize the effort to
create a new service. GWT's branch, OOPHM, that has already integrated
existing web browsers as host browser in development environment. The
developer can easily debug and develop consistent solution in variant
commercial browser.

Kevin

On Wed, Jan 14, 2009 at 7:53 PM, Miroslav Genov mgenov.j...@gmail.comwrote:


 Hello,
  First I wanna thank on all of you for the answers. As it seems there
 is an already solution that is doing this, but I was wondering if using
 of GWT is appropriate for that kind of applications ?

  My idea was to see whether there are people in the mailing list that
 are having experience with such or similar applications.

  With most of the web frameworks the developers can reach the final
 goal but on what costs ? - time for learning, time for development and
 etc.


 Regards,
   Miroslav



 On Wed, 2009-01-14 at 01:59 -0800, Thomas Broyer wrote:
 
 
  On 13 jan, 13:10, Kevin Tarn kevn.t...@gmail.com wrote:
   Vanilla seems to be blocked for download.
 
  Actually seems like a broken link (and outdated site: Vanilla is now
  at version 1.3).
  Downloads can be found here: http://www.bpm-conseil.org/
 
  (I wouldn't look at the source code if I were you; it's just a proof
  that it can be done, not at all a reference implementation that you
  would use as an inspiration)
  


 


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: how to listen to ESC key for popup

2009-01-15 Thread Hasan Turksoy
you can override the PopupPanel#onKeydownPreview method like below;

@Override
public boolean onKeyDownPreview(char key, int modifiers) {
// Use the popup's key preview hooks to close the dialog when either
// enter or escape is pressed.
switch (key) {
case KeyboardListener.KEY_ENTER:
case KeyboardListener.KEY_ESCAPE:
hide();
break;
}

return true;
}


Hasan...
http://www.jroller.com/hasant


On Thu, Jan 15, 2009 at 11:17 AM, aragorn sagar5...@gmail.com wrote:


 My application displays a popup whenevr a particular button is
 clicked. Now i can hide the popup whenever the user clicks the mouse
 outside of it using the default popup-panel property provided by GWT.
 Apart from that I also need to listen to keyboard so that if the user
 hits ESC on the keyboard my popup should disappear from the screen.
 Any idea how to implement in gwt?

 


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



how to get the xml value from outside javascript file into entry point class

2009-01-15 Thread ramesh chiluveri

Hai All,

This is regarding passing xml data from outside javascript file into
GWT entry point class.

My requirement like this, i need to get the some xml data from other
javascript file into GWT entry point class.

I written native function ,it will generate javascript function ,so
that i can access this function from outside the gwt application.

here my code:

public class Home implements EntryPoint {
public static String xmldata = ;
private Button clickMeButton;
public void onModuleLoad() {
popupwin();


}
 public static void GetHelpPopupPanel(String s) {
xmldata = s;
   //here some code
}
public static native void popupwin() /*-{

   $wnd.winpopup = function(s){
   @com.mantra.mydraw2d.client.Home::GetHelpPopupPanel(Ljava/lang/
String;)(s);
   }
}-*/;

}
now i can access winpopup from outside GWT application.

it is working fine when i pass simple string value.but when i pass xml
data with attributes as a string ,it is not passing correct data.it is
missing node names and some other attributes.

please help me to complete my requirement.

Thank you


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: problem in parsing XML

2009-01-15 Thread Jason Morris

It's not really a GWT related question, but heres what you're looking for:

final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
final DocumentBuilder builder = dbf.newDocumentBuilder();
final Document doc = builder.parse(new 
ByteArrayInputStream(xml.getBytes(UTF-8)));

The String parameter accepted from InputSource is a systemId (generally a URI 
of sorts pointing to 
the XML file).

Hope this helps.

javaz wrote:
 hi everyone ,
 i got an error while running the below code in the server side  .Could
 anyone please help me in sorting out the solution to this error?
 
 here is the code:
 
 
   public boolean saveEmployeeInfo(String xml)  {
   try{
 
 InputSource s = new InputSource(new 
 String(xml));//xml is the xml
 document
 DocumentBuilderFactory dbf = 
 DocumentBuilderFactory.newInstance
 ();
 DocumentBuilder db = dbf.newDocumentBuilder();
 Document doc = (Document)db.parse(s);
 doc.getDocumentElement().normalize();
 System.out.println(Root element  + 
 doc.getDocumentElement
 ().getNodeName());
 
 
   }catch(Exception e){
   e.printStackTrace();
   }
 
 
 
 
 here is the error:
 java.net.MalformedURLException:
 
  no protocol: EmployeeRegistrationBranchf/BranchNamefffgf/
 NameDepartmentgfg/DepartmentDesignatonfdg/
 DesignatonJoinedDatefdg/JoinedDateDateofBirthvgfsdg/
 DateofBirth/EmployeeRegistration
 
   at java.net.URL.init(Unknown Source)
   at java.net.URL.init(Unknown Source)
   at java.net.URL.init(Unknown Source)
   at
 com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity
 (Unknown Source)
   at
 com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion
 (Unknown Source)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
 (Unknown Source)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
 (Unknown Source)
   at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
 Source)
   at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown
 Source)
   at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse
 (Unknown Source)
   at np.com.rts.hris.server.HRISServiceImpl.saveEmployeeInfo
 (HRISServiceImpl.java:24)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
 (RPC.java:527)
   at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
 (RemoteServiceServlet.java:164)
   at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
 (RemoteServiceServlet.java:86)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at com.google.gwt.dev.shell.GWTShellServlet.service
 (GWTShellServlet.java:289)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
 (ApplicationFilterChain.java:237)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter
 (ApplicationFilterChain.java:157)
   at org.apache.catalina.core.StandardWrapperValve.invoke
 (StandardWrapperValve.java:214)
   at org.apache.catalina.core.StandardValveContext.invokeNext
 (StandardValveContext.java:104)
   at org.apache.catalina.core.StandardPipeline.invoke
 (StandardPipeline.java:520)
   at org.apache.catalina.core.StandardContextValve.invokeInternal
 (StandardContextValve.java:198)
   at org.apache.catalina.core.StandardContextValve.invoke
 (StandardContextValve.java:152)
   at org.apache.catalina.core.StandardValveContext.invokeNext
 (StandardValveContext.java:104)
   at org.apache.catalina.core.StandardPipeline.invoke
 (StandardPipeline.java:520)
   at org.apache.catalina.core.StandardHostValve.invoke
 (StandardHostValve.java:137)
   at org.apache.catalina.core.StandardValveContext.invokeNext
 (StandardValveContext.java:104)
   at org.apache.catalina.valves.ErrorReportValve.invoke
 (ErrorReportValve.java:118)
   at org.apache.catalina.core.StandardValveContext.invokeNext
 (StandardValveContext.java:102)
   at org.apache.catalina.core.StandardPipeline.invoke
 (StandardPipeline.java:520)
   at org.apache.catalina.core.StandardEngineValve.invoke
 (StandardEngineValve.java:109)
   at org.apache.catalina.core.StandardValveContext.invokeNext
 (StandardValveContext.java:104)
   at org.apache.catalina.core.StandardPipeline.invoke
 (StandardPipeline.java:520)
   at 

Re: Changing the css file at runtime

2009-01-15 Thread Lorenzo Nazario
In order to change the css at runtime (or better not change but append)
try this native method:

public static native void loadCss(String url) /*-{
var fileref=document.createElement(link);
fileref.setAttribute(rel,stylesheet);
fileref.setAttribute(type,text/css);
fileref.setAttribute(href,url);
$doc.getElementsByTagName(head)[0].appendChild(fileref);
}-*/;








2009/1/14 Adam T adam.t...@gmail.com

 I would say you need to use JSNI - do a search for how to change CSS
 file using JavaScript and then implement something similar wrapped in
 a JSNI method.

 You can then call that method to change the style sheet, either
 programmatically by just calling it, or if you want to harness the
 bootstrapping use Deferred Binding on user type to select a subclass
 that calls your method with the appropriate style name, i.e.

 public class Basic{

 private native void changeStyleSheet(String styleSheetName)/*-{
   // some javascript code to activate and use styleSheetName as the
 style sheet
 }-*/

 public setStyle(){
   changeStyleSheet(first.css);
 }
 }


 public class Admin extends Basic{
  changeStyleSheet(second.css);
 }

 then in your module XML have something like

 replace-with class Admin
   when-type-is classBasic/
   when-property-is nameuser.type valueadmin/
 /replace-with

 define-property name=user.type values=basic,admin/

 You'd have to think of a secure way to ensure people can't just
 pretend to be admin.  An unsecure-ish way would be to use a property
 provider to read the value from your HTML meta properties in the same
 way GWT does for i18n selection.  As BunsenBeaker (http://
 code.google.com/p/bunsenandbeaker/wiki/DevGuideSpecifyingLocale) says:

 A property provider is specified in the module XML file as a
 JavaScript fragment that will return the value for the named property
 at runtime. In this case, you would want to define the locale property
 using a property provider. To see examples of property-provider
 definitions in action, see the files I18N.gwt.xml and
 UserAgent.gwt.xml in the GWT source code. 

 //Adam



 and a new property provider

 //Adam

 On 14 Jan, 06:21, Kamlesh kkn...@gmail.com wrote:
  Hi,
 
  I have different css files in my application say user1.css, user2.css
  and so on corresponding to each user. My requirement is that when a
  particular user logs in the system (consider the LMS application) I
  have to apply the css corresponding to that user.
 
  How can I achieve this requirement using GWT?
  Is there an API using which I can change css in onModuleLoad()
  function itself?
  Can I handle module xml file configuration using GWT APIs?
 
  I have also tried GWT linker to achieve something similar to that, but
  I am not sure whether that will solve my problem. Please see the
  following post.
 
  http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...
 
  Regards,
  Kamlesh
 

--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Images does not disply on IE browser in vista plateform

2009-01-15 Thread ship

hi
In my web application i display images on web page setting url of
Image object of gwt with the image url. But when i run this
application on vista plateform IE browser does not display image. When
i see the IMG tag it shows src  pending src with the correct url.
This application works good on IE browser in Window plateform but not
on vista plateform.
Pl solve this problem.
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Gwt application deployment

2009-01-15 Thread j redick
thanks for caring

i have solved the problem. i have just learned that i need to set service
entry point :D
i have added sometihng like below to my service class.

ServiceDefTarget endpoint = (ServiceDefTarget) messengerService;
endpoint.setServiceEntryPoint( GWT.getModuleBaseURL() + messenger );

On Wed, Jan 14, 2009 at 6:59 AM, Litty Preeth preeth.h...@gmail.com wrote:

 If you hav to make jdbc entries in web.xml depends on your implementation.
 What is the error you are getting?

 - Litty Preeth


 On Wed, Jan 14, 2009 at 5:30 AM, jredick jared...@gmail.com wrote:


 Hi,
 first of all i am sorry if this is a stupid question :)
 I am pretty new on using gwt. I write a simple application that sends
 and take data from mysql database.
 But when it comes to deploy my application, i can't manage to do it.
 Actually i deployed it, but there is a problem on RPC or database. I
 cannot figure out myself.
 my question is ; do I need to add some kind of mapping to my web.xml
 file for database connection ( jdbc) or something like below is
 enough ?

 ?xml version=1.0 encoding=ISO-8859-1?

 web-app
   servlet
  servlet-nameMyApplication/servlet-name
  servlet-classcom.project.server.dataServiceImpl/servlet-
 class
   /servlet
   servlet-mapping
  servlet-nameMyApplication/servlet-name
  url-pattern/myapplication/url-pattern
   /servlet-mapping
 /web-app


 thanks in advance




 


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Date+Time widget

2009-01-15 Thread Serge

Thank you very much!
It works!
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT applications memory management

2009-01-15 Thread Bob Stachel

Try this article as a starting point in understanding IE memory leaks.
Internet Explorer is far worse than other browsers in memory
managment.

http://msdn.microsoft.com/en-us/library/bb250448.aspx

If your application uses pure GWT you will be somewhat protected
from leaks, but perhaps you have some native methods that employ
function closures (by far the easiest way to incur major leaks).

On Jan 14, 9:00 am, Lex alexey.tsiunc...@gmail.com wrote:
 Hello all.

 I'd like to ask the question about the approaches normally used to
 manage memory in GWT applications. Till the moment I wrote this post,
 I read most of discussions on the group related to this topik, but
 unfortunately have no answer on my question.

 What I'm actually looking for: is some guide or list of rules What is
 necessary to be done in GWT code, to prevent GWT application to
 consume more and more memory. This problem occurs in Internet
 Explorer.

 Currently we are developing rather big application using GWT. During
 developement process we had noticed that Internet Explorer consumes
 memory more and more and never release it. We had also noticed that
 after we press refresh button in IE, it finally releases most of
 consumed memory (but not all). We try to check out pages with IE leak
 detectors, sIEve, and Microsoft JS Memory Leak Detector. Those tools
 are not detect any memory leaks in our application.

 After this we create very simple test. We create SimplePanelwidget,
 and put some FlexTable on it. After this we put in this flex table
 different widgets (Buttons, checkboxes, etc.). After we add
 SimplePanel to the rootPanel, and remove it from root panel. Do this
 several times (using timer). After each cycle (add, remove SimplePanel
 from RootPanel) some amount of memory ~200 KB is not released.

 So my questions are following:
 -  Does the situation when IE is not released all memory it consumes
 is know issue or not?
 -  Does anybody know what may be done to reduce or remove at all
 memory leaking?
 -  Does anybody have URL to some guides of memory management in GWT
 applications?

 Any help will be highly appreciated
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: History and Tab panels

2009-01-15 Thread jake H


I tried something , that managed to do some more than the previous
codes.
But i still have the refresh problem , when refresh button is pressed
even if the url points in a specific page,  the main tab is reloaded.
And when i save a bookmark with subpanel and trying to visit it , i
cant. while in top panel its working.

I provide the code
tpanel is the top level tab panel , while the sub , is the sub tab
panel of a specific top level tab panel.


 tpanel.addTabListener(new TabListener() {
  public void onTabSelected(SourcesTabEvents sender, int 
tabIndex) {
// Push an item onto the history stack
History.newItem(page + tabIndex);
}
public boolean onBeforeTabSelected(SourcesTabEvents sender, int
tabIndex){

return true;
}

});

  subpanel.addTabListener(new TabListener() {
  public void onTabSelected(SourcesTabEvents sender, int 
tabIndex) {
// Push an item onto the history stack
History.newItem(subpage + tabIndex);
}
public boolean onBeforeTabSelected(SourcesTabEvents sender, int
tabIndex){

return true;
}

});

History.addHistoryListener(new HistoryListener() {
   public void onHistoryChanged(String historyToken) {
 if(historyToken != null) {
 String check = historyToken.substring(0,4);
 GWT.log(Check value +check,null);
 String htok;
 int check2=-1;
 if( check.equals(page) )
 {
 htok = historyToken.substring(4,historyToken.length());
 check2 = 0;
 }
 else
 {
 htok = historyToken.substring(7,historyToken.length());
 check2 = 1;
 GWT.log(htok value +htok,null);
 }

 int index = Integer.parseInt(htok);
 if( check2 == 0 ) {
 if( index = tpanel.getTabBar().getTabCount()) index = 0;

  tpanel.selectTab(index);
  }
  else if( check2 == 1 ) {
 if( index = 
subpanel.getTabBar().getTabCount()) index
= 0;

   subpanel.selectTab(index);
  }
 }
   }
});



Any idea?
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT applications memory management

2009-01-15 Thread Lex

Hello Bob,
Thanks for answer, I'll check the article on Microsoft.

Considering the natives, we have prepared test application, where we
exclude all natives, DOM class method calls, and even eventListeners.
Sometimes browser frees some memory, but not all (after memory
release, total browser's memory allocation is greater then before
allocation).

So the problem seems still exists.

On Jan 15, 3:04 pm, Bob Stachel rstac...@gmail.com wrote:
 Try this article as a starting point in understanding IE memory leaks.
 Internet Explorer is far worse than other browsers in memory
 managment.

 http://msdn.microsoft.com/en-us/library/bb250448.aspx

 If your application uses pure GWT you will be somewhat protected
 from leaks, but perhaps you have some native methods that employ
 function closures (by far the easiest way to incur major leaks).

 On Jan 14, 9:00 am, Lex alexey.tsiunc...@gmail.com wrote:

  Hello all.

  I'd like to ask the question about the approaches normally used to
  manage memory in GWT applications. Till the moment I wrote this post,
  I read most of discussions on the group related to this topik, but
  unfortunately have no answer on my question.

  What I'm actually looking for: is some guide or list of rules What is
  necessary to be done in GWT code, to prevent GWT application to
  consume more and more memory. This problem occurs in Internet
  Explorer.

  Currently we are developing rather big application using GWT. During
  developement process we had noticed that Internet Explorer consumes
  memory more and more and never release it. We had also noticed that
  after we press refresh button in IE, it finally releases most of
  consumed memory (but not all). We try to check out pages with IE leak
  detectors, sIEve, and Microsoft JS Memory Leak Detector. Those tools
  are not detect any memory leaks in our application.

  After this we create very simple test. We create SimplePanelwidget,
  and put some FlexTable on it. After this we put in this flex table
  different widgets (Buttons, checkboxes, etc.). After we add
  SimplePanel to the rootPanel, and remove it from root panel. Do this
  several times (using timer). After each cycle (add, remove SimplePanel
  from RootPanel) some amount of memory ~200 KB is not released.

  So my questions are following:
  -  Does the situation when IE is not released all memory it consumes
  is know issue or not?
  -  Does anybody know what may be done to reduce or remove at all
  memory leaking?
  -  Does anybody have URL to some guides of memory management in GWT
  applications?

  Any help will be highly appreciated
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT for SOA development

2009-01-15 Thread Paranoid Android

Other considerations:

I read a lot of stuff about SOA, MVC, message-based MVC, SOUI ecc...
Some people asserting that MVC is dead, other asserting that SOA or
SOUI is the evolution of MVC, other asserting that MVC and SOA are
complementary some say black and some say white..headache

Ok, I agree with the fact that thanks to Ajax, DHTML, RIA in general,
the need of managing multiple views via controllers etc.. is not
central as it was some time ago. You can avoid page flows etc...
I've also understood that SOA doesn't mean Web Services and WS
doesn't mean SOA,even if, pratically, they are the solution that
people use in SOA applications..
Now I've a question:

If, for example, I've an application with a rich client interface
(e.g. builded using gwt) that interacts with, let's say, with a
Session Facade..(ejb, spring, or whatever).
My Model is composed of services and a typical persistence layer...
now hypothesize that everything is well done, i.e. services reflects a
business decomposition etc..etc...
Isn't this a good solution? Is this SOA? Is this MVC?

My idea is that, FROM A PRACTICAL (implementation) point of view, SOA
can be (also) simply a way to think about the Model, in a reusable and
loose-coupled way and can be a very good solution even without going
to complex message-based MVC.




On Jan 15, 9:53 am, Paranoid Android paranoid.fa...@gmail.com wrote:
 Thank you gregor, I think your advices could be very useful to me.
 My biggest concern, anyway, is not to run on multiple clients. Even if
 I can't discard this possibility by now, it has not yet been
 identified as a requirements of the application.
 The biggest concern is to expose a set of features that future
 developers that want to add some higher level functionalities can use
 with no or minimal changes to the underlying architecture.
 As I said, specifically to the domain of the application, something
 pretty similar to Google OpenSocial Apis, but using standars like web
 services.
 This is the biggest concern, than the system should be scalable and
 maybe distributed, so the architecture must be
 thought in a way that it will not be a problem if users scale from 100
 to 10.
 This is the general picture. So, thinking about it, maybe an ESB is
 not really what I need, anyway I must expose feature both locally and
 remotely and thus I'm going to look for other technologies to achieve
 that, maybe EJB's as you suggested..
 Only a thing make me doubtful: the project manager suggest that a
 message/event driven architecture may be a better solution over a
 classical MVC architecture, but I can't find another solution for a
 good message driven solution other than an ESB..

 On Jan 14, 7:06 pm, gregor greg.power...@googlemail.com wrote:

  Paranoid,

  1) ESB's are good at, and designed for, orchestrating business
  transactions across multiple third party systems that otherwise could
  not talk to each other easily, whilst providing clients with a single
  view of and interface with that process. Other than that, they offer
  nothing really. By now you probably get the impression that I think
  you need an ESB like you need a hole in the head!

  2) You should adhere to YAGNI. For each iteration of a project you
  should define precise objectives for each use case you intend to
  implement *for that iteration*, and equally important you should
  define non-objectives (constraints), things you are definitely not
  going to do this time, if ever. Then you do not write a line of code
  nor use any library that does not directly contribute something
  tangible to these stated objectives, and secondly you meet these
  objectives in the simplest and quickest way you possibly can. That's
  so you get feedback from real users as early as possible which will
  almost certainly give you some surprises.

  For example, it seems to me that one of your biggest concerns is
  running on multiple clients, e.g. mobile devices, as well as standard
  browsers. OK, so you might define an primary objective that the system
  must be fully functional for a given set of use cases in both a
  standard browser and on, say, an iPhone, something running Android, or
  whatever. By doing that you will a) focus your development effort on
  practical application of the technologies you need to use to meet this
  specific objective, and b) your server side architecture will
  automatically evolve to support these two different client interfaces
  as the practical issues become clear to you. Subsequently adding a
  third or fourth will then be straight forward, but you don't have to
  worry about that now.

  If you don't focus like this, you are in danger of never really
  getting started, never mind finishing.

  regards
  gregor

  On Jan 14, 4:30 pm, Paranoid Android paranoid.fa...@gmail.com wrote:

   Thank you gregor, your post is very interesting and I basically agree
   with your point of view.
   Cause I'm a newby in SOA solutions, I'm reading and reading 

How to get Hidden field value in server-side?

2009-01-15 Thread Alex Luya

I have following code to upload an image to server and I need servlet
to rename image to what the value of a hidden field sended to server
through a post method, the question is how to get the value of this
hidden field:imageStoreName.is it to use request.getParameter
(imageStoreName)?I tried it,but I got  null.
private final void setUploader()
{
HorizontalPanel hpUploaderLayout = new HorizontalPanel();
// hidden will tell server how to rename the image
imageStoreName = new Hidden();
imageStoreName.setID(imageName);
imageStoreName.setValue(Util.getId());

final FileUpload uploader = new FileUpload();


hpUploaderLayout.add(imageStoreName);
hpUploaderLayout.add(uploader);
uploadForm.setWidget(hpUploaderLayout);
}
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: create and save xml into the server with RequestBuilder

2009-01-15 Thread jchimene

Hi Max,

Yes, you do need something on the server to receive the file. From the
looks of what you've written so far, you're not using Java RPC. So,
you need some sort of CGI handler routine on myServer

Cheers,
jec

On Jan 14, 4:36 pm, Max caesy...@gmail.com wrote:
 My goal is to save an xml string to a file in server (either appending
 an existing file or create a file).

 String url=http://myServer/myFolder/file.xml;; // place where i want
 to create xml into my server

 String postData=some xml string;
 RequestBuilder builder=new RequestBuilder(RequestBuilder.POST,url);
 try {
          Request response = builder
                .sendRequest(postData, new RequestCallback() {

                         public void onError(Request request,
                                             Throwable exception) {}

                         public void onResponseReceived(Request
 request,
                                                        Response
 response) {}
                 });
        } catch (RequestException e) {}

 When i run it, it doesn't show any error. I thought file.xml would be
 created at http://myServer/myFolder/file.xml;; but nothing is there
 when i check it.Do i need server code to handle it? I don't know much
 about java servelets. It would be nice if i can do with gwt methods.
 Any suggestions?
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Problem in developing opensocial application in GWT

2009-01-15 Thread Alex Epshteyn

Hi Yasser,

I'm actually not using GWT in directly my OS gadget - I have an iframe
inside the gadget that loads my GWT app.

However, I'm sure you can use GWT RPC quite easily in the gadget - as
long as your compiled JS has the same URL as your RPC server.

Best,
Alex

(I'm CC-ing this message to the group so that others can also
contribute to this discussion)

On Wed, Jan 14, 2009 at 11:40 PM, Yasser Sultan sultan.yas...@gmail.com wrote:
 Hi Alexander,
 I got your email id from GWT group. You had mentioned that the opensocial
 application Typeracer has been developed in GWT. This app is really fabulous
 and fun to race against friends! As I am also a social applications
 developer and nowadays I am developing a new application in GWT I have few
 questions for you. I will be grateful if you could spare some time to answer
 these queries.

 I am having problem in deploying GWT application in an opensocial container.
 The main obstacle is making RPC from client side to server side. So I want
 to ask whether you are using RPC to communicate with server or some other
 form like JSON ?

 With best regards
 Yasser Sultan


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT for SOA development

2009-01-15 Thread gregor



 If, for example, I've an application with a rich client interface
 (e.g. builded using gwt) that interacts with, let's say, with a
 Session Facade..(ejb, spring, or whatever).
 My Model is composed of services and a typical persistence layer...
 now hypothesize that everything is well done, i.e. services reflects a
 business decomposition etc..etc...
 Isn't this a good solution? Is this SOA? Is this MVC?


I think what you are describing here is an industrial strength Java EE
+ GWT architecture for a system that is fully capable of
*participating* in an SOA since all the business services (EJB/Spring
based, whatever) can be exposed in multiple ways to third party
systems as required, including an ESB supporting an SOA environment.
An application server like JBoss, for instance, has a plethora of
tools to help you do this (including it's own ESB as it happens), and
I think Spring is the same.

MVC is another matter, and IMO it is another buzz term that means all
sorts of things to different people. MVC was originally invented
during the Apple Lisa project (the first real WIMP framework) in the
early 1980's I believe, and I think it was implemented in Smalltalk,
one of the first proper OO languages, which was specifically
designed to support MVC. Struts is most definitely MVC:
JSP==View;Action==Controller;Bean==Model etc. But it has to be that
way to run the cycles of pages in the application.

However in GUI programming environments the role of Controller becomes
moot, or confused. Swing, for example, is often accused of not being
true MVC because there is no real enforcement or even encouragement
to cleanly separate a View (i.e. a widget) from a Controller, whatever
that actually means in the context of a client GUI.

For a GWT example, suppose you have a Tree, you select an item from it
and you want to display some details about that item in second panel.
You might have the widget containing the tree implement
SourcesChangeEvents, and the display panel implement ChangeListener,
so the display panel is notified when user selects a Tree item.
DisplayPanel has its onChange(Widget sender) method called, retrieves
the item identifier from the sender (the Tree) and calls an
asynchronous RPC service to get the details. RPC servlet calls, say, a
Session EJB to fetch the Model object concerned, then returns it to
DisplayPanel callback onSuccess(object result) method, from whence
DisplayPanel can populate its fields.

As you can see the Controller element is split up all over the place
because what you have here is a distributed n-tier architecture with
an AJAX UI, and, unlike Struts, it doesn't fit neatly into pure MVC.
The same sort of thing happens with Swing/SWT. In the Apple Lisa days,
I think it was assumed an application would either run pretty much all
on a server to a dumb client or alternatively pretty much all on the
client just accessing maybe a database sever, so the original MVC
didn't really cater for all this.

This is not to say that you cannot implement pure MVC in a GWT client
(I think there are projects around that directly support this) but it
can take extra effort that may not really be worth it. One case where
true MVC does earn its dinner is where you have a complex model
(something like a work flow process for example) which supports
multiple views, all of which might update it and all of which need
notifying of changes to it. In this case the Views should interact
with the model via a Controller only or you will end up with
unmaintainable spaghetti.

I have no idea what MVC has got to do with messaging. Perhaps ESB
vendors would like people to think of their message buses as
Controllers, and in the multi-system business process scenario
discussed above they undoubtedly are, but MVC usually refers to how a
UI interacts with the Domain Model.

regards
gregor




 My idea is that, FROM A PRACTICAL (implementation) point of view, SOA
 can be (also) simply a way to think about the Model, in a reusable and
 loose-coupled way and can be a very good solution even without going
 to complex message-based MVC.

 On Jan 15, 9:53 am, Paranoid Android paranoid.fa...@gmail.com wrote:

  Thank you gregor, I think your advices could be very useful to me.
  My biggest concern, anyway, is not to run on multiple clients. Even if
  I can't discard this possibility by now, it has not yet been
  identified as a requirements of the application.
  The biggest concern is to expose a set of features that future
  developers that want to add some higher level functionalities can use
  with no or minimal changes to the underlying architecture.
  As I said, specifically to the domain of the application, something
  pretty similar to Google OpenSocial Apis, but using standars like web
  services.
  This is the biggest concern, than the system should be scalable and
  maybe distributed, so the architecture must be
  thought in a way that it will not be a problem if users scale from 100
  to 10.
  This is the 

Re: Problem in developing opensocial application in GWT

2009-01-15 Thread Eric Ayers
This should circumvent the RPC issue, but running in this way means that
your application must always be served from your server, not the opensocial
container which might provide some nice caching.  Fine for small gadgets,
but if you are planning on writing the next buddy poke...

On Thu, Jan 15, 2009 at 11:13 AM, Alex Epshteyn 
alexander.epsht...@gmail.com wrote:


 Hi Yasser,

 I'm actually not using GWT in directly my OS gadget - I have an iframe
 inside the gadget that loads my GWT app.

 However, I'm sure you can use GWT RPC quite easily in the gadget - as
 long as your compiled JS has the same URL as your RPC server.

 Best,
 Alex

 (I'm CC-ing this message to the group so that others can also
 contribute to this discussion)

 On Wed, Jan 14, 2009 at 11:40 PM, Yasser Sultan sultan.yas...@gmail.com
 wrote:
  Hi Alexander,
  I got your email id from GWT group. You had mentioned that the opensocial
  application Typeracer has been developed in GWT. This app is really
 fabulous
  and fun to race against friends! As I am also a social applications
  developer and nowadays I am developing a new application in GWT I have
 few
  questions for you. I will be grateful if you could spare some time to
 answer
  these queries.
 
  I am having problem in deploying GWT application in an opensocial
 container.
  The main obstacle is making RPC from client side to server side. So I
 want
  to ask whether you are using RPC to communicate with server or some other
  form like JSON ?
 
  With best regards
  Yasser Sultan
 

 



-- 
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/

--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Problem Runnig GWTTestCase on Linux

2009-01-15 Thread gwt_newbie

I am trying to run GWTTestCase on Linux but it is failing with
following error.

Can't load library: /home/acwguibuild/web_ui_patriots_nightly_build/
gui/web_gui/lib/libswt-pi-gtk-3235.so


I have gone through the forum to find solution but nothing helped so
far. We have linux 32-bit and JVM 32-bit so no 64-bit issue here. I
made sure I have required gwt libs for linux in the classpath.

I really need some help to figure this out. Your reply will be highly
appreciated.

Thanks!!!


The detailed error output is here:

- message priority=info
- ![CDATA[ Caused an ERROR
  ]]
  /message
- message priority=info
- ![CDATA[ Can't load library: /home/acwguibuild/
web_ui_patriots_nightly_build/gui/web_gui/lib/libswt-pi-gtk-3235.so
  ]]
  /message
- message priority=info
- ![CDATA[ java.lang.UnsatisfiedLinkError: Can't load library: /home/
acwguibuild/web_ui_patriots_nightly_build/gui/web_gui/lib/libswt-pi-
gtk-3235.so
  ]]
  /message
+ message priority=info
- ![CDATA[ at java.lang.ClassLoader.loadLibrary(ClassLoader.java:
1650)
  ]]
  /message
- message priority=info
- ![CDATA[ at java.lang.Runtime.load0(Runtime.java:769)
  ]]
  /message
+ message priority=info
- ![CDATA[ at java.lang.System.load(System.java:968)
  ]]
  /message
- message priority=info
- ![CDATA[ at org.eclipse.swt.internal.Library.loadLibrary
(Library.java:132)
  ]]
  /message
- message priority=info
- ![CDATA[ at org.eclipse.swt.internal.gtk.OS.clinit(OS.java:22)
  ]]
  /message
- message priority=info
- ![CDATA[ at org.eclipse.swt.internal.Converter.wcsToMbcs
(Converter.java:63)
  ]]
  /message
- message priority=info
- ![CDATA[ at org.eclipse.swt.internal.Converter.wcsToMbcs
(Converter.java:54)
  ]]
  /message
- message priority=info
- ![CDATA[ at org.eclipse.swt.widgets.Display.clinit(Display.java:
126)
  ]]
  /message
- message priority=info
- ![CDATA[ at com.google.gwt.dev.GWTShell.clinit(GWTShell.java:301)
  ]]
  /message
- message priority=info
- ![CDATA[ at com.google.gwt.junit.client.GWTTestCase.runTest
(GWTTestCase.java:219)
  ]]
  /message
- message priority=info
- ![CDATA[ at com.google.gwt.junit.client.GWTTestCase.run
(GWTTestCase.java:132)
  ]]
  /message
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



How to make GWT put output files in a different location?

2009-01-15 Thread Rmon

Hi,

I'm using GWT4nb (handy plugin) to write my GWT project. The back end
that I'm writing against is PHP. Thus I've installed Apache and PHP on
my dev machine and its all working fine. What I want to be able to do
is to get the GWT compiler to place its output in the www folder of my
Apache web server. Right now I have to do this manually.

I am new to Java and keep reading about ANT. Netbean project has a
Build.xml file to which I can add a new target element but I dont know
where in the IDE allows me to execute a certain target?

Can some please be kind enough to give me a sample code or some
direction on how to automatically copy the GWT output files to say c:
\www folder?

TIA

--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Necessary .class files in order to deploy a GWT application

2009-01-15 Thread Rafael

¡Hello People!

   I was following the instructions to deploy a GWT app on a Tomcat
server (http://code.google.com/intl/es-ES/docreader/#p=google-web-
toolkit-doc-1-5s=google-web-toolkit-doc-1-5t=DevGuideRPCDeployment)
and it ocurred to me that the only .class files that should be copied
onto the WEB-INF/classes folder are the ones located in the package
package.module.server, considering that the remaining classes (the
ones located in the public and client packages) are compiled via the
GWT compiler into html, css, etc.

¿Is this correct?

I should warn you that i have little to none experience with GWT so i
am perfectly capable of not making any sense

¡Thanks in advance!

Rafael

--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



RPC call returning ListString fails

2009-01-15 Thread jos

I have an RPC call with a signature like public ListString SomeCall
(SomeObj) { return anArrayList; } which failed.
Policy file was deployed and the file had ArrayList, true in the file.
The only real information available was the stack trace it left in
catalina.out (see below).

I'm running gwt1.52, a Spring/Hibernate stack on the back end with (a
probably early version of) gwt-sl. The problem manifested itself in
eclipse. When I changed the return value to String[] eveything worked
fine.

 Does anyone know, is it not OK to use ListString as a return
specifier?




2009-01-14 16:41:08,569 ERROR [org.apache.catalina.core.ContainerBase.
[Catalina].[localhost].[/geo]] - Exception while dispatching incoming
RPC call
javax.servlet.ServletException: Client did not send 158 bytes as
expected
at com.google.gwt.user.server.rpc.RPCServletUtils.readContentAsUtf8
(RPCServletUtils.java:148)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.readContent
(RemoteServiceServlet.java:335)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:77)
at org.gwtwidgets.server.spring.GWTRPCServiceExporter.handleRequest
(GWTRPCServiceExporter.java:169)
at
org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle
(HttpRequestHandlerAdapter.java:49)
at org.springframework.web.servlet.DispatcherServlet.doDispatch
(DispatcherServlet.java:874)
at org.springframework.web.servlet.DispatcherServlet.doService
(DispatcherServlet.java:808)
at org.springframework.web.servlet.FrameworkServlet.processRequest
(FrameworkServlet.java:476)
at org.springframework.web.servlet.FrameworkServlet.doPost
(FrameworkServlet.java:441)


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Necessary .class files in order to deploy a GWT application

2009-01-15 Thread Rafael Barrera Oro
Sorry, i already answered myself.

The client package is also necessary...

2009/1/15 Rafael boraf...@gmail.com


 ¡Hello People!

   I was following the instructions to deploy a GWT app on a Tomcat
 server (http://code.google.com/intl/es-ES/docreader/#p=google-web-
 toolkit-doc-1-5s=google-web-toolkit-doc-1-5t=DevGuideRPCDeploymenthttp://code.google.com/intl/es-ES/docreader/#p=google-web-toolkit-doc-1-5s=google-web-toolkit-doc-1-5t=DevGuideRPCDeployment
 )
 and it ocurred to me that the only .class files that should be copied
 onto the WEB-INF/classes folder are the ones located in the package
 package.module.server, considering that the remaining classes (the
 ones located in the public and client packages) are compiled via the
 GWT compiler into html, css, etc.

 ¿Is this correct?

 I should warn you that i have little to none experience with GWT so i
 am perfectly capable of not making any sense

 ¡Thanks in advance!

 Rafael

 


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



RPC functionality outside of a WAR

2009-01-15 Thread Mike B

Is it possible to build a GWT app that has RPC functionality, but is
not contained in a WAR?  I am developing a plugin that does not have
access to a web.xml file and can't find a way to get my client and
server code to link up
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Performance overhead of virtual methods

2009-01-15 Thread nathan.r.matth...@googlemail.com

Thanks Jason and to the others who responded. Question answered :)

On Jan 3, 12:09 pm, Jason Morris lem...@gmail.com wrote:
 nathan.r.matth...@googlemail.com wrote:
  Hi GWTers

  I'm writing some performance sensitive code for GWT. I'm wondering how
  GWT compilesvirtualfunctions to JavaScript. What's the associated
  performance overhead? Obviously I'd like to use proper polymorphism
  but if there's a significant performance overhead it may be worth re-
  factoring various parts of the code-base.

  Regards,

  Nathan

 Hi Nathan,

 Someone else can correct me if I'm wrong, but after taking a look at the 
 generated code, it seems
 thatvirtualmethods shouldn't incur any additional performance overhead in 
 GWT. Basically the
 bottom level method is given the top-level declared name in each object 
 instance, thus the lookup
 expense is the same as that of a non-virtualmethod.

 Like I said, if I'm wrong on this, someone should correct me. ;)

 Cheers,
 Jason.
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



How to render a list(ul li) by gwt widget ?

2009-01-15 Thread Jason

I want to use gwt widgets to render a list, the result should look
like this:

ul
  lia href=***About/a/li
  lia href=***About/a/li
  lia href=***About/a/li
/ul

I'm not sure which widget will meet my need. The HTML widget seams can
get the result, but it is not the perfect solution. could someone help
me ?
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: How to render a list(ul li) by gwt widget ?

2009-01-15 Thread Jason Essington

There is a feature request for a UL and LI widget, however they are  
not yet included ... however, they aren't that difficult to create,  
I've had to do it for a couple of projects.

You can use FlowPanel as your guide, and create similar widgets using  
the ul and li element. you could add additional methods as need be,  
but the simple add(widget w) method is minimally sufficient.

-jason

On Jan 15, 2009, at 1:57 PM, Jason wrote:


 I want to use gwt widgets to render a list, the result should look
 like this:

 ul
  lia href=***About/a/li
  lia href=***About/a/li
  lia href=***About/a/li
 /ul

 I'm not sure which widget will meet my need. The HTML widget seams can
 get the result, but it is not the perfect solution. could someone help
 me ?
 


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Number of DAO's effect over all module sizes

2009-01-15 Thread David Stubbs

We have an application spread over 60+ modules. Each module as
compiled javascript ranges in size between 800k and 2.8Mb.

The size of every module is increasing as the app grows. After some
very basic investigation it seems to be our DAO models that are
causing the steady increase in size.

Within our application we replicate all of our server side DAO's on
the client side using code generation. Almost all the DAO are
interconnected, using a DAO object in a module causes all the others
to be included as well.

I understand why this is happening, but I'm wondering if there is any
way to avoid this?

Any ideas, suggestions or experiences welcome.

David.

--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: two trees on one page.

2009-01-15 Thread Jill Singer

I solved the problem:

I searched through the net, and found this post:
http://markmail.org/message/zozobs24v4wyvf6p

and wondered if that quirk was causing my problem.

I already was using a subclass of Tree,
so added to the constructor:


DOM.setStyleAttribute(getElement(), position, static);

and; now the second tree is not disappearing when I select the first
tree.
I'm planning to file a bug on this issue.





On Jan 13, 12:06 pm, Jill Singer jillre...@alum.mit.edu wrote:
 when I have two trees on one page-

 even if they are in different verticalpanels  (which I know are just
 columns in a table),
 when I select an item on the first; the second tree disappears.

 this behavior occurs in hosted mode and in ie, but not in firefox (and
 I need to make it work in ie; and hosted mode would be helpful)

 any ideas?

 (if I redraw one right after adding a new item to the other tree; then
 it will show up; but the selection problem is annoying...I don't want
 to be continually redrawing if I can help it)

 is this a css problem?

 please note:  I'm using gwt 1.462 (and no, I cannot upgrade; that it
 the version my company is using now)

 here's some sample code that can be run to demonstrate the problem
 (just instantiate it and put it in an entry-point class):
  package com.amicas.gwt.qc.client.widgets.dragndrop;

 import com.google.gwt.user.client.ui.AbsolutePanel;
 import com.google.gwt.user.client.ui.HTML;
 import com.google.gwt.user.client.ui.Tree;
 import com.google.gwt.user.client.ui.TreeItem;
 import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.VerticalPanel;

 public class DualTreeTest extends AbsolutePanel {

     //
 STATIC //
     /** shorthand to refer to the left box */
     private static final int LEFT =0;
     /** shorthand to refer to the right box */
     private static final int RIGHT =1;

     //
 STATE //
     private VerticalPanel its_leftBox;
     private VerticalPanel its_rightBox;

     public DualTreeTest() {

         HorizontalPanel hpan = new HorizontalPanel();
         //hpan.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

         its_leftBox = new VerticalPanel();

         its_leftBox.add(makeTree());
         its_leftBox.add(new HTML(P));
         //its_leftBox.addMouseListener(new TreeMouseAdapter());
         hpan.add(its_leftBox);

         its_rightBox = new VerticalPanel();
         its_rightBox.add(makeTree());
         hpan.add(its_rightBox);

         add(hpan);
     }

     public Tree makeTree(){
         Tree leftTree = new Tree();
         TreeItem level1 = new TreeItem(level1-1);
         TreeItem leafa = new TreeItem(a);
         TreeItem leafb = new TreeItem(b);
         TreeItem leafc = new TreeItem(c);
         TreeItem leafd = new TreeItem(d);

         level1.addItem(leafa);
         level1.addItem(leafb);
         level1.addItem(leafc);
         level1.addItem(leafd);

         TreeItem level2 = new TreeItem(level1-2);
         TreeItem leafa2 = new TreeItem(a2);
         TreeItem leafb2 = new TreeItem(b3);
         TreeItem leafc2 = new TreeItem(c4);
         TreeItem leafd2 = new TreeItem(d5);

         level2.addItem(leafa2);
         level2.addItem(leafb2);
         level2.addItem(leafc2);
         level2.addItem(leafd2);

         leftTree.addItem(leve11);
         leftTree.addItem(leve12);

         return leftTree;
     }

 }
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: How to render a list(ul li) by gwt widget ?

2009-01-15 Thread Jason

Hi, Jason, Thank you for your reply!

I'v tryied many ways, but failed. I'v get the following result:
ul
  li
div
  a href=aa/a
/div
  /li
/ul
It seems work in IE, but failed in Firefox.
So, could you do me a favour to send me your widget code? I'll so
appriciate about it!




On 1月16日, 上午5时35分, Jason Essington jason.essing...@gmail.com wrote:
 There is a feature request for a UL and LI widget, however they are  
 not yet included ... however, they aren't that difficult to create,  
 I've had to do it for a couple of projects.

 You can use FlowPanel as your guide, and create similar widgets using  
 the ul and li element. you could add additional methods as need be,  
 but the simple add(widget w) method is minimally sufficient.

 -jason

 On Jan 15, 2009, at 1:57 PM, Jason wrote:





  I want to use gwt widgets to render a list, the result should look
  like this:

  ul
   lia href=***About/a/li
   lia href=***About/a/li
   lia href=***About/a/li
  /ul

  I'm not sure which widget will meet my need. The HTML widget seams can
  get the result, but it is not the perfect solution. could someone help
  me ?- 隐藏被引用文字 -

 - 显示引用的文字 -
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Different Solutions to integrate Axis GWT

2009-01-15 Thread Q

Developers,
I have a website setup in the following manner:
JSP - Servlets - Axis WebServices - Database

The JSP displays the Axis objects that is pulled back via the
Servlet.  The Servlet pulls information via Webservices and uses an
Axis stub to invoke a service and receives Axis objects on the
callback.  The web service does a lookup on the database and generates
the results to return.

I'm trying to integrate GWT into this framework in order to use the
built-in AJAX functionality.  From the documentation that I've read, I
would need to create a separate set of objects for displaying the
information in the JSP and using the Axis objects only in Servlets.

However, I see this as a maintenance nightmare as I would need to keep
two similar objects in-sync instead of passing around the same object
as before.  Is this the recommended approach?  If not, what are my
alternatives?

Also, is there a way to make the updates to these objects a snap?
Like if the WSDL on  this website changes, I can run WSDL2Java and be
ok.

Thanks.


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Popular Application Design Tool for Java/GWT

2009-01-15 Thread tv

Hi,

I have a pretty clear idea for the architecture of a web application
that I want to create (incorporating GWT/Java/Hibernate/MySQL).
However, I am not a programmer by training and at this point I want to
enlist someone with more experience to help translate my ideas into a
useful roadmap for development and testing.  For instance, I
appreciate the benefits of an MVC approach, and I can state in plain
english what I want the app to do.  But, assuming I want to create a
more formal design rather than jumping straight into coding, what
should I be using to help with that design portion?

Can anyone recommend widely-used open-source (free) tool for
application architecture design -I suppose UML design?  Something
equivalent to Eclipse for code development?  Most of the Eclipse plug-
in tools I have found which relate to UML look like automatic code
generators - and what I want is a nice roadmap, not a road built from
templates...

Thanks in advance for any suggestions!

-Tom

--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: How to get Hidden field value in server-side?

2009-01-15 Thread blues

hi,

i use Hidden in client-side

Hidden hidden = new Hidden(name, value);

server-side in do-post:

DiskFileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
response.setCharacterEncoding(UTF-8);

ListFileItem items = null;
try
{
items = upload.parseRequest(request);
}
catch (FileUploadException e)
{
LOG.warn(., e);
}
// if(items!=null..)
for(FileItem item : items)
{
   // add code, what you want can like this coming
code
   //  item.getName()   item.getString()
item.getString(UTF-8)  item.getFieldName()
}

maybe help you!






On 1月15日, 下午10时59分, Alex Luya alexander.l...@gmail.com wrote:
 I have following code to upload an image to server and I need servlet
 to rename image to what the value of a hidden field sended to server
 through a post method, the question is how to get the value of this
 hidden field:imageStoreName.is it to use request.getParameter
 (imageStoreName)?I tried it,but I got  null.
 private final void setUploader()
 {
 HorizontalPanel hpUploaderLayout = new HorizontalPanel();
 // hidden will tell server how to rename the image
 imageStoreName = new Hidden();
 imageStoreName.setID(imageName);
 imageStoreName.setValue(Util.getId());

 final FileUpload uploader = new FileUpload();
 

 hpUploaderLayout.add(imageStoreName);
 hpUploaderLayout.add(uploader);
 uploadForm.setWidget(hpUploaderLayout);
 }

--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Necessary .class files in order to deploy a GWT application

2009-01-15 Thread Litty Preeth
Well if your package.module.server code references any
package.module.client code then you ll need to include tht also in the
WEB-INF/classes. An example may be java bean classes shared by both server
and client.

- Litty Preeth

On Thu, Jan 15, 2009 at 6:58 PM, Rafael boraf...@gmail.com wrote:


 ¡Hello People!

   I was following the instructions to deploy a GWT app on a Tomcat
 server (http://code.google.com/intl/es-ES/docreader/#p=google-web-
 toolkit-doc-1-5s=google-web-toolkit-doc-1-5t=DevGuideRPCDeploymenthttp://code.google.com/intl/es-ES/docreader/#p=google-web-toolkit-doc-1-5s=google-web-toolkit-doc-1-5t=DevGuideRPCDeployment
 )
 and it ocurred to me that the only .class files that should be copied
 onto the WEB-INF/classes folder are the ones located in the package
 package.module.server, considering that the remaining classes (the
 ones located in the public and client packages) are compiled via the
 GWT compiler into html, css, etc.

 ¿Is this correct?

 I should warn you that i have little to none experience with GWT so i
 am perfectly capable of not making any sense

 ¡Thanks in advance!

 Rafael

 


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



TreeNode Listener issues

2009-01-15 Thread Manish Kumar


Hi Everybody,

Can I get any help on this : I am calling a listener in this fashion. I am 
not getting what i am doing wrong. I am using GWT 1.5.2 and GWText 
component.

Please have a look at my code and help me out to find where i am wrong. 
Please excuse and let me know if anything is not concerned to this forum.

import com.gwtext.client.widgets.tree.TreeNode;
final TreeNode rootChild = new TreeNode( itemName );

if( itmType != null  itmType.equalsIgnoreCase(folder) )

{

rootChild.setExpandable(true);


rootChild.addListener(new TreeNodeListenerAdapter() {


public void onClick(Node node, EventObject e) {

try

{

RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, 
URL.encode(tempUrl));


builder.setCallback(new RequestCallback()

{

public void onError(Request request, Throwable exception)

  {

MessageBox.alert( exception.getLocalizedMessage() );

  }

public void onResponseReceived(Request request, Response 
response)

 {

if (200 == response.getStatusCode())

  {

MessageBox.alert( response.getText() );

buildTreeNode ( response.getText(), rootChild, root, 
tempUrl );

  }

else

  {

   MessageBox.alert(response.getStatusCode() + : + 
response.getStatusText() +:+ response.getText() );

  }

   }

});

builder.send();

}

catch(RequestException ex)

{

System.out.println( Exception occurred during sub tree node: + 
ex.getLocalizedMessage());

}

}

});

}

else

{

rootChild.addListener(new TreeNodeListenerAdapter()

{

public void onDblClick( Node node, EventObject e ) {

try

 {

System.out.println(xxx :);


RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, 
URL.encode(tempUrl));


builder.setCallback(new RequestCallback()

{

public void onError( Request request, Throwable exception )

 {

MessageBox.alert( exception.getLocalizedMessage() );

}


  public void onResponseReceived( Request request, Response 
response )

   {

if ( 200 == response.getStatusCode() )

 {

TabPanel tabPanel = new TabPanel();

tabPanel.setTabPosition(Position.BOTTOM);

tabPanel.setResizeTabs(true);

tabPanel.setMinTabWidth(115);

tabPanel.setTabWidth(135);

tabPanel.setActiveTab(0);


Frame google = new Frame(itmPath);


Panel filePanel = new Panel(Google);

filePanel.setLayout(new FitLayout());

filePanel.setIconCls(tab-icon);

filePanel.add(google);

}

else

{

MessageBox.alert( response.getStatusCode() + : + 
response.getStatusText() +:+ response.getText() );

}

}

});

builder.send();

}

catch(RequestException ex)

{

System.out.println( Exception occurred during sub tree node: + 
ex.getLocalizedMessage());

}

}

});

}


Regards,
Manish 


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: How to render a list(ul li) by gwt widget ?

2009-01-15 Thread alex.d

I would suppose that since most of the google widgets are div or
include div elemente it is easier just to take a HTMLPanel and fill it
with right tags and info.

On 15 Jan., 23:40, Jason meixues...@gmail.com wrote:
 Hi, Jason, Thank you for your reply!

 I'v tryied many ways, but failed. I'v get the following result:
 ul
   li
 div
   a href=aa/a
 /div
   /li
 /ul
 It seems work in IE, but failed in Firefox.
 So, could you do me a favour to send me your widget code? I'll so
 appriciate about it!

 On 1月16日, 上午5时35分, Jason Essington jason.essing...@gmail.com wrote:

  There is a feature request for a UL and LI widget, however they are  
  not yet included ... however, they aren't that difficult to create,  
  I've had to do it for a couple of projects.

  You can use FlowPanel as your guide, and create similar widgets using  
  the ul and li element. you could add additional methods as need be,  
  but the simple add(widget w) method is minimally sufficient.

  -jason

  On Jan 15, 2009, at 1:57 PM, Jason wrote:

   I want to use gwt widgets to render a list, the result should look
   like this:

   ul
lia href=***About/a/li
lia href=***About/a/li
lia href=***About/a/li
   /ul

   I'm not sure which widget will meet my need. The HTML widget seams can
   get the result, but it is not the perfect solution. could someone help
   me ?- 隐藏被引用文字 -

  - 显示引用的文字 -


--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: RPC call returning ListString fails

2009-01-15 Thread alex.d

It is actually. I'm using a lot of structures like this(and more
complex) for data transfer. The problem ist somewhere else - do you
initialize your List properly?

On 15 Jan., 18:36, jos jot...@gmail.com wrote:
 I have an RPC call with a signature like public ListString SomeCall
 (SomeObj) { return anArrayList; } which failed.
 Policy file was deployed and the file had ArrayList, true in the file.
 The only real information available was the stack trace it left in
 catalina.out (see below).

 I'm running gwt1.52, a Spring/Hibernate stack on the back end with (a
 probably early version of) gwt-sl. The problem manifested itself in
 eclipse. When I changed the return value to String[] eveything worked
 fine.

  Does anyone know, is it not OK to use ListString as a return
 specifier?

 2009-01-14 16:41:08,569 ERROR [org.apache.catalina.core.ContainerBase.
 [Catalina].[localhost].[/geo]] - Exception while dispatching incoming
 RPC call
 javax.servlet.ServletException: Client did not send 158 bytes as
 expected
         at com.google.gwt.user.server.rpc.RPCServletUtils.readContentAsUtf8
 (RPCServletUtils.java:148)
         at com.google.gwt.user.server.rpc.RemoteServiceServlet.readContent
 (RemoteServiceServlet.java:335)
         at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
 (RemoteServiceServlet.java:77)
         at org.gwtwidgets.server.spring.GWTRPCServiceExporter.handleRequest
 (GWTRPCServiceExporter.java:169)
         at
 org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle
 (HttpRequestHandlerAdapter.java:49)
         at org.springframework.web.servlet.DispatcherServlet.doDispatch
 (DispatcherServlet.java:874)
         at org.springframework.web.servlet.DispatcherServlet.doService
 (DispatcherServlet.java:808)
         at org.springframework.web.servlet.FrameworkServlet.processRequest
 (FrameworkServlet.java:476)
         at org.springframework.web.servlet.FrameworkServlet.doPost
 (FrameworkServlet.java:441)
--~--~-~--~~~---~--~~
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 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Bug? Cannot unsink ONMOUSEWHEEL event on Firefox

2009-01-15 Thread Yann

Arthur, my apologies if I was wrong: I had my message posted to this
forum given that I was not looking for help (I had one workaround
implemented and I can think of another workaround which is to simply
ignore the received event) but rather wanted to share my findings.
I was hesitant to directly submit a bug because other OSS comunities
(like RedHat) require users to describe bugs in a forum first...

---

Sami, my understanding is that the suggested fix (with the else
clause) is only being called whenever a user calls UIObject.sinkEvents
() or UIObject.unsinkEvents()... which is not performed very often, is
it? I mean, it is not called during event propagation.

So why worry about the throughput issue? (BTW, 99% is a slightly
exagerated figure for the fall-back into the 'else' clause: there are
30 events defined in the release I use (GWT 1.5.2) and in many cases,
the bit Event.ONMOUSEWHEEL might be actually set).

Finally looking at the W3C spec for these add/remove functions (see
link below) it is harmless to add a listener twice (i.e. it won't be
called twice) as well as removing a non-registered listener. Not sure
how well Mozilla implements that specification though...

http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Registration-interfaces

So I will now go down the route to submit a bug and... see what
happens next.

Thanks for your attention so far.
Yann
--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Bug? Cannot unsink ONMOUSEWHEEL event on Firefox

2009-01-15 Thread Yann

Just to add a cross reference to the submitted issue:
http://code.google.com/p/google-web-toolkit/issues/detail?id=3286

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Proposed tweaks to the new event infrastructure

2009-01-15 Thread rjrjr


http://gwt-code-reviews.appspot.com/2205/diff/1/24
File user/src/com/google/gwt/user/client/ui/Widget.java (left):

http://gwt-code-reviews.appspot.com/2205/diff/1/24#oldcode53
Line 53: public final HandlerManager getHandlers() {
On 2009/01/15 14:53:37, ecc wrote:
 I think that would be a much larger breaking change if we did not
override the
 return type here.

I think it's too soon to think that way with this code. All of its users
are early adopters who haven't even had access to it in an RC, or
internal users whom we're perfectly capable of fixing.

Narrowing the type is the odd thing to do, and if we don't have a
compelling reason to do it, we shouldn't. IMHO

http://gwt-code-reviews.appspot.com/2205

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Proposed tweaks to the new event infrastructure

2009-01-15 Thread Emily Crutcher
The reasons we narrow the type is to allow the following:

   1. the ability to have users deprecate their listeners cleanly
   2. the ability to create an internal gwt reporting system that gives
   users feedback on where/what their handlers are used
   3. the ability to, in a later release, create an event propagation system
   for widgets


On Thu, Jan 15, 2009 at 10:01 AM, rj...@google.com wrote:


 http://gwt-code-reviews.appspot.com/2205/diff/1/24
 File user/src/com/google/gwt/user/client/ui/Widget.java (left):

 http://gwt-code-reviews.appspot.com/2205/diff/1/24#oldcode53
 Line 53: public final HandlerManager getHandlers() {
 On 2009/01/15 14:53:37, ecc wrote:

 I think that would be a much larger breaking change if we did not

 override the

 return type here.


 I think it's too soon to think that way with this code. All of its users
 are early adopters who haven't even had access to it in an RC, or
 internal users whom we're perfectly capable of fixing.

 Narrowing the type is the odd thing to do, and if we don't have a
 compelling reason to do it, we shouldn't. IMHO


 http://gwt-code-reviews.appspot.com/2205




-- 
There are only 10 types of people in the world: Those who understand
binary, and those who don't

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] creating user sniff-test for build

2009-01-15 Thread ecc

Reviewers: fabbott,

Description:
Right now about one in a hundred builds or so api checker will break,
this patch creates a convenient target to programmers making changes to
user can run the tests, api checker, and the checkstyle checks as one
command.

It also fixed our checkstyle config by making it only fail on errors and
to put its output in a separate directory.

Please review this at http://gwt-code-reviews.appspot.com/2006

Affected files:
   build.xml
   common.ant.xml
   user/build.xml


Index: build.xml
===
--- build.xml   (revision 4441)
+++ build.xml   (working copy)
@@ -71,7 +71,7 @@
  delete dir=${gwt.build} /
/target

-  target name=apicheck depends=build
+   target name=gwt.apicheck
  description=Checks API compatibility to prior GWT revision
  copy tofile=${gwt.build.out}/userApi.conf filtering=false
file=${gwt.apicheck.config}
@@ -96,5 +96,30 @@
arg file=${gwt.build.out}/userApi.conf/
  /java
/target
-
+
+  target name=apicheck depends=build,gwt.apicheck
+description=Checks API compatibility to prior GWT revision
+copy tofile=${gwt.build.out}/userApi.conf filtering=false
+  file=${gwt.apicheck.config}
+  overwrite=true
+  filterset
+filter token=OLDROOT
+  value=${gwt.apicheck.oldroot}/
+  /filterset
+/copy
+java failonerror=true fork=true
+   
classname=com.google.gwt.tools.apichecker.ApiCompatibilityChecker
+  jvmarg line=-Xmx512m /
+  sysproperty key=gwt.devjar value=${gwt.dev.staging.jar} /
+  classpath
+pathelement location=${gwt.build.out}/tools/api-checker/bin/
+pathelement location=${gwt.build.out}/dev/core/bin/
+pathelement location=${gwt.build.out}/user/bin/
+pathelement location=${gwt.tools.lib}/eclipse/jdt-3.3.1.jar/
+pathelement path=${java.class.path}/
+  /classpath
+  arg value=-configFile/
+  arg file=${gwt.build.out}/userApi.conf/
+/java
+  /target
  /project
Index: common.ant.xml
===
--- common.ant.xml  (revision 4441)
+++ common.ant.xml  (working copy)
@@ -252,7 +252,8 @@
  element name=sourcepath implicit=yes optional=true /
  sequential
taskdef resource=checkstyletask.properties  
classpath=${gwt.tools.antlib}/checkstyle-all-4.2.jar;${gwt.build.lib}/gwt-customchecks.jar
  
/
-  checkstyle  
config=${gwt.root}/eclipse/settings/code-style/gwt-checkstyle.xml  
maxWarnings=0
+  checkstyle  
config=${gwt.root}/eclipse/settings/code-style/gwt-checkstyle.xml  
maxErrors=0
+   formatter type=xml  
toFile=${project.build}/checkstyle_errors.xml/
  property key=checkstyle.header.file  
file=${gwt.root}/eclipse/settings/code-style/google.header /
  sourcepath /
/checkstyle
Index: user/build.xml
===
--- user/build.xml  (revision 4441)
+++ user/build.xml  (working copy)
@@ -133,5 +133,7 @@
  delete dir=${project.build} /
  delete file=${project.lib} /
/target
-
+  target name=snifftest depends=test, checkstyle description=runs  
the gwt api checker, user checkstyle, and user tests
+   gwt.ant dir=.. target=gwt.apicheck/
+  /target
  /project



--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r4464 - in releases/1.6/user: src/com/google/gwt/user/client src/com/google/gwt/user/client/impl ...

2009-01-15 Thread codesite-noreply

Author: jlaba...@google.com
Date: Thu Jan 15 07:01:51 2009
New Revision: 4464

Modified:
releases/1.6/user/src/com/google/gwt/user/client/DOM.java
releases/1.6/user/src/com/google/gwt/user/client/Event.java
releases/1.6/user/src/com/google/gwt/user/client/ListenerWrapper.java
releases/1.6/user/src/com/google/gwt/user/client/impl/DOMImpl.java
releases/1.6/user/src/com/google/gwt/user/client/ui/PopupPanel.java
releases/1.6/user/test/com/google/gwt/user/client/EventTest.java

Log:
Merged the legecy EventPreview stack into the new NativePreviewHandler  
stack so legacy EventPreviews will only fire if they are at the top of the  
combined stack.  A previous change took PopupPanels off the legacy stack,  
which promoted other EventPreview to the top and broke legacy code.

Patch by: jlabanca
Review by: ecc (desk)
Issue: 3285



Modified: releases/1.6/user/src/com/google/gwt/user/client/DOM.java
==
--- releases/1.6/user/src/com/google/gwt/user/client/DOM.java   (original)
+++ releases/1.6/user/src/com/google/gwt/user/client/DOM.java   Thu Jan 15  
07:01:51 2009
@@ -23,8 +23,6 @@
  import com.google.gwt.dom.client.SelectElement;
  import com.google.gwt.user.client.impl.DOMImpl;

-import java.util.ArrayList;
-
  /**
   * This class provides a set of static methods that allow you to  
manipulate the
   * browser's Document Object Model (DOM). It contains methods for  
manipulating
@@ -32,16 +30,11 @@
   * {...@link com.google.gwt.user.client.Event events}.
   */
  public class DOM {
-
// The current event being fired
private static Event currentEvent = null;
private static final DOMImpl impl = GWT.create(DOMImpl.class);
private static Element sCaptureElem;

-  // BrowserEventPreview
-  @SuppressWarnings(deprecation)
-  private static ArrayListEventPreview sEventPreviewStack;
-
/**
 * Adds an event preview to the preview stack. As long as this preview  
remains
 * on the top of the stack, it will receive all events before they are  
fired
@@ -55,14 +48,7 @@
 */
@Deprecated
public static void addEventPreview(EventPreview preview) {
-impl.maybeInitializeEventSystem();
-
-// Add the event preview to the stack. It will automatically
-// begin receiving events.
-if (sEventPreviewStack == null) {
-  sEventPreviewStack = new ArrayListEventPreview();
-}
-sEventPreviewStack.add(preview);
+ListenerWrapper.NativePreview.add(preview);
}

/**
@@ -532,7 +518,7 @@
}

/**
-   * Gets the key-repeat state of this event.  Only IE supports this  
attribute.
+   * Gets the key-repeat state of this event. Only IE supports this  
attribute.
 *
 * @param evt the event to be tested
 * @return codetrue/code if this key event was an auto-repeat
@@ -909,8 +895,8 @@
 *
 * @param parent the parent element
 * @param child the child element to add to codeparent/code
-   * @param before an existing child element of codeparent/code before
-   *  which codechild/code will be inserted
+   * @param before an existing child element of codeparent/code before  
which
+   *  codechild/code will be inserted
 */
public static void insertBefore(Element parent, Element child, Element  
before) {
  parent.insertBefore(child, before);
@@ -930,10 +916,10 @@
}

/**
-   * Creates an codelt;optiongt;/code element and inserts it as a  
child
-   * of the specified codelt;selectgt;/code element. If the index is
-   * less than zero, or greater than or equal to the length of the list,  
then
-   * the option element will be appended to the end of the list.
+   * Creates an codelt;optiongt;/code element and inserts it as a  
child of
+   * the specified codelt;selectgt;/code element. If the index is  
less
+   * than zero, or greater than or equal to the length of the list, then  
the
+   * option element will be appended to the end of the list.
 *
 * @param selectElem the codelt;selectgt;/code element
 * @param item the text of the new item; cannot be codenull/code
@@ -1012,12 +998,7 @@
 */
@Deprecated
public static void removeEventPreview(EventPreview preview) {
-// Remove the event preview from the stack. If it was on top,
-// any preview underneath it will automatically begin to
-// receive events.
-if (sEventPreviewStack != null) {
-  sEventPreviewStack.remove(preview);
-}
+ListenerWrapper.NativePreview.remove(preview);
}

/**
@@ -1270,6 +1251,13 @@
}

/**
+   * Initialize the event system if it has not already been initialized.
+   */
+  static void maybeInitializeEventSystem() {
+impl.maybeInitializeEventSystem();
+  }
+
+  /**
 * This method is called directly by native code when event preview is  
being
 * used.
 *
@@ -1280,12 +1268,6 @@
static boolean previewEvent(Event evt) {
  // Fire a NativePreviewEvent to 

[gwt-contrib] [google-web-toolkit commit] r4465 - releases/1.6

2009-01-15 Thread codesite-noreply

Author: sp...@google.com
Date: Thu Jan 15 08:05:07 2009
New Revision: 4465

Modified:
releases/1.6/branch-info.txt

Log:
Updates branch-info.txt to warn that r4460 will not merge cleanly to trunk.

Modified: releases/1.6/branch-info.txt
==
--- releases/1.6/branch-info.txt(original)
+++ releases/1.6/branch-info.txtThu Jan 15 08:05:07 2009
@@ -1,6 +1,6 @@
  branch-info.txt for GWT 1.6 release:
  Tracks interactions between this branch and other branches.
-See: http://code.google.com/p/google-web-toolkit/wiki/ManagingMerges
+See: http://code.google.com/p/google-web-toolkit/wiki/ManagingMerge

  Copies:
  /releases/1.6/ was created (r3732) as a straight copy from /trunk/@r3683
@@ -25,4 +25,10 @@
  /releases/1.6/@r4366:4385 was merged (r4386) into trunk

  The next merge into trunk will be:
-svn merge -r4385:?  
https://google-web-toolkit.googlecode.com/svn/releases/1.6 .
+svn merge -r4385:4459  
https://google-web-toolkit.googlecode.com/svn/releases/1.6 .
+svn merge -r4459:4460  
https://google-web-toolkit.googlecode.com/svn/releases/1.6 .  (will have  
failed parts)
+svn merge -r4460:?  
https://google-web-toolkit.googlecode.com/svn/releases/1.6 .
+
+
+Patches that will not merge cleanly:
+4460 (get help from spoon or scottb)

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: RR: Implementation of SingleJsoImpl

2009-01-15 Thread Lex Spoon

I have reviewed the JJS parts and the JSORestrictionsChecker part.
That leaves hosted mode (dev/shell).

I like the new rules that allow Java implementations to also exist,
albeit at a performance penalty.

I have one question about the new checking rules: is the check at
JSORestrictionsChecker lines 125-137 necessary?  It actually seems
fine to me if an interface extends another interface that extends
SingleJsoImpl.  This is particularly interesting in the case where the
interface actually won't have a JSO implementation, but only Java
implementations.  With the checking rules in the current patch, such
an interface would have to explicitly mark itself as SingleJsoImpl
even though it wouldn't be implemented by even one JSO.

More generally, marker interfaces would naturally be inherited along
with everything else that is inherited, and this doesn't seem like a
place to make an exception.

The comment of JSORestrictionsChecker still says that no method may
override another.  This should be updated to reflect the SingleJsoImpl
exception.  Ideally, the restrictions would all be documented in one
place.  One way to do that would be to move SingleJsoImpl's comments
over to JSORestrictionsChecker.  Or better, perhaps they should all be
moved to JavaScriptObject, so that they are easily accessible to
people using GWT.

Did you try making JSORestrictionsChecker and
CompilationUnitInvalidator being instantiable?  This would remove a
few lines of code for defining and passing around the state objects.

Does JCastOperation.allowJso simplify things any over simply having
CastNormalizer compute the same information?  That is, couldn't we
move the current test in JSONormalizer into CastNormalizer, and leave
JCastOperation as it stands?  Likewise for JInstanceOf.

If I'm not mistaken, the dualImpl information in JTypeOracle is
computed only before optimization.  It would be a good TODO in
setInstantiatedTypes to say that the info should be recomputed.  It's
entirely possible that there will be Java implementations of a JSO
before optimizations, but that the optimizer will remove the non-Java
ones and thus allow a better implementation.

That's all.  The implementation looks great and the test cases are
remarkably thorough.


Lex

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Proposed tweaks to the new event infrastructure

2009-01-15 Thread Ray Ryan
I agree with you, but you should know that there is a spot that we're using
the method already. Take a look in CheckBox#addValueChangeHandler:

  public HandlerRegistration addValueChangeHandler(

  ValueChangeHandlerBoolean handler) {

// Is this the first value change handler? If so, time to listen to
clicks

// on the checkbox

if (!isEventHandled(ValueChangeEvent.getType())) {

  this.addClickHandler(new ClickHandler() {

public void onClick(ClickEvent event) {

  // No need to compare old value and new value--click handler

  // only fires on real click, and value always toggles

  ValueChangeEvent.fire(CheckBox.this, isChecked());

}

  });

}

return addHandler(handler, ValueChangeEvent.getType());

  }

We don't add a click handler to the wrapped checkbox element until we
actually have someone listening to us for changes. I think this is a
micro-optimization that we can live without, but it's there.

rjrjr

On Thu, Jan 15, 2009 at 8:32 AM, Joel Webber j...@google.com wrote:

 [+rest of the review discussion] For context, this is about why we would
 want to have Widget.isEventHandled(Type).
 So I think the idea in this example is that QuestionnaireController would
 be synthesizing an UpdateEvent on the Questionnaire object, which might have
 handlers outside of the QuestionnaireController? But it would seem to me
 that it would be the Questionnaire class that would make that decision in
 response to the controller mutating it somehow.

 It seems to me we're committing to a slightly intrusive API (in the sense
 that it forces widgets to be able to answer questions about its attached
 handlers, which it might not be able to answer if it implements certain
 optimizations -- e.g., not hanging onto handlers of a given type if it knows
 in advance it will never fire them). And I don't see a use-case that
 couldn't be more sensibly implemented in another way. My vote would be to
 drop it until we have a specific use-case that strongly requires it.

 Thoughts, anyone?

 On Wed, Jan 14, 2009 at 6:01 PM, Emily Crutcher e...@google.com wrote:

  Here is an example of a situation where you might want to ask a widget
 about the events it has handlers for...


 *public class*
 Questionaire *extends* Widget *...*

  /**

 * Contains detailed information about how the *questionaire* has been
 updated.

 */

 *public* *static* *class* *UpdateEvent* *extends* *GwtEvent*{

 *...*

 }

 }

 *

 class
 * QuestionareController {

 Questionaire
 myQuestionaire;
 *public* *void* onStateChange()
 /**
 The server has been updated. The QuestionaireChangeEvent requires me to *
 diff* my current state against the new state in order to fill in the *
 Questionaire*.UpdateEvent, which is expensive, however I only need to do
 this if my *questionaire *actually listen to that event.
 if(myQuestionaire.isEventHandled(UpdateEvent.getType()){
  //do the work to synthetsize and fire the event.
 }

 *...*

 }




 On Wed, Jan 14, 2009 at 5:40 PM, Emily Crutcher e...@google.com wrote:



 this and used a method off of a EventDispatchUtil class.


 But we don't actually recycle events anywhere, do we? This is one of the
 open issues left from the review process as the event stuff was merged in 
 to
 the 1.6 branch last year--why do we have this complicated mechanism that we
 don't actually use?


 We recycle all dom events, so we are already in this use case.

 It is not that we are pretending it is not public, the method is public,
 but for a different set of users: Normal Widget/Event creators should never,
 ever, use this method. However, with the decoupling of HandlerManager from
 the rest of the event system we have introduced a new class of users
 handler management system implementors They, and only they, should need
 access to it.






  On Wed, Jan 14, 2009 at 4:36 PM, Ray Ryan rj...@google.com wrote:



  On Wed, Jan 14, 2009 at 1:18 PM, Joel Webber j...@google.com wrote:


 All,
 I've run into a few snags trying to use the new event system with
 some custom libraries, and would like to propose a few changes that 
 would
 make it easier to reuse the GwtEvent hierarchy without necessarily 
 using all
 of the infrastructure in com.google.gwt.event.*

 When trying to fire GwtEvents without using HandlerManager (don't
 ask... but it is a legitimate use-case), I hit a couple of brick walls. 
 The
 first was that GwtEvent.setSource() was package-protected, so that only
 HandlerManager was intended to be able to call it. This makes it 
 impossible
 to usefully create one on your own.

 To solve this first problem, I simply added a static setEventSource()
 method to HandlerManager. Even though it's in HandlerManager, I can use 
 it
 without pulling in the rest of it, and still not tempt event users to 
 try
 setting the event's source.


   public static void setEventSource(GwtEvent? event, Object
 source) {

 event.setSource(source);

   }


 I 

[gwt-contrib] Patch to fix issue 3078

2009-01-15 Thread Amit Manjhi
Hi Scott,

Please review the attached patch that fixes issue 3078.

Thanks,
Amit

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---

Index: 
dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java
===
--- dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java  
(revision 4466)
+++ dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java  
(working copy)
@@ -25,6 +25,7 @@
 import java.io.InputStreamReader;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -135,11 +136,120 @@
   }
 
   /**
+   * Test that ResourceOracleImpl preserves the order in which resources occur
+   * in ClassPathEntries during reRooting. The resources have different path
+   * names, but same file names.
+   * 
+   * @throws URISyntaxException
+   * @throws IOException
+   */
+  public void testOrderMaintainedSameFileNames() throws IOException,
+  URISyntaxException {
+ClassPathEntry cpe1jar = getClassPathEntry1AsJar();
+ClassPathEntry cpe2jar = getClassPathEntry2AsJar();
+
+/*
+ * cpe1 contains org/example/bar/client/BarClient1.txt and cpe2 contains
+ * org/example/foo/client/BarClient1.txt
+ * 
+ * p Check both ways (i.e, put cpe1 before cpe2 and then put cpe2 before
+ * cpe1) and verify that ResourceOracleImpl indeed honors the order.
+ */
+
+// put jar1 before jar2
+for (boolean shouldReroot : new boolean[] {true, false}) {
+  PathPrefixSet pps = new PathPrefixSet();
+  pps.add(new PathPrefix(org/example/foo/client, null, shouldReroot));
+  pps.add(new PathPrefix(org/example/bar/client, null, shouldReroot));
+  ResourceOracleImpl oracle = new ResourceOracleImpl(
+  Arrays.asList(new ClassPathEntry[] {cpe1jar, cpe2jar}));
+  oracle.setPathPrefixes(pps);
+  oracle.refresh(createTestTreeLogger());
+  MapString, Resource resourceMap = oracle.getResourceMap();
+  String resourceKey = org/example/bar/client/BarClient1.txt;
+  if (shouldReroot) {
+resourceKey = /BarClient1.txt;
+  }
+  if (shouldReroot) {
+assertEquals(5, resourceMap.size());
+  } else {
+assertEquals(6, resourceMap.size());
+  }
+  Resource barClient = resourceMap.get(resourceKey);
+  assertNotNull(barClient);
+  // TODO(amitmanjhi): use file contents to disambiguate instead?
+  String barClientPath = barClient.getURL().toString();
+  assertTrue(barClientPath +  should contain cpe1.jar, shouldReroot = 
+  + shouldReroot, barClientPath.indexOf(cpe1.jar) != -1);
+}
+
+// put jar2 before jar1
+for (boolean shouldReroot : new boolean[] {true, false}) {
+  PathPrefixSet pps = new PathPrefixSet();
+  pps.add(new PathPrefix(org/example/foo/client, null, shouldReroot));
+  pps.add(new PathPrefix(org/example/bar/client, null, shouldReroot));
+  ResourceOracleImpl oracle = new ResourceOracleImpl(
+  Arrays.asList(new ClassPathEntry[] {cpe2jar, cpe1jar}));
+  oracle.setPathPrefixes(pps);
+  oracle.refresh(createTestTreeLogger());
+  MapString, Resource resourceMap = oracle.getResourceMap();
+  String resourceKey = org/example/foo/client/BarClient1.txt;
+  if (shouldReroot) {
+resourceKey = /BarClient1.txt;
+  }
+  if (shouldReroot) {
+assertEquals(5, resourceMap.size());
+  } else {
+assertEquals(6, resourceMap.size());
+  }
+  Resource barClient = resourceMap.get(resourceKey);
+  assertNotNull(barClient);
+  // TODO(amitmanjhi): use file contents to disambiguate instead?
+  String barClientPath = barClient.getURL().toString();
+  assertTrue(barClientPath +  should contain cpe2.jar, shouldReroot = 
+  + shouldReroot, barClientPath.indexOf(cpe2.jar) != -1);
+}
+  }
+
+  /**
+   * Test that ResourceOracleImpl preserves the order in which resources occur
+   * in ClassPathEntries.
+   * 
+   * @throws URISyntaxException
+   * @throws IOException
+   */
+  public void testOrderMaintainedSameFilePaths() throws IOException, 
URISyntaxException {
+ClassPathEntry cpe1jar = getClassPathEntry1AsJar();
+ClassPathEntry cpe2jar = getClassPathEntry2AsJar();
+
+// both classpathEntry contain a resource by the name of
+// org/example/bar/client/BarClient2.txt
+for (boolean shouldReroot : new boolean[] {true, false}) {
+  PathPrefixSet pps = new PathPrefixSet();
+  pps.add(new PathPrefix(org/example/bar/client, null, shouldReroot));
+  ResourceOracleImpl oracle = new ResourceOracleImpl(
+  Arrays.asList(new ClassPathEntry[] {cpe1jar, cpe2jar}));
+  oracle.setPathPrefixes(pps);
+  

[gwt-contrib] [google-web-toolkit commit] r4467 - releases/1.6/user/src/com/google/gwt/user/datepicker/client

2009-01-15 Thread codesite-noreply

Author: e...@google.com
Date: Thu Jan 15 09:52:04 2009
New Revision: 4467

Modified:
 
releases/1.6/user/src/com/google/gwt/user/datepicker/client/CellGridImpl.java

Log:
making a sub-class public so I can cheat and use it in gwt-incubator, does  
not change the core API.
Review by:jlabanca

Modified:  
releases/1.6/user/src/com/google/gwt/user/datepicker/client/CellGridImpl.java
==
---  
releases/1.6/user/src/com/google/gwt/user/datepicker/client/CellGridImpl.java   
 
(original)
+++  
releases/1.6/user/src/com/google/gwt/user/datepicker/client/CellGridImpl.java   
 
Thu Jan 15 09:52:04 2009
@@ -39,7 +39,7 @@
/**
 * Cell type.
 */
-  abstract class Cell extends UIObject {
+  public abstract class Cell extends UIObject {
  private boolean enabled = true;
  private V value;
  private int index;

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r4468 - in releases/1.6: reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum use...

2009-01-15 Thread codesite-noreply

Author: e...@google.com
Date: Thu Jan 15 09:59:40 2009
New Revision: 4468

Added:
 
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/SpeedForClear.java
Modified:
releases/1.6/user/src/com/google/gwt/user/client/ui/ComplexPanel.java
releases/1.6/user/src/com/google/gwt/user/client/ui/FlowPanel.java
releases/1.6/user/test/com/google/gwt/user/client/ui/FlowPanelTest.java

Log:
Fixes issue 3148 by improving the performance of FlowPanel.clear() by a  
hundred to one on IE.
Review by:jlabanca

Added:  
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/SpeedForClear.java
==
--- (empty file)
+++  
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/SpeedForClear.java
 
Thu Jan 15 09:59:40 2009
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may  
not
+ * use this file except in compliance with the License. You may obtain a  
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,  
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations  
under
+ * the License.
+ */
+package com.google.gwt.museum.client.defaultmuseum;
+
+import com.google.gwt.core.client.Duration;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.museum.client.common.AbstractIssue;
+import com.google.gwt.museum.client.common.ControlInputPanel;
+import com.google.gwt.museum.client.common.SimpleLogger;
+import com.google.gwt.museum.client.common.ControlInputPanel.IntegerInput;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Panel;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/*
+ * Originally, on IE, about three seconds to distroy
+ */
+/**
+ * Tests bad behavior for clear.
+ *
+ * pre
+ * ff -- 1000 flow panels, aprox 500  millis
+ * ie -- 1000 flow panels, aprox 3000 millis
+ *
+ * in new version
+ * ie -- 1000 flow panels, aprox 30-80 millis
+ * ff -- 1000 flow panels, aprox 13-50 millis
+ * /pre
+ * p
+ * img class='gallery' src='FlowPanel.png'/
+ * /p
+ */
+public class SpeedForClear extends AbstractIssue {
+  private Panel target;
+  private ListWidget children = new ArrayListWidget();
+  private SimpleLogger log = new SimpleLogger();
+
+  @Override
+  public Widget createIssue() {
+VerticalPanel v = new VerticalPanel();
+ControlInputPanel p = new ControlInputPanel();
+v.add(p);
+v.add(log);
+final IntegerInput size = new IntegerInput(flowpanel, 10, p);
+Button create = new Button(create widget, new ClickHandler() {
+
+  public void onClick(ClickEvent event) {
+createLargeFlowPanel(size.getValue());
+  }
+});
+
+Button distroy = new Button(time the removal, new ClickHandler() {
+  public void onClick(ClickEvent event) {
+Duration d = new Duration();
+target.clear();
+
+log.report(Took  + d.elapsedMillis() +  milliseconds to clear 
++ size.getValue() +  widgets from a flow panel);
+for (Widget child : children) {
+  if (child.getElement().getPropertyString(__listener) != null) {
+throw new IllegalStateException(
+each child should no longer have a listener);
+  }
+}
+  }
+});
+v.add(create);
+v.add(distroy);
+return v;
+  }
+
+  @Override
+  public String getInstructions() {
+return check the speed of clear methods;
+  }
+
+  @Override
+  public String getSummary() {
+return clear() speed check;
+  }
+
+  @Override
+  public boolean hasCSS() {
+return false;
+  }
+
+  private void createLargeFlowPanel(int size) {
+
+if (target != null) {
+  target.removeFromParent();
+}
+target = new FlowPanel();
+
+for (int i = 0; i  size; i++) {
+  Widget w = new Label(widget- + i);
+  target.add(w);
+  children.add(w);
+}
+
+RootPanel.get().add(target);
+for (Widget child : target) {
+  if (child.getElement().getPropertyString(__listener) == null) {
+throw new IllegalStateException(each child should now have a  
listener);
+  }
+}
+  }
+
+}

Modified:  
releases/1.6/user/src/com/google/gwt/user/client/ui/ComplexPanel.java
==
--- 

[gwt-contrib] Re: RR: Implementation of SingleJsoImpl

2009-01-15 Thread BobV

 That's the flag I asked about.  In general it makes perfect sense to
 update the AST to hold any information that is needed.  In this case,
 though, if I understand correctly, the information is soley determined
 by the target type  of the cast.

I put the flag in there so that JsoNormalizer would contain all of the
AST fix-up code relevant to the JSO type instead of splitting it
across visitors. I'm fine with getting rid of the flag entirely and
moving the flag-setting code from JsoNormalizer into CastNormalizer.


-- 
Bob Vawter
Google Web Toolkit Team

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: RR: Implementation of SingleJsoImpl

2009-01-15 Thread Scott Blum
Let's also be sure that the appropriate optimizers can statically resolve
type checks on SingleJsoImpl interfaces.

On Thu, Jan 15, 2009 at 1:02 PM, BobV b...@google.com wrote:

  That's the flag I asked about.  In general it makes perfect sense to
  update the AST to hold any information that is needed.  In this case,
  though, if I understand correctly, the information is soley determined
  by the target type  of the cast.

 I put the flag in there so that JsoNormalizer would contain all of the
 AST fix-up code relevant to the JSO type instead of splitting it
 across visitors. I'm fine with getting rid of the flag entirely and
 moving the flag-setting code from JsoNormalizer into CastNormalizer.

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Change setSelectsFirstItem's name

2009-01-15 Thread rjrjr

LGTM

http://gwt-code-reviews.appspot.com/2007

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Proposed tweaks to the new event infrastructure

2009-01-15 Thread Joel Webber
Understood, but this use-case doesn't actually need it to be *public*, as it
calls it on itself, not another widget.
But that's now more or less beside the point, because after another
desk-side discussion, we came up with yet another simplification that would
leave Widget.isEventHandled() public anyway.

Here's the gist:
- Drop HandlerCollection altogether (which obviates the question of
getHandlers()' covariant return type).
- Move HandlerCollection's methods into HasHandlers.
- Make Widget implement HasHandlers directly, making isEventHandled() and
fireEvent() public.
- Simplify all the WhateverEvent.fire() methods a little, because they no
longer have to call source.getHandlers() (which can now no longer be null).

I've just uploaded another patch set that implements this.

On Thu, Jan 15, 2009 at 11:38 AM, Ray Ryan rj...@google.com wrote:

 I agree with you, but you should know that there is a spot that we're using
 the method already. Take a look in CheckBox#addValueChangeHandler:

   public HandlerRegistration addValueChangeHandler(

   ValueChangeHandlerBoolean handler) {

 // Is this the first value change handler? If so, time to listen to
 clicks

 // on the checkbox

 if (!isEventHandled(ValueChangeEvent.getType())) {

   this.addClickHandler(new ClickHandler() {

 public void onClick(ClickEvent event) {

   // No need to compare old value and new value--click handler

   // only fires on real click, and value always toggles

   ValueChangeEvent.fire(CheckBox.this, isChecked());

 }

   });

 }

 return addHandler(handler, ValueChangeEvent.getType());

   }

 We don't add a click handler to the wrapped checkbox element until we
 actually have someone listening to us for changes. I think this is a
 micro-optimization that we can live without, but it's there.

 rjrjr

 On Thu, Jan 15, 2009 at 8:32 AM, Joel Webber j...@google.com wrote:

 [+rest of the review discussion] For context, this is about why we would
 want to have Widget.isEventHandled(Type).
 So I think the idea in this example is that QuestionnaireController would
 be synthesizing an UpdateEvent on the Questionnaire object, which might have
 handlers outside of the QuestionnaireController? But it would seem to me
 that it would be the Questionnaire class that would make that decision in
 response to the controller mutating it somehow.

 It seems to me we're committing to a slightly intrusive API (in the sense
 that it forces widgets to be able to answer questions about its attached
 handlers, which it might not be able to answer if it implements certain
 optimizations -- e.g., not hanging onto handlers of a given type if it knows
 in advance it will never fire them). And I don't see a use-case that
 couldn't be more sensibly implemented in another way. My vote would be to
 drop it until we have a specific use-case that strongly requires it.

 Thoughts, anyone?

 On Wed, Jan 14, 2009 at 6:01 PM, Emily Crutcher e...@google.com wrote:

  Here is an example of a situation where you might want to ask a widget
 about the events it has handlers for...


 *public class*
 Questionaire *extends* Widget *...*

  /**

 * Contains detailed information about how the *questionaire* has been
 updated.

 */

 *public* *static* *class* *UpdateEvent* *extends* *GwtEvent*{

 *...*

 }

 }

 *

 class
 * QuestionareController {

 Questionaire
 myQuestionaire;
 *public* *void* onStateChange()
 /**
 The server has been updated. The QuestionaireChangeEvent requires me to
 *diff* my current state against the new state in order to fill in the *
 Questionaire*.UpdateEvent, which is expensive, however I only need to do
 this if my *questionaire *actually listen to that event.
 if(myQuestionaire.isEventHandled(UpdateEvent.getType()){
  //do the work to synthetsize and fire the event.
 }

 *...*

 }




 On Wed, Jan 14, 2009 at 5:40 PM, Emily Crutcher e...@google.com wrote:




 this and used a method off of a EventDispatchUtil class.


 But we don't actually recycle events anywhere, do we? This is one of
 the open issues left from the review process as the event stuff was merged
 in to the 1.6 branch last year--why do we have this complicated mechanism
 that we don't actually use?


 We recycle all dom events, so we are already in this use case.

 It is not that we are pretending it is not public, the method is public,
 but for a different set of users: Normal Widget/Event creators should 
 never,
 ever, use this method. However, with the decoupling of HandlerManager from
 the rest of the event system we have introduced a new class of users
 handler management system implementors They, and only they, should need
 access to it.






  On Wed, Jan 14, 2009 at 4:36 PM, Ray Ryan rj...@google.com wrote:




  On Wed, Jan 14, 2009 at 1:18 PM, Joel Webber j...@google.comwrote:


 All,
 I've run into a few snags trying to use the new event system with
 some custom libraries, and would 

[gwt-contrib] Re: Proposed tweaks to the new event infrastructure

2009-01-15 Thread Ray Cromwell
Being able to pick out only base events is crucial for me, as trying to
package the DOM classes in some environments leads to breakage (e.g.
Android)-Ray



On Thu, Jan 15, 2009 at 10:45 AM, j...@google.com wrote:



 http://gwt-code-reviews.appspot.com/2205/diff/1/6
 File user/src/com/google/gwt/event/Event.gwt.xml (right):

 http://gwt-code-reviews.appspot.com/2205/diff/1/6#newcode2
 Line 2: source path=shared/
 On 2009/01/15 14:53:37, ecc wrote:
  In almost all other cases in gwt, the module corresponding to the
 package name
  included everything. What about renaming this module to
 EventInfrastructure or
  EventBase if that is no longer true?

 The way things were before, it was impossible to take only the Event
 module, without picking up both the dom and logical packages. That would
 make this entire exercise pointless, because you wouldn't be able to
 reuse common event infrastructure without picking up a dependency on
 User.

 The only solutions to this are (a) what we have here or (b) to get rid
 of the event package hierarchy, which would leave us with something
 like:

 gwt.event.Event
 gwt.domevent.DomEvent
 gwt.logicalevent.LogicalEvent

 I don't care a great deal, but having a structure that makes it
 impossible to pick out the modules you want is unacceptable.

 http://gwt-code-reviews.appspot.com/2205/diff/1/8
 File user/src/com/google/gwt/event/shared/HandlerCollection.java
 (right):

 http://gwt-code-reviews.appspot.com/2205/diff/1/8#newcode23
 Line 23: */
 On 2009/01/15 14:53:37, ecc wrote:
  wording seems slightly awkward, can you rephrase? Something like
 Contains a
  collection of handlers, exposing the ability ...

 It doesn't actually *contain* a collection of handlers, but I've
 reworded it a bit anyway.

 http://gwt-code-reviews.appspot.com/2205/diff/1/7
 File user/src/com/google/gwt/event/shared/HandlerManager.java (right):

 http://gwt-code-reviews.appspot.com/2205/diff/1/7#newcode307
 Line 307:
 On 2009/01/15 14:53:37, ecc wrote:
  would prefer to have this method on a separate util class that is then
 javadoc'd
  to be only used by people implementing new handler collections
  (EventManagementUtil maybe?)
 

 Done.

 http://gwt-code-reviews.appspot.com/2205/diff/1/7#newcode365
 Line 365: HandlerManager.this.removeHandler((TypeEventHandler) type,
 handler);
 On 2009/01/14 22:50:06, rjrjr wrote:
  Why is this an improvement over DefaultHandlerRegistration? We have
 arguably
  less type safety, and no fewer classes.

 Not sure I follow -- DefaultHandlerRegistration assumed and required the
 use of HandlerManager, so you couldn't use them separately. All it
 appeared to do was implement the semantics of an inner class with a lot
 more typing (i.e., it had manually written ctor and fields that are just
 copies of now-final locals (HandlerManager.this, type, handler), and
 both implementations of removeHandler() contain the exact same typecast.
 I can't figure out a single reason for separating it into a top-level
 class.

 http://gwt-code-reviews.appspot.com/2205/diff/1/24
 File user/src/com/google/gwt/user/client/ui/Widget.java (left):

 http://gwt-code-reviews.appspot.com/2205/diff/1/24#oldcode53
 Line 53: public final HandlerManager getHandlers() {
 On 2009/01/15 15:01:08, rjrjr wrote:
  On 2009/01/15 14:53:37, ecc wrote:
   I think that would be a much larger breaking change if we did not
 override the
   return type here.
 
  I think it's too soon to think that way with this code. All of its
 users are
  early adopters who haven't even had access to it in an RC, or internal
 users
  whom we're perfectly capable of fixing.
 
  Narrowing the type is the odd thing to do, and if we don't have a
 compelling
  reason to do it, we shouldn't. IMHO

 I'm with Ray on this one -- I originally had tightened it down to
 HandlerManager because it wasn't an implementation of an interface
 method. But there's no need for the covariance here, because widgets
 never use it directly. I've loosened the type back to HandlerCollection,
 which feels a lot cleaner (I had to add one typecast to ListenerWrapper,
 but that's a temporary, deprecated glue class, so that feels ok to me).

 BTW, I dropped the javadoc because it's a trivial implementation of an
 interface method. There's no reason to specialize the documentation, and
 it will get picked up from the interface anyway.

 http://gwt-code-reviews.appspot.com/2205/diff/1/21
 File user/src/com/google/gwt/user/datepicker/client/DateBox.java
 (right):

 http://gwt-code-reviews.appspot.com/2205/diff/1/21#newcode443
 Line 443: DateChangeEvent.fireIfNotEqualDates(getHandlers(), this,
 oldDate, date);
 On 2009/01/15 14:53:37, ecc wrote:
  I think this was a remnant from the previous patch.

 Thanks. Removed.

 http://gwt-code-reviews.appspot.com/2205/diff/1/20
 File user/src/com/google/gwt/user/datepicker/client/DateChangeEvent.java
 (right):

 http://gwt-code-reviews.appspot.com/2205/diff/1/20#newcode42
 Line 42: HandlerCollection handlers, S source, 

[gwt-contrib] [google-web-toolkit commit] r4470 - in releases/1.6: reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum use...

2009-01-15 Thread codesite-noreply

Author: e...@google.com
Date: Thu Jan 15 10:41:04 2009
New Revision: 4470

Modified:
 
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBox.java
 
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBoxEvents.java
releases/1.6/user/src/com/google/gwt/user/client/ui/SuggestBox.java
releases/1.6/user/test/com/google/gwt/user/client/ui/SuggestBoxTest.java

Log:
Committing issue http://gwt-code-reviews.appspot.com/2007, renaming  
SuggestBox.setSelectsFirstItem.
Review by:rjrjr

Modified:  
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBox.java
==
---  
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBox.java
  
(original)
+++  
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBox.java
  
Thu Jan 15 10:41:04 2009
@@ -119,7 +119,7 @@

private SuggestBox suggestBoxWithDefault() {
  final SuggestBox b = new SuggestBox(girlsNamesWithDefault);
-b.setSelectsFirstItem(false);
+b.setAutoSelectEnabled(false);
  b.getTextBox().addMouseDownHandler(new MouseDownHandler() {

public void onMouseDown(MouseDownEvent event) {

Modified:  
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBoxEvents.java
==
---  
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBoxEvents.java

(original)
+++  
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBoxEvents.java

Thu Jan 15 10:41:04 2009
@@ -84,10 +84,10 @@
  final CheckBox selectsFirst = new CheckBox(Selects first suggestion);
  selectsFirst.addValueChangeHandler(new ValueChangeHandlerBoolean() {
public void onValueChange(ValueChangeEventBoolean event) {
-b.setSelectsFirstItem(event.getValue());
+b.setAutoSelectEnabled(event.getValue());
}
  });
-selectsFirst.setChecked(b.getSelectsFirstItem());
+selectsFirst.setChecked(b.isAutoSelectEnabled());
  p.add(selectsFirst);
  final EventReporterString, SuggestBox handler = new  
EventReporterString, SuggestBox(
  report);

Modified:  
releases/1.6/user/src/com/google/gwt/user/client/ui/SuggestBox.java
==
--- releases/1.6/user/src/com/google/gwt/user/client/ui/SuggestBox.java  
(original)
+++ releases/1.6/user/src/com/google/gwt/user/client/ui/SuggestBox.java Thu  
Jan 15 10:41:04 2009
@@ -388,16 +388,6 @@
}

/**
-   * Returns whether or not the first suggestion will be automatically  
selected.
-   * This behavior is off by default.
-   *
-   * @return true if the first suggestion will be automatically selected
-   */
-  public boolean getSelectsFirstItem() {
-return selectsFirstItem;
-  }
-
-  /**
 * Gets the suggest box's {...@link  
com.google.gwt.user.client.ui.SuggestOracle}.
 *
 * @return the {...@link SuggestOracle}
@@ -439,6 +429,16 @@
}

/**
+   * Returns whether or not the first suggestion will be automatically  
selected.
+   * This behavior is on by default.
+   *
+   * @return true if the first suggestion will be automatically selected
+   */
+  public boolean isAutoSelectEnabled() {
+return selectsFirstItem;
+  }
+
+  /**
 * @return true if the list of suggestions is currently showing, false  
if not
 */
public boolean isSuggestionListShowing() {
@@ -478,6 +478,17 @@
  suggestionPopup.setAnimationEnabled(enable);
}

+  /**
+   * Turns on or off the behavior that automatically selects the first  
suggested
+   * item. This behavior is on by default.
+   *
+   * @param selectsFirstItem Whether or not to automatically select the  
first
+   *  suggestion
+   */
+  public void setAutoSelectEnabled(boolean selectsFirstItem) {
+this.selectsFirstItem = selectsFirstItem;
+  }
+
public void setFocus(boolean focused) {
  box.setFocus(focused);
}
@@ -500,17 +511,6 @@
 */
public void setPopupStyleName(String style) {
  suggestionPopup.setStyleName(style);
-  }
-
-  /**
-   * Turns on or off the behavior that automatically selects the first  
suggested
-   * item. It defaults to off.
-   *
-   * @param selectsFirstItem Whether or not to automatically select the  
first
-   *  suggested
-   */
-  public void setSelectsFirstItem(boolean selectsFirstItem) {
-this.selectsFirstItem = selectsFirstItem;
}

public void setTabIndex(int index) {

Modified:  
releases/1.6/user/test/com/google/gwt/user/client/ui/SuggestBoxTest.java

[gwt-contrib] Re: Proposed tweaks to the new event infrastructure

2009-01-15 Thread Emily Crutcher
As most of the code review comments are moot, due to the change in how the
interface is implemented,  capturing the two issues left here:

*gwt.*.foo.Foo* -- has, in general, meant getting the content of the entire
package.

My suggestion is to add another naming convention to get the essential
code:
*gwt.*.foo.FooBase* -- gets just the stuff absolutely needed for the
sub-packages to work.

So, for events
*gwt.event.Even*t -- gets all the currently defined gwt event structure.
*gwt.event.EventBase* - gets the core infrastructure needed.

The only other thing is rather then having DomEvent extend User, why don't
we have DomEvent extend com.google.gwt.user.DOM?



The reason for DefaultHandlerRegistration was because, if you look at the
javadoc, you'll see we've left ourselves the option of actually adding to
that interface.  The purpose of default handler registration was to give
users a way to avoid being broken if/when that happens if they needed to
implement their own handler registration.  We could replace it with a public
DelegatingHandlerRegistration though,or we could say we will definitely not
break the HandlerRegistration interface.




On Thu, Jan 15, 2009 at 3:10 PM, Emily Crutcher e...@google.com wrote:

 Yep, that's a requirement, the only question, in my mind, is how to name
 the modules.


 On Thu, Jan 15, 2009 at 2:09 PM, Ray Cromwell cromwell...@gmail.comwrote:


 Being able to pick out only base events is crucial for me, as trying to
 package the DOM classes in some environments leads to breakage (e.g.
 Android) -Ray



 On Thu, Jan 15, 2009 at 10:45 AM, j...@google.com wrote:



 http://gwt-code-reviews.appspot.com/2205/diff/1/6
 File user/src/com/google/gwt/event/Event.gwt.xml (right):

 http://gwt-code-reviews.appspot.com/2205/diff/1/6#newcode2
 Line 2: source path=shared/
 On 2009/01/15 14:53:37, ecc wrote:
  In almost all other cases in gwt, the module corresponding to the
 package name
  included everything. What about renaming this module to
 EventInfrastructure or
  EventBase if that is no longer true?

 The way things were before, it was impossible to take only the Event
 module, without picking up both the dom and logical packages. That would
 make this entire exercise pointless, because you wouldn't be able to
 reuse common event infrastructure without picking up a dependency on
 User.

 The only solutions to this are (a) what we have here or (b) to get rid
 of the event package hierarchy, which would leave us with something
 like:

 gwt.event.Event
 gwt.domevent.DomEvent
 gwt.logicalevent.LogicalEvent

 I don't care a great deal, but having a structure that makes it
 impossible to pick out the modules you want is unacceptable.

 http://gwt-code-reviews.appspot.com/2205/diff/1/8
 File user/src/com/google/gwt/event/shared/HandlerCollection.java
 (right):

 http://gwt-code-reviews.appspot.com/2205/diff/1/8#newcode23
 Line 23: */
 On 2009/01/15 14:53:37, ecc wrote:
  wording seems slightly awkward, can you rephrase? Something like
 Contains a
  collection of handlers, exposing the ability ...

 It doesn't actually *contain* a collection of handlers, but I've
 reworded it a bit anyway.

 http://gwt-code-reviews.appspot.com/2205/diff/1/7
 File user/src/com/google/gwt/event/shared/HandlerManager.java (right):

 http://gwt-code-reviews.appspot.com/2205/diff/1/7#newcode307
 Line 307:
 On 2009/01/15 14:53:37, ecc wrote:
  would prefer to have this method on a separate util class that is then
 javadoc'd
  to be only used by people implementing new handler collections
  (EventManagementUtil maybe?)
 

 Done.

 http://gwt-code-reviews.appspot.com/2205/diff/1/7#newcode365
 Line 365: HandlerManager.this.removeHandler((TypeEventHandler) type,
 handler);
 On 2009/01/14 22:50:06, rjrjr wrote:
  Why is this an improvement over DefaultHandlerRegistration? We have
 arguably
  less type safety, and no fewer classes.

 Not sure I follow -- DefaultHandlerRegistration assumed and required the
 use of HandlerManager, so you couldn't use them separately. All it
 appeared to do was implement the semantics of an inner class with a lot
 more typing (i.e., it had manually written ctor and fields that are just
 copies of now-final locals (HandlerManager.this, type, handler), and
 both implementations of removeHandler() contain the exact same typecast.
 I can't figure out a single reason for separating it into a top-level
 class.

 http://gwt-code-reviews.appspot.com/2205/diff/1/24
 File user/src/com/google/gwt/user/client/ui/Widget.java (left):

 http://gwt-code-reviews.appspot.com/2205/diff/1/24#oldcode53
 Line 53: public final HandlerManager getHandlers() {
 On 2009/01/15 15:01:08, rjrjr wrote:
  On 2009/01/15 14:53:37, ecc wrote:
   I think that would be a much larger breaking change if we did not
 override the
   return type here.
 
  I think it's too soon to think that way with this code. All of its
 users are
  early adopters who haven't even had access to it in an RC, or 

[gwt-contrib] Re: working next week?

2009-01-15 Thread Katharina Probst

Hi Lex,

this patch LGTM.  I have a couple of non-blocking comments:

- As you suggested in our discussion, it might be helpful to add an
assert that !implmeth.isAbstract().  This would make it slightly
easier to follow.

- In JProgram, you introduce two new methods, createMethod and
createParameter that are only slightly different from the existing
ones, and in fact call the existing methods.  Why not simply call the
existing methods?

[My personal preference] - Because this is somewhat of a tricky patch,
it might be useful to add a few more comments on why your
implementation of addBridgeMethods catches all the cases we can think
about.  Otherwise, we will have to rederive that conclusion the next
time we look at the patch. You might also want to add a link to the
issue page.

Thanks,
kathrin


On Tue, Dec 30, 2008 at 1:58 PM, Lex Spoon sp...@google.com wrote:
 Cool, I have uploaded the patch to the issue's page.  An email should
 go around, though I haven't seen it yet.  Here's the page again in
 case the automatic email does not come your way.


 http://code.google.com/p/google-web-toolkit/issues/detail?id=3064

 Basically, the patch adds a test case, and to get the test case
 working, it adds a few bridge methods in GenerateJavaAST.  I spent
 some time trying to also remove the bridge methods, but after 2-3
 hours it started seeming like too much effort for too little gain in
 either output shrinking or in simplification of the compiler.


 -Lex


--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---




[gwt-contrib] Re: Proposed tweaks to the new event infrastructure

2009-01-15 Thread ecc


http://gwt-code-reviews.appspot.com/2205/diff/1/6
File user/src/com/google/gwt/event/Event.gwt.xml (right):

http://gwt-code-reviews.appspot.com/2205/diff/1/6#newcode2
Line 2: source path=shared/
Totally agreed about the overall goal. I was suggesting a slight naming
change:
gwt.foo.Foo -- in general means get the entire package.
gwt.foo.FooBase -- gets just the stuff absolutely needed for the
sub-packages to work.
So, for events
gwt.event.Event -- gets all the currently defined gwt event structure.
gwt.event.EventBase - gets the core infrastructure needed.


The only other thing is rather then having DomEvent extend User, why
don't we have DomEvent extend com.google.gwt.user.DOM?

http://gwt-code-reviews.appspot.com/2205/diff/43/230
File user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java
(right):

http://gwt-code-reviews.appspot.com/2205/diff/43/230#newcode42
Line 42: if (source.isEventHandled(TYPE)) {
On 2009/01/15 20:35:56, rjrjr wrote:
 Why is this fire method more complicated than all the other ones? No
one else
 bothers with the isEventHandled check.

I think it was from before we made up our minds on whether to check
before creating them.

http://gwt-code-reviews.appspot.com/2205/diff/43/221
File user/src/com/google/gwt/event/shared/HandlerManager.java (right):

http://gwt-code-reviews.appspot.com/2205/diff/43/221#newcode58
Line 58: return false;
It has already been removed.

http://gwt-code-reviews.appspot.com/2205/diff/43/236
File user/src/com/google/gwt/user/client/ui/ListenerWrapper.java
(right):

http://gwt-code-reviews.appspot.com/2205/diff/43/236#newcode93
Line 93: abstract class ListenerWrapperT implements EventHandler {
I think we might need to rename the inner classes of ListenerWrapper
before making it public (having eclipse control-shift T Tree bring up
ListenerWrapper.Tree is not ideal), so we might want to wait until after
this patch clears.

On 2009/01/15 20:35:56, rjrjr wrote:
 Elsewhere we said that we would make this class public (and
deprecated), as lots
 of people are in the same boat we are wrt event conversion. Might as
well make
 that change in this patch.

http://gwt-code-reviews.appspot.com/2205

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r4469 - in releases/1.6/distro-source: linux/src mac/src windows/src

2009-01-15 Thread codesite-noreply

Author: sco...@google.com
Date: Thu Jan 15 10:09:14 2009
New Revision: 4469

Added:
releases/1.6/distro-source/linux/src/webAppCreator   (contents, props  
changed)
   - copied, changed from r4465,  
/releases/1.6/distro-source/linux/src/applicationCreator
releases/1.6/distro-source/mac/src/webAppCreator   (contents, props  
changed)
   - copied, changed from r4465,  
/releases/1.6/distro-source/mac/src/applicationCreator
releases/1.6/distro-source/windows/src/webAppCreator.cmd   (contents,  
props changed)
   - copied, changed from r4465,  
/releases/1.6/distro-source/windows/src/applicationCreator.cmd
Removed:
releases/1.6/distro-source/linux/src/applicationCreator
releases/1.6/distro-source/mac/src/applicationCreator
releases/1.6/distro-source/windows/src/applicationCreator.cmd

Log:
Updated applicationCreator scripts to webAppCreator.

Copied: releases/1.6/distro-source/linux/src/webAppCreator (from r4465,  
/releases/1.6/distro-source/linux/src/applicationCreator)
==
--- /releases/1.6/distro-source/linux/src/applicationCreator(original)
+++ releases/1.6/distro-source/linux/src/webAppCreator  Thu Jan 15 10:09:14  
2009
@@ -1,3 +1,3 @@
  #!/bin/sh
  HOMEDIR=`dirname $0`;
-java -cp $HOMEDIR/gwt-user.jar:$HOMEDIR/gwt-dev-linux.jar  
com.google.gwt.user.tools.ApplicationCreator $@;
+java -cp $HOMEDIR/gwt-user.jar:$HOMEDIR/gwt-dev-linux.jar  
com.google.gwt.user.tools.WebAppCreator $@;

Copied: releases/1.6/distro-source/mac/src/webAppCreator (from r4465,  
/releases/1.6/distro-source/mac/src/applicationCreator)
==
--- /releases/1.6/distro-source/mac/src/applicationCreator  (original)
+++ releases/1.6/distro-source/mac/src/webAppCreatorThu Jan 15 10:09:14  
2009
@@ -1,3 +1,3 @@
  #!/bin/sh
  HOMEDIR=`dirname $0`;
-java -cp $HOMEDIR/gwt-user.jar:$HOMEDIR/gwt-dev-mac.jar  
com.google.gwt.user.tools.ApplicationCreator $@;
+java -cp $HOMEDIR/gwt-user.jar:$HOMEDIR/gwt-dev-mac.jar  
com.google.gwt.user.tools.WebAppCreator $@;

Copied: releases/1.6/distro-source/windows/src/webAppCreator.cmd (from  
r4465, /releases/1.6/distro-source/windows/src/applicationCreator.cmd)
==
--- /releases/1.6/distro-source/windows/src/applicationCreator.cmd   
(original)
+++ releases/1.6/distro-source/windows/src/webAppCreator.cmdThu Jan 15  
10:09:14 2009
@@ -1 +1 @@
-...@java -cp %~dp0\gwt-user.jar;%~dp0\gwt-dev-windows.jar  
com.google.gwt.user.tools.ApplicationCreator %*
+...@java -cp %~dp0\gwt-user.jar;%~dp0\gwt-dev-windows.jar  
com.google.gwt.user.tools.WebAppCreator %*

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r4473 - releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/common

2009-01-15 Thread codesite-noreply

Author: e...@google.com
Date: Thu Jan 15 11:26:10 2009
New Revision: 4473

Added:
 
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/common/ControlInputPanel.java

Log:
Adding helper class to allow tests to get user input more conveniently
Review by:jlabanca

Added:  
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/common/ControlInputPanel.java
==
--- (empty file)
+++  
releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/common/ControlInputPanel.java

Thu Jan 15 11:26:10 2009
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may  
not
+ * use this file except in compliance with the License. You may obtain a  
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,  
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations  
under
+ * the License.
+ */
+
+package com.google.gwt.museum.client.common;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.HasText;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * Helper class to get/set default values for visual tests.
+ */
+public class ControlInputPanel extends Composite {
+  /**
+   * Input
+   *
+   * @param V
+   * @param W
+   */
+  public abstract static class InputV, W extends Widget {
+protected String name;
+protected V value;
+protected W widget;
+
+protected Input(String name, V defaultValue) {
+  this.name = name;
+  this.value = defaultValue;
+  this.widget = createInputWidget();
+}
+
+/**
+ * Gets the name of the input
+ *
+ * @return the name of the input
+ */
+public String getName() {
+  return name;
+}
+
+/**
+ * Gets the value of this input.
+ */
+public abstract V getValue();
+
+@SuppressWarnings(unchecked)
+protected W createInputWidget() {
+  return (W) new TextBox();
+}
+
+protected void setValue(V value) {
+  ((HasText) widget).setText(value.toString());
+}
+  }
+
+  /**
+   * Set/get integer value.
+   */
+
+  public static class IntegerInput extends InputInteger, TextBox {
+public IntegerInput(String name, int defaultValue, ControlInputPanel  
p) {
+  super(name, defaultValue);
+  p.add(this);
+  widget.setText(String.valueOf(defaultValue));
+}
+
+@Override
+public Integer getValue() {
+  return Integer.valueOf(widget.getText());
+}
+  }
+
+  final FlexTable layout = new FlexTable();
+
+  private int numInputs;
+
+  public ControlInputPanel() {
+layout.setWidth(100%);
+initWidget(layout);
+  }
+
+  private void add(Input input) {
+layout.setText(0, numInputs, input.getName());
+layout.setWidget(1, numInputs, input.widget);
+  }
+}

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r4474 - in releases/1.6/user: src/com/google/gwt/event/logical/shared src/com/google/gwt/event/sh...

2009-01-15 Thread codesite-noreply

Author: jlaba...@google.com
Date: Thu Jan 15 12:38:29 2009
New Revision: 4474

Modified:
 
releases/1.6/user/src/com/google/gwt/event/logical/shared/BeforeSelectionEvent.java
 
releases/1.6/user/src/com/google/gwt/event/logical/shared/ResizeEvent.java
 
releases/1.6/user/src/com/google/gwt/event/logical/shared/SelectionEvent.java
 
releases/1.6/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java
releases/1.6/user/src/com/google/gwt/event/shared/HandlerManager.java
releases/1.6/user/src/com/google/gwt/user/client/Event.java
releases/1.6/user/src/com/google/gwt/user/client/ListenerWrapper.java
releases/1.6/user/src/com/google/gwt/user/client/Window.java
releases/1.6/user/src/com/google/gwt/user/client/ui/FormPanel.java
 
releases/1.6/user/test/com/google/gwt/event/shared/HandlerManagerTest.java
releases/1.6/user/test/com/google/gwt/user/client/EventTest.java

Log:
Adds an option to HandlerManager to fire handlers in reverse order, and  
converts NativePreviewEvent to use the HandlerManager instead of an  
ArrayList.  The HandlerManager automatically handles concurrent adds and  
removes, which caused a problem in MenuBar.

Patch by: jlabanca
Review by: ecc (desk)
Issue: 3289



Modified:  
releases/1.6/user/src/com/google/gwt/event/logical/shared/BeforeSelectionEvent.java
==
---  
releases/1.6/user/src/com/google/gwt/event/logical/shared/BeforeSelectionEvent.java
  
(original)
+++  
releases/1.6/user/src/com/google/gwt/event/logical/shared/BeforeSelectionEvent.java
  
Thu Jan 15 12:38:29 2009
@@ -91,7 +91,7 @@
// field itself does not, so we have to do an unsafe cast here.
@SuppressWarnings(unchecked)
@Override
-  public TypeBeforeSelectionHandlerI getAssociatedType() {
+  public final TypeBeforeSelectionHandlerI getAssociatedType() {
  return (Type) TYPE;
}


Modified:  
releases/1.6/user/src/com/google/gwt/event/logical/shared/ResizeEvent.java
==
---  
releases/1.6/user/src/com/google/gwt/event/logical/shared/ResizeEvent.java  
 
(original)
+++  
releases/1.6/user/src/com/google/gwt/event/logical/shared/ResizeEvent.java  
 
Thu Jan 15 12:38:29 2009
@@ -76,7 +76,7 @@
}

@Override
-  public TypeResizeHandler getAssociatedType() {
+  public final TypeResizeHandler getAssociatedType() {
  return TYPE;
}


Modified:  
releases/1.6/user/src/com/google/gwt/event/logical/shared/SelectionEvent.java
==
---  
releases/1.6/user/src/com/google/gwt/event/logical/shared/SelectionEvent.java   
 
(original)
+++  
releases/1.6/user/src/com/google/gwt/event/logical/shared/SelectionEvent.java   
 
Thu Jan 15 12:38:29 2009
@@ -76,7 +76,7 @@
// field itself does not, so we have to do an unsafe cast here.
@SuppressWarnings(unchecked)
@Override
-  public TypeSelectionHandlerI getAssociatedType() {
+  public final TypeSelectionHandlerI getAssociatedType() {
  return (Type) TYPE;
}


Modified:  
releases/1.6/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java
==
---  
releases/1.6/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java 
 
(original)
+++  
releases/1.6/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java 
 
Thu Jan 15 12:38:29 2009
@@ -54,7 +54,6 @@
 * safe handling of null.
 *
 * @param I the old value type
-   * @param S The event source
 * @param source the source of the handlers
 * @param oldValue the oldValue, may be null
 * @param newValue the newValue, may be null
@@ -110,7 +109,7 @@
// field itself does not, so we have to do an unsafe cast here.
@SuppressWarnings(unchecked)
@Override
-  public TypeValueChangeHandlerI getAssociatedType() {
+  public final TypeValueChangeHandlerI getAssociatedType() {
  return (Type) TYPE;
}


Modified:  
releases/1.6/user/src/com/google/gwt/event/shared/HandlerManager.java
==
--- releases/1.6/user/src/com/google/gwt/event/shared/HandlerManager.java   
 
(original)
+++ releases/1.6/user/src/com/google/gwt/event/shared/HandlerManager.java   
 
Thu Jan 15 12:38:29 2009
@@ -44,12 +44,20 @@
l.add(handler);
  }

-private H extends EventHandler void fireEvent(GwtEventH event) {
+private H extends EventHandler void fireEvent(GwtEventH event,
+boolean isReverseOrder) {
TypeH type = event.getAssociatedType();
int count = getHandlerCount(type);
-  for (int i = 0; i  count; i++) {
-H handler = this.H getHandler(type, i);
-event.dispatch(handler);
+  if (isReverseOrder) {
+for (int i = count - 1; i = 0; i--) {
+  

[gwt-contrib] [google-web-toolkit commit] r4475 - in releases/1.6/user: src/com/google/gwt/user/client/ui test/com/google/gwt/user/client/ui

2009-01-15 Thread codesite-noreply

Author: rj...@google.com
Date: Thu Jan 15 12:56:08 2009
New Revision: 4475

Modified:
releases/1.6/user/src/com/google/gwt/user/client/ui/CheckBox.java
releases/1.6/user/src/com/google/gwt/user/client/ui/RadioButton.java
releases/1.6/user/test/com/google/gwt/user/client/ui/CheckBoxTest.java
releases/1.6/user/test/com/google/gwt/user/client/ui/RadioButtonTest.java

Log:
This patch provides access to the underlying InputElement's value property,  
and
deprecates the old isChecked / setChecked methods that are redundant with  
those
implemented for HasValue.

Also converts CheckBox to use the new Element methods instead of DOM and
string names all over the place.

Related thread:

http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/80d51c5ff3b32844/cfef01d8b513ebd0?#cfef01d8b513ebd0

Addresses issues:

http://code.google.com/p/google-web-toolkit/issues/detail?id=458
http://code.google.com/p/google-web-toolkit/issues/detail?id=3249

Reviewed by ecc,jgw



Modified: releases/1.6/user/src/com/google/gwt/user/client/ui/CheckBox.java
==
--- releases/1.6/user/src/com/google/gwt/user/client/ui/CheckBox.java
(original)
+++ releases/1.6/user/src/com/google/gwt/user/client/ui/CheckBox.java   Thu  
Jan 15 12:56:08 2009
@@ -15,6 +15,9 @@
   */
  package com.google.gwt.user.client.ui;

+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.InputElement;
+import com.google.gwt.dom.client.LabelElement;
  import com.google.gwt.event.dom.client.ClickEvent;
  import com.google.gwt.event.dom.client.ClickHandler;
  import com.google.gwt.event.logical.shared.ValueChangeEvent;
@@ -22,6 +25,8 @@
  import com.google.gwt.event.shared.HandlerRegistration;
  import com.google.gwt.user.client.DOM;
  import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.EventListener;

  /**
   * A standard check box widget.
@@ -47,7 +52,8 @@
   * /p
   */
  public class CheckBox extends ButtonBase implements HasName,  
HasValueBoolean {
-  private Element inputElem, labelElem;
+  private InputElement inputElem;
+  private LabelElement labelElem;
private boolean valueChangeHandlerInitialized;

/**
@@ -85,15 +91,15 @@

protected CheckBox(Element elem) {
  super(DOM.createSpan());
-inputElem = elem;
-labelElem = DOM.createLabel();
+inputElem = InputElement.as(elem);
+labelElem = Document.get().createLabelElement();

-DOM.appendChild(getElement(), inputElem);
-DOM.appendChild(getElement(), labelElem);
+getElement().appendChild(inputElem);
+getElement().appendChild(labelElem);

  String uid = DOM.createUniqueId();
-DOM.setElementProperty(inputElem, id, uid);
-DOM.setElementProperty(labelElem, htmlFor, uid);
+inputElem.setPropertyString(id, uid);
+labelElem.setHtmlFor(uid);

  // Accessibility: setting tab index to be 0 by default, ensuring  
element
  // appears in tab sequence. FocusWidget's setElement method already
@@ -113,59 +119,85 @@
  public void onClick(ClickEvent event) {
// No need to compare old value and new value--click handler
// only fires on real click, and value always toggles
-  ValueChangeEvent.fire(CheckBox.this, isChecked());
+  ValueChangeEvent.fire(CheckBox.this, getValue());
  }
});
  }
  return addHandler(handler, ValueChangeEvent.getType());
}

+  /**
+   * Returns the value property of the input element that backs this  
widget.
+   * This is the value that will be associated with the CheckBox name and
+   * submitted to the server if a {...@link FormPanel} that holds it is  
submitted
+   * and the box is checked.
+   * p
+   * Don't confuse this with {...@link #getValue}, which returns true or  
false if
+   * the widget is checked.
+   *
+   * @return
+   */
+  public String getFormValue() {
+return inputElem.getAttribute(value);
+  }
+
@Override
public String getHTML() {
-return DOM.getInnerHTML(labelElem);
+return labelElem.getInnerHTML();
}

public String getName() {
-return DOM.getElementProperty(inputElem, name);
+return inputElem.getName();
}

@Override
public int getTabIndex() {
-return getFocusImpl().getTabIndex(inputElem);
+return inputElem.getTabIndex();
}

@Override
public String getText() {
-return DOM.getInnerText(labelElem);
+return labelElem.getInnerText();
}

/**
-   * Determines whether this check box is currently checked.
+   * Determines whether this check box is currently checked.
+   * p
+   * Note that this emis not/em return the value property of the  
checkbox
+   * input element wrapped by this widget. For access to that property, see
+   * {...@link #getFormValue()}
 *
-   * @return codetrue/code if the check box is checked
+   * @return codetrue/code 

[gwt-contrib] [google-web-toolkit commit] r4477 - in trunk: dev/core/src/com/google/gwt/dev/jjs/ast dev/core/src/com/google/gwt/dev/jjs/imp...

2009-01-15 Thread codesite-noreply

Author: sp...@google.com
Date: Thu Jan 15 13:32:00 2009
New Revision: 4477

Modified:
trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java
trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
trunk/user/test/com/google/gwt/dev/jjs/test/CompilerTest.java

Log:
Fixes issue 3064.  A virtual method call through an interface type
could translate to something that could crash in the following combination:
a class inherits a method declaration from an interface; the implementation
of that method is inherited through a superclass; the implementation
method has, due to generics, a different erased type signature than
the interface method; and the implementation method does not list the
interface method in its list of overrides.

To correct this corner case, bridge methods are added that forward
calls to the correct method.

Review by: kprobst



Modified: trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java
==
--- trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java   
(original)
+++ trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java  Thu Jan 
 
15 13:32:00 2009
@@ -138,41 +138,12 @@
}

/**
-   * Determine whether a type is instantiated, given an assumed list of
-   * instantiated types.
-   *
-   * @param type any type
-   * @param instantiatedTypes a set of types assumed to be instantiated. If
-   *  codenull/code, then there are no assumptions about which
-   *  types are instantiated.
-   * @return whether the type is instantiated
-   */
-  private static boolean isInstantiatedType(JReferenceType type,
-  SetJReferenceType instantiatedTypes) {
-if (instantiatedTypes == null) {
-  return true;
-}
-
-if (type instanceof JNullType) {
-  return true;
-}
-
-if (type instanceof JArrayType) {
-  JArrayType arrayType = (JArrayType) type;
-  if (arrayType.getLeafType() instanceof JNullType) {
-return true;
-  }
-}
-return instantiatedTypes.contains(type);
-  }
-
-  /**
 * Compare two methods based on name and original argument types
 * {...@link JMethod#getOriginalParamTypes()}. Note that nothing special is 
 
done
 * here regarding methods with type parameters in their argument lists.  
The
 * caller must be careful that this level of matching is sufficient.
 */
-  private static boolean methodsDoMatch(JMethod method1, JMethod method2) {
+  public static boolean methodsDoMatch(JMethod method1, JMethod method2) {
  // static methods cannot match each other
  if (method1.isStatic() || method2.isStatic()) {
return false;
@@ -199,6 +170,35 @@
  return true;
}

+  /**
+   * Determine whether a type is instantiated, given an assumed list of
+   * instantiated types.
+   *
+   * @param type any type
+   * @param instantiatedTypes a set of types assumed to be instantiated. If
+   *  codenull/code, then there are no assumptions about which  
types
+   *  are instantiated.
+   * @return whether the type is instantiated
+   */
+  private static boolean isInstantiatedType(JReferenceType type,
+  SetJReferenceType instantiatedTypes) {
+if (instantiatedTypes == null) {
+  return true;
+}
+
+if (type instanceof JNullType) {
+  return true;
+}
+
+if (type instanceof JArrayType) {
+  JArrayType arrayType = (JArrayType) type;
+  if (arrayType.getLeafType() instanceof JNullType) {
+return true;
+  }
+}
+return instantiatedTypes.contains(type);
+  }
+
private final MapJInterfaceType, SetJClassType couldBeImplementedMap  
= new IdentityHashMapJInterfaceType, SetJClassType();

private final MapJClassType, SetJInterfaceType couldImplementMap =  
new IdentityHashMapJClassType, SetJInterfaceType();
@@ -347,15 +347,15 @@

/**
 * Returns codetrue/code if a static field access of  
codetoType/code
-   * from within codefromType/code should generate a clinit call. This
-   * will be true in cases where codetoType/code has a live clinit  
method
-   * which we cannot statically know has already run. We can statically  
know the
+   * from within codefromType/code should generate a clinit call. This  
will
+   * be true in cases where codetoType/code has a live clinit method  
which
+   * we cannot statically know has already run. We can statically know the
 * clinit method has already run when:
 * ol
 * licodefromType == toType/code/li
-   * licodetoType/code is a superclass of codefromType/code
-   * (because codetoType/code's clinit would have already run
-   * codefromType/code's clinit; see JLS 12.4)/li
+   * licodetoType/code is a superclass of codefromType/code  
(because
+   * codetoType/code's clinit would have already run  
codefromType/code's
+   * clinit; see JLS 12.4)/li
 * /ol
 */
public boolean checkClinit(JReferenceType fromType, 

[gwt-contrib] [google-web-toolkit commit] r4478 - releases/1.6/user/src/com/google/gwt/user/client/ui

2009-01-15 Thread codesite-noreply

Author: jlaba...@google.com
Date: Thu Jan 15 13:36:49 2009
New Revision: 4478

Modified:
releases/1.6/user/src/com/google/gwt/user/client/ui/MenuBar.java

Log:
Fixed a bug where MenuItems in sub-sub menus cannot be clicked.

Patch by: jlabanca
Review by: ecc (desk)



Modified: releases/1.6/user/src/com/google/gwt/user/client/ui/MenuBar.java
==
--- releases/1.6/user/src/com/google/gwt/user/client/ui/MenuBar.java 
(original)
+++ releases/1.6/user/src/com/google/gwt/user/client/ui/MenuBar.javaThu  
Jan 15 13:36:49 2009
@@ -42,33 +42,59 @@
   * img class='gallery' src='MenuBar.png'/
   * /p
   *
- * h3CSS Style Rules/h3 ul class='css'
- * li.gwt-MenuBar { the menu bar itself }/li
- * li.gwt-MenuBar-horizontal { dependent style applied to horizontal  
menu bars }/li
- * li.gwt-MenuBar-vertical { dependent style applied to vertical menu  
bars }/li
- * li.gwt-MenuBar .gwt-MenuItem { menu items }/li
- * li.gwt-MenuBar .gwt-MenuItem-selected { selected menu items }/li
- * li.gwt-MenuBar .gwt-MenuItemSeparator { section breaks between menu  
items } /li
- * li.gwt-MenuBar .gwt-MenuItemSeparator .menuSeparatorInner { inner  
component of section separators }/li
- * li.gwt-MenuBarPopup .menuPopupTopLeft { the top left cell }/li
- * li.gwt-MenuBarPopup .menuPopupTopLeftInner { the inner element of the  
cell }/li
- * li.gwt-MenuBarPopup .menuPopupTopCenter { the top center cell }/li
- * li.gwt-MenuBarPopup .menuPopupTopCenterInner { the inner element of  
the cell }/li
- * li.gwt-MenuBarPopup .menuPopupTopRight { the top right cell }/li
- * li.gwt-MenuBarPopup .menuPopupTopRightInner { the inner element of  
the cell }/li
- * li.gwt-MenuBarPopup .menuPopupMiddleLeft { the middle left cell }/li
- * li.gwt-MenuBarPopup .menuPopupMiddleLeftInner { the inner element of  
the cell }/li
- * li.gwt-MenuBarPopup .menuPopupMiddleCenter { the middle center cell  
}/li
- * li.gwt-MenuBarPopup .menuPopupMiddleCenterInner { the inner element  
of the cell }/li
- * li.gwt-MenuBarPopup .menuPopupMiddleRight { the middle right cell  
}/li
- * li.gwt-MenuBarPopup .menuPopupMiddleRightInner { the inner element of  
the cell }/li
- * li.gwt-MenuBarPopup .menuPopupBottomLeft { the bottom left cell }/li
- * li.gwt-MenuBarPopup .menuPopupBottomLeftInner { the inner element of  
the cell }/li
- * li.gwt-MenuBarPopup .menuPopupBottomCenter { the bottom center cell  
}/li
- * li.gwt-MenuBarPopup .menuPopupBottomCenterInner { the inner element  
of the cell }/li
- * li.gwt-MenuBarPopup .menuPopupBottomRight { the bottom right cell  
}/li
- * li.gwt-MenuBarPopup .menuPopupBottomRightInner { the inner element of  
the cell }/li
- * /ul
+ * h3CSS Style Rules/h3
+ * dl
+ * dd.gwt-MenuBar/dd
+ * dtthe menu bar itself/dt
+ * dd.gwt-MenuBar-horizontal/dd
+ * dtdependent style applied to horizontal menu bars/dt
+ * dd.gwt-MenuBar-vertical/dd
+ * dtdependent style applied to vertical menu bars/dt
+ * dd.gwt-MenuBar .gwt-MenuItem/dd
+ * dtmenu items/dt
+ * dd.gwt-MenuBar .gwt-MenuItem-selected/dd
+ * dtselected menu items/dt
+ * dd.gwt-MenuBar .gwt-MenuItemSeparator/dd
+ * dtsection breaks between menu items/dt
+ * dd.gwt-MenuBar .gwt-MenuItemSeparator .menuSeparatorInner/dd
+ * dtinner component of section separators/dt
+ * dd.gwt-MenuBarPopup .menuPopupTopLeft/dd
+ * dtthe top left cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupTopLeftInner/dd
+ * dtthe inner element of the cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupTopCenter/dd
+ * dtthe top center cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupTopCenterInner/dd
+ * dtthe inner element of the cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupTopRight/dd
+ * dtthe top right cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupTopRightInner/dd
+ * dtthe inner element of the cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupMiddleLeft/dd
+ * dtthe middle left cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupMiddleLeftInner/dd
+ * dtthe inner element of the cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupMiddleCenter/dd
+ * dtthe middle center cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupMiddleCenterInner/dd
+ * dtthe inner element of the cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupMiddleRight/dd
+ * dtthe middle right cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupMiddleRightInner/dd
+ * dtthe inner element of the cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupBottomLeft/dd
+ * dtthe bottom left cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupBottomLeftInner/dd
+ * dtthe inner element of the cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupBottomCenter/dd
+ * dtthe bottom center cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupBottomCenterInner/dd
+ * dtthe inner element of the cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupBottomRight/dd
+ * dtthe bottom right cell/dt
+ * dd.gwt-MenuBarPopup .menuPopupBottomRightInner/dd
+ * dtthe inner element of the cell/dt
+ * /dl
   *
   * p
   * h3Example/h3
@@ -429,7 +455,7 @@
case Event.ONKEYDOWN: {
  int keyCode = DOM.eventGetKeyCode(event);

[gwt-contrib] Re: RR: slimmed down SOYC + dependencies written to file

2009-01-15 Thread Lex Spoon

Thanks.  This LGTM.

Minor things that don't need a re(re)review if you do them:

ControlFlowAnalyzer.recordDependencies is no longer needed; it's
equivalent to dr != null.

The DependencyRecorder interface could be made a static member of
ControlFlowAnalyzer.


Lex

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r4481 - in releases/1.6/dev/core: src/com/google/gwt/dev/resource/impl test/com/google/gwt/dev/re...

2009-01-15 Thread codesite-noreply

Author: sco...@google.com
Date: Thu Jan 15 14:59:31 2009
New Revision: 4481

Modified:
 
releases/1.6/dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java
 
releases/1.6/dev/core/test/com/google/gwt/dev/resource/impl/AbstractResourceOrientedTestBase.java
 
releases/1.6/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java

Log:
Fixes issue #3078; when the same logical resource occurs in more than one  
classpath entry, the classpath order must be honored.  Adds a test to  
verify this behavior.  Some minor cleanup, too.

Patch by: amitmanjhi
Review by: me


Modified:  
releases/1.6/dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java
==
---  
releases/1.6/dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java
   
(original)
+++  
releases/1.6/dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java
   
Thu Jan 15 14:59:31 2009
@@ -31,6 +31,7 @@
  import java.util.Collections;
  import java.util.HashMap;
  import java.util.HashSet;
+import java.util.LinkedHashMap;
  import java.util.List;
  import java.util.Map;
  import java.util.Set;
@@ -246,7 +247,6 @@
 * Rescans the associated paths to recompute the available resources.
 *
 * @param logger status and error details are written here
-   * @throws UnableToCompleteException
 */
public void refresh(TreeLogger logger) {
  TreeLogger refreshBranch = Messages.REFRESHING_RESOURCES.branch(logger,
@@ -254,9 +254,10 @@

  /*
   * Allocate fresh data structures in anticipation of needing to honor  
the
- * new identity for the collections if anything changes guarantee.
+ * new identity for the collections if anything changes guarantee.  
Use a
+ * LinkedHashMap because we do not want the order to change.
   */
-final MapString, AbstractResource newInternalMap = new  
HashMapString, AbstractResource();
+final MapString, AbstractResource newInternalMap = new  
LinkedHashMapString, AbstractResource();

  /*
   * Walk across path roots (i.e. classpath entries) in priority order.  
This
@@ -348,6 +349,12 @@
assert (path.startsWith(pathPrefix.getPrefix()));
if (pathPrefix.shouldReroot()) {
  String rerootedPath = pathPrefix.getRerootedPath(path);
+if (externalMap.get(rerootedPath) instanceof ResourceWrapper) {
+  // A rerooted resource blocks any other resource at this  
path.
+  ++hitCount;
+  break;
+}
+
  // Try to reuse the same wrapper.
  Resource exposed = exposedResourceMap.get(rerootedPath);
  if (exposed instanceof ResourceWrapper) {

Modified:  
releases/1.6/dev/core/test/com/google/gwt/dev/resource/impl/AbstractResourceOrientedTestBase.java
==
---  
releases/1.6/dev/core/test/com/google/gwt/dev/resource/impl/AbstractResourceOrientedTestBase.java

(original)
+++  
releases/1.6/dev/core/test/com/google/gwt/dev/resource/impl/AbstractResourceOrientedTestBase.java

Thu Jan 15 14:59:31 2009
@@ -132,12 +132,14 @@
}

protected void assertPathIncluded(SetAbstractResource resources,  
String path) {
-assertNotNull(findResourceWithPath(resources, path));
+assertNotNull(path =  + path +  should have been found in resources  
= 
++ resources, findResourceWithPath(resources, path));
}

protected void assertPathNotIncluded(SetAbstractResource resources,
String path) {
-assertNull(findResourceWithPath(resources, path));
+assertNull(path =  + path +  should not have been found in  
resources = 
++ resources, findResourceWithPath(resources, path));
}

protected File findJarDirectory(String name) throws URISyntaxException {

Modified:  
releases/1.6/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java
==
---  
releases/1.6/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java
  
(original)
+++  
releases/1.6/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java
  
Thu Jan 15 14:59:31 2009
@@ -25,6 +25,7 @@
  import java.io.InputStreamReader;
  import java.net.URISyntaxException;
  import java.util.ArrayList;
+import java.util.Arrays;
  import java.util.List;
  import java.util.Map;
  import java.util.Set;
@@ -59,9 +60,9 @@
}

private static class ResourceOracleSnapshot {
-private final SetResource resources;
-private final MapString, Resource resourceMap;
  private final SetString pathNames;
+private final MapString, Resource resourceMap;
+private final SetResource resources;

  public ResourceOracleSnapshot(ResourceOracleImpl oracle) {
resources = oracle.getResources();
@@ -127,6 

[gwt-contrib] [google-web-toolkit commit] r4479 - releases/1.6/user/src/com/google/gwt/user/tools

2009-01-15 Thread codesite-noreply

Author: sco...@google.com
Date: Thu Jan 15 14:47:35 2009
New Revision: 4479

Modified:
releases/1.6/user/src/com/google/gwt/user/tools/web.xmlsrc

Log:
Provide a welcome file automatically.

Modified: releases/1.6/user/src/com/google/gwt/user/tools/web.xmlsrc
==
--- releases/1.6/user/src/com/google/gwt/user/tools/web.xmlsrc  (original)
+++ releases/1.6/user/src/com/google/gwt/user/tools/web.xmlsrc  Thu Jan 15  
14:47:35 2009
@@ -1,6 +1,12 @@
  ?xml version=1.0 encoding=UTF-8?
  web-app

+  !-- Default page to serve --
+  welcome-file-list
+welcome-file@startupUrl/welcome-file
+  /welcome-file-list
+
+  !-- Servlets --
servlet
  servlet-nameechoServlet/servlet-name
  servlet-class@serverPackage.EchoServiceImpl/servlet-class

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r4480 - releases/1.6/user/src/com/google/gwt/user/tools

2009-01-15 Thread codesite-noreply

Author: sco...@google.com
Date: Thu Jan 15 14:47:56 2009
New Revision: 4480

Modified:
releases/1.6/user/src/com/google/gwt/user/tools/App.launchsrc

Log:
Reformat generated launch config.

Modified: releases/1.6/user/src/com/google/gwt/user/tools/App.launchsrc
==
--- releases/1.6/user/src/com/google/gwt/user/tools/App.launchsrc   
(original)
+++ releases/1.6/user/src/com/google/gwt/user/tools/App.launchsrc   Thu Jan 
 
15 14:47:56 2009
@@ -9,7 +9,7 @@
  listEntry value=lt;?xml version=quot;1.0quot;  
encoding=quot;UTF-8quot;?gt;#10;lt;runtimeClasspathEntry  
externalArchive=quot;@gwtDevPathquot; path=quot;3quot;  
type=quot;2quot;/gt;#10;/
  /listAttribute
  stringAttribute key=org.eclipse.jdt.launching.VM_ARGUMENTS  
value=-xmx2...@vmargs/
-stringAttribute key=org.eclipse.jdt.launching.PROGRAM_ARGUMENTS  
value=-startupUrl#10;@startupUrl @moduleName/
+stringAttribute key=org.eclipse.jdt.launching.PROGRAM_ARGUMENTS  
value=-startupUrl @startupUrl#10;@moduleName/
  stringAttribute key=org.eclipse.jdt.launching.PROJECT_ATTR  
value=@moduleShortName/
  booleanAttribute key=org.eclipse.debug.core.appendEnvironmentVariables  
value=true/
  /launchConfiguration

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r4482 - releases/1.6/tools/api-checker/test/com/google/gwt/tools/apichecker

2009-01-15 Thread codesite-noreply

Author: amitman...@google.com
Date: Thu Jan 15 15:27:04 2009
New Revision: 4482

Modified:
 
releases/1.6/tools/api-checker/test/com/google/gwt/tools/apichecker/ApiContainerTest.java

Log:
Minor re-factoring. Sort  format

Patch by: amitmanjhi



Modified:  
releases/1.6/tools/api-checker/test/com/google/gwt/tools/apichecker/ApiContainerTest.java
==
---  
releases/1.6/tools/api-checker/test/com/google/gwt/tools/apichecker/ApiContainerTest.java

(original)
+++  
releases/1.6/tools/api-checker/test/com/google/gwt/tools/apichecker/ApiContainerTest.java

Thu Jan 15 15:27:04 2009
@@ -91,18 +91,6 @@
  return sb.toString();
}

-  private static String getSourceForNewObject() {
-StringBuffer sb = new StringBuffer();
-sb.append(package java.lang;\n);
-sb.append(public class Object {\n);
-sb.append(\tpublic static class Foo extends Object{\n);
-sb.append(\t}\n);
-sb.append(}\n);
-sb.append(class Temp {\n);
-sb.append(});
-return sb.toString();
-  }
-
private static String getSourceForNonApiClass() {
  StringBuffer sb = new StringBuffer();
  sb.append(package test.apicontainer;\n);
@@ -163,7 +151,7 @@
}

ApiContainer apiCheck = null;
-  ApiContainer apiCheckLoop = null;
+  AbstractTreeLogger logger = new PrintWriterTreeLogger();

/**
 * Class hierarchy. public java.lang.Object --  
test.apicontainer.NonApiClass
@@ -172,24 +160,43 @@
 */
@Override
public void setUp() throws UnableToCompleteException {
-AbstractTreeLogger logger = new PrintWriterTreeLogger();
  logger.setMaxDetail(com.google.gwt.core.ext.TreeLogger.ERROR);
-apiCheckLoop = new ApiContainer(
-ApiClassTest,
-new HashSetCompilationUnit(
-Arrays.asList(new StaticCompilationUnit[] {new  
StaticCompilationUnit(
-java.lang.Object, getSourceForNewObject()),})),
-new HashSetString(), logger);
+
  apiCheck = new ApiContainer(ApiContainerTest,
  new HashSetCompilationUnit(Arrays.asList(getScuArray())),
  new HashSetString(), logger);
}

+  /*
+   * Test if ApiContainer correctly creates an ApiContainer (for example,  
avoids
+   * an infinite loop) when a nested class extends an outer class.
+   */
+  public void testApiContainerLoop() throws UnableToCompleteException {
+StringBuffer sb = new StringBuffer();
+sb.append(package java.lang;\n);
+sb.append(public class Object {\n);
+sb.append(\tpublic static class Foo extends Object{\n);
+sb.append(\t}\n);
+sb.append(}\n);
+sb.append(class Temp {\n);
+sb.append(});
+
+ApiContainer apiCheckLoop = new ApiContainer(
+ApiClassTest,
+new HashSetCompilationUnit(
+Arrays.asList(new StaticCompilationUnit[] {new  
StaticCompilationUnit(
+java.lang.Object, sb.toString())})), new  
HashSetString(),
+logger);
+ApiPackage javaLangPackage = apiCheckLoop.getApiPackage(java.lang);
+assertNotNull(javaLangPackage);
+assertNotNull(javaLangPackage.getApiClass(java.lang.Object));
+assertEquals(2, javaLangPackage.getApiClassNames().size());
+  }
+
public void testEverything() {
  checkApiClass();
  checkApiMembers();
  checkApiPackages();
-checkInfiniteLoopInApiClass();
}

/**
@@ -270,12 +277,5 @@
  assertNotNull(apiCheck.getApiPackage(java.lang));
  assertNotNull(apiCheck.getApiPackage(test.apicontainer));
  assertEquals(3, apiCheck.getApiPackageNames().size());
-  }
-
-  void checkInfiniteLoopInApiClass() {
-ApiPackage tempPackage = apiCheckLoop.getApiPackage(java.lang);
-assertNotNull(tempPackage);
-assertNotNull(tempPackage.getApiClass(java.lang.Object));
-assertEquals(2, tempPackage.getApiClassNames().size());
}
  }

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r4484 - tools/lib/tomcat

2009-01-15 Thread codesite-noreply

Author: sco...@google.com
Date: Thu Jan 15 16:38:03 2009
New Revision: 4484

Added:
tools/lib/tomcat/jsp-api-2.1.jar   (contents, props changed)

Log:
Updating JSP API to 2.1.

Added: tools/lib/tomcat/jsp-api-2.1.jar
==
Binary file. No diff available.

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---