How to properly use selection properties in generators to generate different implementations for each permutation

2014-12-03 Thread Honza Rames
Hi everyone,
I hope I'll be clear enough so this answer actually makes sense...

I have a chain of generators that are configured by one deferred binding 
property and I need the generators to produce different results based on 
this property. There aren't many examples on how to achieve this, I started 
by looking how i18n does that (which is the only generator I know that 
produces different results for different permutations) and soon after I 
realized that I need to output different implementation class names 
(obviously) to achieve that. Then the DistillerRebindPermutationOracle 
really sets proper implementation class names to interface names that are 
generated.

So far so good, I can change the behavior of this one generated class but 
what if my generator produces a code that needs to rebind another class by 
another generator. This is where I got stuck because permutations that 
belong to another configuration are trying to rebind classes that should 
(and are) never used in those permutations. The order of the subsequent 
rebinding is set by how the implementation names are sorted inside the 
DistillerRebindPermutationOracle result (given by a set of all rebound 
classes for all permutations).

Here is an example of what I'm trying to achieve:

public interface Factory {
  Factory IMPL = GWT.create(Factory.class);

  SomeObj getImpl();
}

//Config1 generated
public class FacoryImpl implements Factory {
  public SomeObj() {
SomeObj result = new SomeObj();
INIT1.init(result);
  }

  public interface Init1 extends Initializer {}
  static Initializer INIT1 = GWT.create(Init1.class);
}

//Config2 generated
public class FacoryImpl2 implements Factory {
  public SomeObj() {
SomeObj result = new SomeObj();
INIT1.init(result);
  }

  public interface Init1 extends Initializer {}
  static Initializer INIT1 = GWT.create(Init1.class);
}

Both of these classes are almost identical, this is expected and designed 
to work this way, the difference is in the initializers and this is where 
I'm getting errors during rebinding. FactoryImpl2.Init1 is rebound first in 
Config1 permutation context and it fails inside my code. My point is, since 
FactoryImpl2 is never used in permutation 1, why is the compiler trying to 
rebind it in this permutation? Is there some problem in my gwt.xml or are 
the generators just not designed to do this? Or is it implemented in such a 
way that classes that are never used are ignored later by dead code 
elimination and I should just generate stub implementations and leave the 
rest to the compiler. I could always compile both configurations separately 
and use custom bootstrap to load the proper module/permutation.

I would expect the initializers to look something like this:

//Config1
public class FactoryImpl_Init1Impl implements FactoryImpl.Init1 {
  public void init(SomeObj o) {
o.setSomething(1);
  }
}

//Config2
public class FactoryImpl2_Init1Impl2 implements FactoryImpl2.Init1 {
  public void init(SomeObj o) {
o.setSomething(2);
  }
}


Any help/clarification would be much appreciated!

Honza

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Supporting deprecated/unknown browsers

2014-06-12 Thread Honza Rames
Hi everyone,
recently I was asked to support older browsers (namely Opera 12.17). Opera 
permutations have been disabled for quite some time (I'm using trunk build 
of GWT) and for unknown browsers the user.agent selection script just 
returns "unknown" which makes the module fail to load. Since we're talking 
Opera here I thought "Hey! It should mostly work with safari or gecko 
permutations right?". I dug a little deeper in how the selection works and 
ended up modifying UserAgentPropertyGenerator. But modifying stock GWT one 
(I just placed my new implementation in my project's class path, you don't 
need to recompile GWT to make it work) has a downside since the 
UserAgentAsserter stops working and I wanted to use it to show some message 
to the user about unsupported browser. This is because UserAgent class that 
is responsible for the values being compared is generated by the very same 
UserAgentPropertyGenerator. After a while I figured I could replace the 
generator only for the selection script by modifying my gwt.xml file. So I 
ended up with something like this:







With this approach you don't need to copy any GWT internals (which I think 
is way better).

My questions are, did someone tried to use something similar? What approach 
did you take? Are there some problems with this one?

GWT provides property error function callback, it would be great if this 
function could be used to return a fallback value. Are these callback 
something that is likely to change or is it something that can be used in 
production? The documentation on this is pretty bad though :-(.

Honza

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.

2014-06-12 Thread Honza Rames
One more thing to note. On 64-bit systems you need to create a key 
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Prefs. I didn't even have 
to change any permissions to make the message go away, just create the key.

Honza

On Sunday, June 8, 2014 11:30:33 PM UTC+2, Mark Vlcek wrote:
>
> Thanks everyone, just encountered this same problem and this solved my 
> issue as well!
>
> On Saturday, June 15, 2013 1:01:22 PM UTC-7, John V Denley wrote:
>>
>> Just had the same problem myself, and found that to fix it I had to do 
>> what you suggested, but I also had to manually create a "Prefs" key under 
>> JavaSoft too, as mentioned here:
>> http://www-01.ibm.com/support/docview.wss?uid=swg21496098
>>
>> On Friday, 14 June 2013 02:02:26 UTC+1, QingFeng Du wrote:
>>>
>>> well well, 4 years later, I came across the same problem.
>>> here's my solution:
>>> open regedit.exe ( really hate Microsoft and their regedit.reg).
>>> change the permission of key: 
>>> HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft.Right click the icon, then change 
>>> the permission to full operation.
>>>
>>> On Saturday, June 27, 2009 3:03:20 PM UTC-4, Farinha wrote:

 The subject has it all. 

 Eclipse 3.4.2 
 GWT Eclipse Plugin 
 Windows 7 

 Thanks in advance for the help. 

>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Running GWT compile manually from command line

2014-05-30 Thread Honza Rames
Hello,
in one of my projects I'm running GWT compilation from command line as part 
of my build process, I have several configurations and modules to limit the 
number of permutations during development. But when I build as draft with 
pretty style I only gen one permutation with pretty output the others are 
obfuscated. I'm running on multiple cores so I guess the main process 
outputs the pretty permutation while others produce obfuscated ones. Does 
anyone know how to solve this? I'm afraid other parameters of the 
compilation might not get passed to other workers as well. I'm using GET 
build from git master.

Command line:
java 
  -Xmx1024m
  -cp 
"proj\src;dependency\src;proj\war\WEB-INF\classes;dependency\war\WEB-INF\classes;GWT\gwt-dev.jar;
GWT\gwt-user.jar;GWT\validation-api-1.0.0.GA.jar;GWT
\validation-api-1.0.0.GA-sources.jar;lib\junit-4.9b2.jar
  com.google.gwt.dev.Compiler
  -localWorkers 8
  -logLevel INFO
  -draftCompile
  -ea
  -style PRETTY
  -gen gen-dir
  -war "proj\war"
  my.Module_draft

Regards

Honza R.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Phantom widget

2014-01-24 Thread Honza Rames
Hi,
actually I'm using something you may find useful. I have a UiBinder 
template that holds something I call actions. Actions hold some properties 
that may be shared by multiple other widgets (like caption, image, hint, 
etc.) and they can be translated which is why I wan to to have this in 
UiBinder XML and I also don't want to duplicate the definition for each 
widget that uses the same action. So i created an ActionList which is a 
panel-like widget implementing HasWidgets interface, but it only attaches 
hidden span to the Document's DOM, all the child Widgets (in this case 
Actions) just extend Widget class but don't create any elements and are 
never attached to DOM by the ActionList. But you cannot create just one 
widget, you need the outer container that will get attached otherwise you 
would get an exception.

Honza

On Thursday, January 23, 2014 7:24:04 PM UTC+1, Stephen Leung wrote:
>
> Hi GWT users,
>
> Is it possible to create a fake/phantom Widget/Element such that when it 
> is rendered no HTML code will be generated?
>
> Thanks,
> -Stephen
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Getting the Window, which opened my GWT module

2013-08-02 Thread Honza Rames
Hi,
GWT is injecting an iframe into your page and window points to this one. 
Inside JSNI methods you must use $wnd and $doc to access you page's 
window/document (see 
http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html).

Honza

On Friday, August 2, 2013 1:43:34 PM UTC+2, Old_Mortality wrote:
>
> Dear all,
>
>
> I have a GWT module, which is to be called from someone else's web page 
> (not GWT). Within my application, I have a button, and when the user 
> presses the button, I want a String to be passed back to the calling page, 
> and have this String inserted there into a textarea.
>
> I have tried getting the target text area like this, using JSNI in my GWT 
> program:
>
> window.opener.document.getElementById('fred');
>
>
> but window.opener is not set.
>
>
> Is what I am trying to do at all possible?
>
>
> Thank you for your attention.
>
>
>
> Michel
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Gwt Time picker widget

2013-06-19 Thread Honza Rames
Hi,
I'm using subclass of DateBox that has the popup calendar disabled. You 
have to input the time manually but the DateBox will validate it for you. 
You can also instantiate it with a custom Format to make it return null 
rather than throwing an exception if the time is invalid.

Regards

Honza

On Wednesday, June 19, 2013 8:53:39 AM UTC+2, kedar vyawahare wrote:
>
>
> Hi,
> I am looking for a widget in GWT that allows the user to choose a specific 
> time. I am using the GWT Date Picker to choose the date but I am not able 
> to find a suitable Time Picker. I have had a look at a couple of 
> suggestions  that emulate the jQuery Time Picker as well as GWT Incubator 
> Demo but none match my requirement. I am looking for a space-efficient 
> widget maybe like a textbox that allows to enter suitable time values.
> Thanks in advance
>
> -- 
>
> Thanks & regards ,
>
> Kedar  
>
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Best practices for inlining build (revision) number into GWT App?

2013-06-13 Thread Honza Rames
Hi Frank,

I have a XML (version.xml) document in my war directory:


]>

  76
  


A linker that increments the build number after the link process has been 
completed:

package my.pkg;

import com.google.gwt.core.ext.LinkerContext;
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.linker.AbstractLinker;
import com.google.gwt.core.ext.linker.ArtifactSet;
import com.google.gwt.core.ext.linker.LinkerOrder;
import com.google.gwt.core.ext.linker.LinkerOrder.Order;
import com.google.gwt.core.ext.linker.Shardable;

/**
 * Just a linker that will increment build after compilation is done
 * @author SHadoW
 *
 */
@LinkerOrder(Order.POST)
@Shardable
public class IncBuildLinker extends AbstractLinker
{
  private static boolean incremented = false;

  @Override
  public String getDescription()
  {
return "IncBuildLinker";
  }

  @Override
  public ArtifactSet link(TreeLogger logger, LinkerContext context,
  ArtifactSet artifacts, boolean onePermutation) throws 
UnableToCompleteException
  {
//Do this only once after the entire link process has completed
if (onePermutation && (! incremented)) 
{
  BuildHelper.incBuildAndSave(logger); //Do this only after all 
permutations has been compiled
  incremented = true;
}
return super.link(logger, context, artifacts);
  }
}

the BuildHelper class accesses the version.xml and I don't want to post it 
here because it is pretty straight forward but still a lot of code ;-). And 
the generator (it uses some of my classes that ease the code generation) 
which creates an implementation for BuildInfo interface that you 
instantiate with GWT.create(BuildInfo.class) which looks as follows:

package my.pkg;

import java.util.Date;

import com.google.gwt.dev.About;
import my.pkg.generators.BaseGenerator;
import my.pkg.generators.BaseGeneratorClient;

public class BuildGenerator extends BaseGenerator
{
  /* I'm using some helpers in generation process that's why I have the 
Client class here, it defines some functions that make it easier to 
generate java code in hand*/
  @Override
  protected BaseGeneratorClient getClient()
  {
return new Client();
  }
  class Client extends BaseGeneratorClient
  {
/* This gets called by the generator once the class imports and 
declaration is written by the generator */
@Override
protected void doGenerate()
{
  writeBlockIntro("public String getBuildDate()");
  writeReturn(STR, (new Date()).toString());
  writeBlockOutro();
  
  writeBlockIntro("public int getBuildNumber()");
  writeReturn(BuildHelper.getBuildNumber());
  writeBlockOutro();
  writeBlockIntro("public String getGwtSvnRev()");
  writeReturn(STR, About.getGwtSvnRev());  //This is saved during GWT 
build process and can only be accessed in plain java
  writeBlockOutro();
}
  }
}

and of course appropriately set module.gwt.xml that includes:





  


it is useful to have multiple modules that only one of them includes the 
linker so you only increment the build number after you compile for 
production so that development builds don't increment the build number.

Everybody else not interested in my solution sorry for the longish post, I 
din't see any other way how to do this. 
If anybody else need more explanation I could provide full source codes 
directly if needed, feel free to ask any questions ;-)

Honza

On Thursday, June 13, 2013 9:46:22 AM UTC+2, Frank Hossfeld wrote:
>
> Hi Honza,
>
> your implementation sounds intresting.
> Can you provide more informations about your solution?
>
> Thanks Frank
>  
> Am Mittwoch, 12. Juni 2013 09:50:41 UTC+2 schrieb Honza Rames:
>>
>> I have a XML file that stores various information about my build and is 
>> updated by a Linker which increments build number each build I make. And I 
>> have a generator that returns an interface that I can use in GWT app which 
>> includes the build number, revision, build date etc.
>>
>> Regards
>>
>> Honza
>>
>> On Tuesday, June 11, 2013 7:17:42 PM UTC+2, Joseph Lust wrote:
>>>
>>> For various reasons you need to know the revision of the GWT app code. 
>>> For example to verify that the server API is not newer than the JS code 
>>> (i.e. if you deploy GWT JS to a CDN).
>>>
>>> Some common approaches which I find to be rather hackish:
>>>
>>>- Use Maven replacer to replace a sequence in a *source* file at the 
>>>validation stage and have that inlined into your GWT file at compile 
>>>(hackish)
>>>- Use Maven replacer or Maven war plugin filters to add the build 
>>>number to the index.html page, or a backend service (JS code still not 

Re: Best practices for inlining build (revision) number into GWT App?

2013-06-12 Thread Honza Rames
I have a XML file that stores various information about my build and is 
updated by a Linker which increments build number each build I make. And I 
have a generator that returns an interface that I can use in GWT app which 
includes the build number, revision, build date etc.

Regards

Honza

On Tuesday, June 11, 2013 7:17:42 PM UTC+2, Joseph Lust wrote:
>
> For various reasons you need to know the revision of the GWT app code. For 
> example to verify that the server API is not newer than the JS code (i.e. 
> if you deploy GWT JS to a CDN).
>
> Some common approaches which I find to be rather hackish:
>
>- Use Maven replacer to replace a sequence in a *source* file at the 
>validation stage and have that inlined into your GWT file at compile 
>(hackish)
>- Use Maven replacer or Maven war plugin filters to add the build 
>number to the index.html page, or a backend service (JS code still not 
>independently versioned, more API calls)
>- Hardcode it (don't hardcode things)
>
> After two years, the best method I've see is to create a *code generator* to 
> allow deferred binding of the build number. This however has always stuck 
> me as massively overkill to add a number to a build artifact.
>
>
> So, I was curious how others here have dealt with this common issue. 
> Hopefully there is a simpler way.
>
>
> Sincerely,
> Joseph
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: IE9 problem with GWT

2013-05-21 Thread Honza Rames
If you display the message in DialogBox (or PopupPanel), are you displaying 
glass to darken the window? If so doesn't the glass overlap your message? 
It could be a problem of layouting, are you using multiple z-orders in your 
app? These issues should be easy to figure out in developer tools that are 
present in IE9.

Honza

On Tuesday, May 21, 2013 12:48:41 PM UTC+2, Mike wrote:
>
> GWT Release: 2.5.0
>
> Browser: IE9
> Our clients have a problem using our web application because, on IE9, when 
> the application shows a message (i.e., to confirm if a file is uploaded or 
> not), the focus
> remains behind the message shown and it is impossible to interact with the 
> message, so you can't close it and you can't work with the application either.
> It is not a problem of the application code, it is a problem of the version 9 
> of IE, it does not happen with IE 10.
> The message shown is modal.
>
> I know it is an alternative using Mozilla or Google Chrome, but our client is 
> a little bit special, so he does not want to use other web browsers.
>
> Any idea? Has this problem happened to someone else?
>
> P.D.: Sorry if there is any mistake in the grammar or in some word.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to add an icon to MenuItem?

2013-05-13 Thread Honza Rames
Yep, this is a nice way to do this as well but if you want to use UiBinder 
with  having the MenuItem subclassed is much more convenient 
because then I can set ImageResource directly from the ClientBundle.

On Monday, May 13, 2013 1:15:28 PM UTC+2, Andrea Boscolo wrote:
>
> You don't need to extend MenuItem. See 
> http://stackoverflow.com/questions/16399241/how-to-add-an-icon-to-a-menuitem-in-gwt
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to add an icon to MenuItem?

2013-05-13 Thread Honza Rames
Hi,
I came across the same problem, I had to create a subclass of MenuItem 
which sets MenuItem's setHTML and gives it a built up image + text HTML 
string. I used ClippedImageImpl to create the image HTML.

On Monday, May 6, 2013 3:38:38 PM UTC+2, membersound wrote:
>
> Hi,
>
> how can I get add an icon with text to a menu item in GWT? The following 
> does not work:
>
> 
>
> 
> 
>
> Resulting error:
> Not allowed in an HTML context: 
>
> So how can I have an icon in menuitem?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Slider for GWT?

2013-05-07 Thread Honza Rames
There is an Slider implementation in GWT incubator (
https://code.google.com/p/google-web-toolkit-incubator/wiki/SliderBar) 
which is now deprecated but can be used as a how-to. I've used this 
codebase and created an updated implementation that added mobile support 
and more. But is still pixel based and kind of slow to render (if you have 
a lot of them). But if you want I'll be happy to share ;-).

Honza

On Sunday, May 5, 2013 7:57:16 PM UTC+2, membersound wrote:
>
> Hi,
>
> maybe I'm missing it, but so far I could not found a Slider Widget (or 
> anything similar I could misuse therefore).
>
> Doesn't gwt provide a slider?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Emulated stack mode not resolving symbols

2013-05-06 Thread Honza Rames
Hi!

Using emulated stack traces won't deofuscate the callstack it just makes it 
available on more browsers (see 
https://code.google.com/p/google-web-toolkit/wiki/WebModeExceptions#Example_Production_Mode_stack_traces_without_emulation).
 
If you wan't to have readable callstack you need to deobfuscate it first. 
Thats where the source/symbol maps come into play. They are genereated 
during GWT compile and placed into 
war/WEB-INF/deploy/module_name/symbolMaps for each permutation. You can use 
StackTraceDebfuscator
 or 
your own implementation or you can also just do the text search in the 
symbol map file, this will point you to fully qualified name of the method. 
Another solution (which generates a lot bigger JS files) is to use pretty 
or detailed compile mode.

Honza

On Thursday, April 25, 2013 10:53:53 AM UTC+2, DaveC wrote:
>
> Hi,
>
> I'm trying to get some useful stack trace from the client side but all I 
> get is:
>
> java.lang.Throwable: Exception caught: Exception caught: For input string: 
> "59909596809"
> at Unknown.jk(Unknown Source)
> at Unknown.gi(Unknown Source)
> at Unknown.Wu(Unknown Source)
> at Unknown.Zu(Unknown Source)
> ... etc, etc.
>
> In the gwt.xml file I've got:
>
>  value="ENABLED" />
> 
>  name="compiler.emulatedStack.recordLineNumbers" value="true"/> 
>
> I've also got my own implementation of RemoteLoggingServiceImpl which sets 
> the location of the symbol maps directory to: 
>
>  /WEB-INF/debug/symbolMaps
>
> (In the index.html file I switch between the two stack modes using  name="gwt:property" content="compiler.stackMode=strip" />
>
> Can anyone see what I'm doing wrong?
>
> Cheers,
> Dave
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Determining if user is using a tablet

2013-04-30 Thread Honza Rames
Also you may consider 
using 
trunk\samples\mobilewebapp\src\main\java\com\google\gwt\sample\mobilewebapp\FormFactor.gwt.xml
 
from the official GWT svn. This example generates a property you can use in 
your gwt.xml to specify deferred binding rules. If you don't want to use 
deferred binding you may use PropertySource (
https://github.com/Legioth/PropertySource) project that will make the 
property available in your java code.

On Sunday, April 28, 2013 9:31:05 PM UTC+2, bvt wrote:
>
> Does anybody have any advice on how to determine whether somebody is using 
> a tablet to access my GWT application? If I understand 
> https://code.google.com/p/google-web-toolkit/issues/detail?id=4911 correctly, 
> it would appear that GWT 2.5.1 supports only CSS2 media queries, which 
> don't seem particularly useful in this regard. I'd like to adjust spacing 
> of items to make selection easier for tablet users, but compact items on 
> small screens.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Navigation in GWT

2013-04-23 Thread Honza Rames
Hi,
first you should define how your web application is layouted, are you using 
single-page with dynamically loaded/generated content (use GWT History 
mechanisms 
https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsHistory).
 
Or perhaps you are using multi-page layout and GWT as a supporting script 
same on all pages, then you should be fine with standard HTML way with a 
single module. Or you may have multiple pages with different behavior, then 
multiple modules may be a solution but it could generate a lot of shared 
code downloaded multiple times, I would suggest using some form of code 
splitting (
https://developers.google.com/web-toolkit/doc/latest/DevGuideCodeSplitting?hl=en),
 
each code fragment may be initialized based on URL or JS call directed to 
GWT through JSNI (
https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsJSNI?hl=en).
 
If you are just trying to open another page by script use 
http://google-web-toolkit.googlecode.com/svn/javadoc/2.5/com/google/gwt/user/client/Window.Location.html
 replace 
function.

Hope it helps and that I understood your problem.

On Tuesday, April 23, 2013 8:10:35 AM UTC+2, Raghu rao wrote:
>
> Hi,
>
> I am new to GWT and i want to know how to navigate from one page to 
> another page in GWT.Currently am trying in the below format.
>
> First Step :  Creating different .gwt module
> Second step : Creating html file and mentioning the id name.
> Third Step : Creating the Client java file and mentioning the id name(html 
> file id).
>
> am not getting any error in the server console and the new page is not 
> loading.. Pls suggest on this.if any body have a sample code pls share.
>
> thanks
> RaghuNandan
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: FormPanel.SubmitEvent cancel not working

2013-04-22 Thread Honza Rames
I tried this just out of curiosity last week and it worked (in FF I didn't 
test any other browsers). But since I'm using SuperDev mode this issue 
isn't a problem ;-)

On Thursday, April 18, 2013 11:13:25 AM UTC+2, Thomas Broyer wrote:
>
>
>
> On Thursday, April 18, 2013 9:30:51 AM UTC+2, Honza Rames wrote:
>>
>> A little out-of-time response but since this problem still exists in 2.5 
>> I think it's worth sharing another solution. 
>>
>> If you put "javascript:" into form's action attribute, nothing will 
>> happen even if the event is not canceled. I know this isn't helpful in 
>> cases where you need to validate the form, but in case you (like me) are 
>> preventing the form submit to send the data using GWT RPC instead of the 
>> POST to take advantage of the browser's password remembering feature (I'm 
>> wrapping FormPanel around already existing form) this is actually helpful.
>>
>
> Last time I tried, you had to let the submission go through, so you'd have 
> to use action="javascript:foo()" and expose a method as $wnd.foo via JSNI 
> where you'd do your RPC.
> That was 4 years ago though! 
> https://groups.google.com/d/topic/google-web-toolkit/KyzgtqqoJGE/discussion
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: IE10 support in Gwt

2013-04-22 Thread Honza Rames
It does but out of curiosity, if I add IE10 permutation/browser detection 
to UserAgent.gwt.xml to which value should I set the property-fallback? I 
mean is property fallback-recursive (I would assume it is) so setting it to 
IE9 should work? In case IE9 rule isn't specified it will recursively 
fallback to IE8 (and generate a compiler warning) right?

On Wednesday, April 17, 2013 12:40:04 AM UTC+2, Thomas Broyer wrote:
>
>
>
> On Tuesday, April 16, 2013 2:07:34 PM UTC+2, Mariusz Magdziarz wrote:
>>
>> When you add support for IE10??
>>
>
> AFAIK, IE10 works OK with the ie9 permutation.
> Vaadin has started working on bringing MSPointerEvents to support 
> touch-enabled (and touch-only) devices.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: FormPanel.SubmitEvent cancel not working

2013-04-18 Thread Honza Rames
A little out-of-time response but since this problem still exists in 2.5 I 
think it's worth sharing another solution. 

If you put "javascript:" into form's action attribute, nothing will happen 
even if the event is not canceled. I know this isn't helpful in cases where 
you need to validate the form, but in case you (like me) are preventing the 
form submit to send the data using GWT RPC instead of the POST to take 
advantage of the browser's password remembering feature (I'm wrapping 
FormPanel around already existing form) this is actually helpful.

On Saturday, January 29, 2011 8:03:18 PM UTC+1, balkanski wrote:
>
> I have just found the solution for GWT 2.1.1 version. Here it is: 
>
> First you do not use a 'SubmitButton' in your FormPanel, because it 
> turns out that it causes all the troubles. 
>
> Use a 'Button' instead and add a 'ClickHandler' to it, and call 
> 'your_form.submit()' inside the 'onClick()' method. 
>
> You will find that after using 'Button' instead of 'SubmitButton' all 
> the input fields in the form has lost their 
> initial 'submit on Enter' behavior, which was observed at the 
> beginning. 
>
> Now attach to every input field a 'onKeyDown' handler(if you want, of 
> course) and check the event's native key code upon 'ENTER', and if yes 
> - submit the form. 
>
> That is all, now the 'event.cancel()' part in the form's SubmitHandler 
> is perfectly working. 
>
>
> On Jan 5, 10:27 pm, Greg Dougherty  wrote: 
> > I have the following code in a GWT 2.1.0 project: 
> > 
> > public void onSubmit (FormPanel.SubmitEvent event) 
> > { 
> > // This event is fired just before the form is submitted. We can 
> take 
> > // this opportunity to perform validation. 
> > String filename = gDataFileUploader.getFilename (); 
> > if (filename.length () == 0) 
> > { 
> > showAlert ("Need a valid File Name in before we can 
> upload a 
> > file!"); 
> > event.cancel (); 
> > } 
> > 
> > } 
> > 
> > Unfortunately, although it is called, the cancel () call doesn't stop 
> > the submit from happening, and doesn't stop onSubmitComplete from 
> > being called.  Is this a GWT bug or a browser bug?  (FireFox 3.6) 
> > 
> > TIA, 
> > 
> > Greg

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to change the locale at runtime

2013-03-20 Thread Honza Rames
Hi, you can't do it in runtime since each locale will produce different 
permutations, but what you can do is set the locale parameter of the URL. 
You can use UrlBuilder like this:

UrlBuilder url = Window.Location.createUrlBuilder();
url.setParameter("locale", locale);
Window.Location.replace(url.buildString());

If you need true runtime switching you will need to implement more complex 
approach.

On Monday, March 18, 2013 9:53:31 AM UTC+1, sahli@gmail.com wrote:
>
> Hi, i'm beginner in gwt, how can i  change the locale language at runtime 
> like the 
> http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwCheckBox, 
>
> thank you, 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: GWT client side Java object serialization

2012-10-23 Thread Honza Rames
Hi, I've created a project for my own needs called GWT RTTI (
http://code.google.com/p/gwt-rtti/) it generates reflection information for 
certain packages at compile time using generators and lets you use it on 
the client (it is similar to JAVA reflection API with few differences). But 
bare in mind that it adds additional code to your application thus making 
it more complex and larger. There is one advantage, I've created it in a 
way that it can be used on both sides client and server. It doesn't contain 
serialization mechanisms but you can create one on you own, if you do it 
carefuly you can share serialization code on the server and on the client 
(probably using JSONObject). If your objects are comlex POJOs in lists you 
should be able to create the parser pretty easily ;-).

Honza

Dne čtvrtek, 18. října 2012 23:04:00 UTC+2 dhoffer napsal(a):
>
> I have some rather complex data objects that currently get marshaled from 
> client to server and server to client (comet communication).  Btw, not 
> complex in quantity of data, or data relationships, but data is arrays of 
> lots of different derived interface/class types.  The data used to be just 
> serialized but now it needs to be sent via JSON.
>
> Is it possible to perform regular Java object serialization in the GWT 
> client?  If so, I could solve this by converting that binary output into 
> Base64 encoded string and send that via the new JSON API and then just 
> reverse that on the server.  Is it even possible to do this in GWT?
>
> Of course the other approach is to convert the Java object into a full 
> JSON object but given it's complexity I haven't found a way to do that yet 
> (I posted separate newsgroup message on that approach).  Either approach 
> would be fine for me, I can worry about performance differences later.
>
> -Dave
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/XYHYpPMnsWQJ.
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: Localize String array

2012-09-26 Thread Honza Rames
Hi,
I think you could use plural forms to do that (see GWT documentation on 
i18n). I'm using a bit simpler way:
public interfce MyMessage extends Messages
{
  MyMessages INST = GWT.create(MyMessages.class);
  String[] TEXTS = {INST.text1(), INST.text2()};
  String tetx1();
  String text2();
}
Hope it helps.

Honza

Dne pátek, 21. září 2012 16:02:45 UTC+2 Willy napsal(a):
>
> Hi all,
> I'm quite new to GWT world and I've some issues.
> In this post I ask for help with localization.
> I've used an interface that extends Messages, like that:
> ...
>
>> public interface MyMessages extends Messages {
>> String text1();
>> String text2();
>> String text3();
>> }
>>
> ...
>
> and so far works all properly.
>
> Problems born when I try to localize an array of strings like that:
>
> static String[] status = 
>> { 
>> "READY",
>> "UNREADY"
>> }
>>
>
> that I use in this way:
>
> btn.setText(status[0]);
>
>
> There is a standard way to localize an array strings?
>
> Thanks a lot,
> willy 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/bB8FC3eqxUsJ.
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.



Source maps

2012-04-01 Thread Honza Rames
Hi everyone,
I tried to compile my GWT app with source maps support (as explained here 
http://stackoverflow.com/questions/9804492/how-to-try-sourcemaps-with-gwt) 
and it failed at first (some json stuff was missing) so I added it to my 
project's class path then it compiled OK and I can see the source maps 
generated in WEB-INF/deploy//symbolMaps. I should also note 
that I'm using custom build of GWT from trunk. I enabled source maps 
support in Chrome's Developer tools setting panel but I the source maps 
doesn't seem to work. I'm launching the app through jetty but not in dev 
mode (obviously ;-) ) I compiled the project in obfuscated mode as standard 
compile (no draft or anything like that). Do I have to use another version 
of Chrome? Does anyone tried this as well and succeeded?

Honza

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/cM5XpVMqf68J.
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: Adding new emulated methods/classes

2012-03-06 Thread Honza Rames
Hello again,
I was trying to make this work but my understanding of the GWT compiler is 
really limited. The patch in the issue you suggested really does something 
else than just modify the emulation for Class (I just overlooked it in the 
patch file since there are so many changes in the comments), but the way 
getName worked was overhauled in r5479 (so even changes made in r5226, and 
reverted in r5229, won't help me a lot) since code that implemented getName 
was removed from GenerateJavaAST (and I couldn't find the way it was 
replaced in r5479)  GenerateJavaAST.java was later removed in r10490. So 
back to my question above, how are the emulation classes implemented? Or is 
there some guidelines for modifying/adding emulation classes?

Thanks

Honza

Dne středa, 22. února 2012 17:05:19 UTC+1 Honza Rames napsal(a):
>
> Oops, I was to fast to post the question before I saw there are no 
> real changes in GenerateJavaAST.java. So my previous question doesn't 
> make much sense... 
>
> On 22 ún, 17:02, Honza Rames  wrote: 
> > Thanks I'll look into it. Just curious, what are the files in /user/ 
> > super/com/google/gwt/emul/java/lang/ used for, it seems that emulation 
> > can be done by modifying some of them but Class looks like to be an 
> > exception? 
> > 
> > On 21 ún, 15:29, Thomas Broyer  wrote: 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > Seehttp://code.google.com/p/google-web-toolkit/issues/detail?id=3404


Dne středa, 22. února 2012 17:05:19 UTC+1 Honza Rames napsal(a):
>
> Oops, I was to fast to post the question before I saw there are no 
> real changes in GenerateJavaAST.java. So my previous question doesn't 
> make much sense... 
>
> On 22 ún, 17:02, Honza Rames  wrote: 
> > Thanks I'll look into it. Just curious, what are the files in /user/ 
> > super/com/google/gwt/emul/java/lang/ used for, it seems that emulation 
> > can be done by modifying some of them but Class looks like to be an 
> > exception? 
> > 
> > On 21 ún, 15:29, Thomas Broyer  wrote: 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > Seehttp://code.google.com/p/google-web-toolkit/issues/detail?id=3404

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/tbH9SXCUwFcJ.
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: Adding new emulated methods/classes

2012-02-22 Thread Honza Rames
Oops, I was to fast to post the question before I saw there are no
real changes in GenerateJavaAST.java. So my previous question doesn't
make much sense...

On 22 ún, 17:02, Honza Rames  wrote:
> Thanks I'll look into it. Just curious, what are the files in /user/
> super/com/google/gwt/emul/java/lang/ used for, it seems that emulation
> can be done by modifying some of them but Class looks like to be an
> exception?
>
> On 21 ún, 15:29, Thomas Broyer  wrote:
>
>
>
>
>
>
>
> > Seehttp://code.google.com/p/google-web-toolkit/issues/detail?id=3404

-- 
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: Adding new emulated methods/classes

2012-02-22 Thread Honza Rames
Thanks I'll look into it. Just curious, what are the files in /user/
super/com/google/gwt/emul/java/lang/ used for, it seems that emulation
can be done by modifying some of them but Class looks like to be an
exception?

On 21 ún, 15:29, Thomas Broyer  wrote:
> Seehttp://code.google.com/p/google-web-toolkit/issues/detail?id=3404

-- 
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.



Adding new emulated methods/classes

2012-02-21 Thread Honza Rames
Hi everyone,
I'm merging some JAVA code with my GWT application which needs
Class.getSimpleName, since I'm already using own build of GWT trunk I
added getSimpleName to /user/super/com/google/gwt/emul/java/lang/
Class.java and built GWT but this doesn't work. I tried to search
other code modification in GWT's SVN history and I didn't find much
difference when they're making the changes to emulation classes so I
don't know what I'm doing wrong.

Any help leading to the solution would be much appreciated.

Cheers

Honza

-- 
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: Reflection && Class Generator

2011-06-07 Thread Honza Rames
Ok, a little bit of delay but finally I managed to create the project
here: http://code.google.com/p/gwt-rtti/

--
Honza Rames

On 2 čvn, 15:35, Honza Rames  wrote:
> OK, I'm making some preparations to release it on Google Code. I'll
> post all the info there (I mean what it can
>  and cannot do and why some things are little bit different from java
> reflection API). Hopefully I'll manage to do this during the
> weekend...
>
> --
> Honza Rames
>
> On 2 čvn, 13:07, Nagin Kothari  wrote:
>
>
>
>
>
>
>
> > I am very interessed on it. May you send the project to do a look to the
> > code?
>
> > regards
>
> > Nagin Kothari
>
> > On Wed, Jun 1, 2011 at 8:10 PM, Honza Rames  wrote:
> > > Hi, from what I can tell GWT doesn't support reflection at all in
> > > client side (JS translatable) code. Just a few simple features like
> > > getting class name (but I can't really call that reflection can
> > > I ;-) ). I have been experimenting with reflection in client side code
> > > though, and with a lot of success I must say :-). I'm planning to
> > > share the code on Google Code when I feel its ready, I'm currently
> > > testing it on business application I'm working on and then we'll see.
> > > If you (or anybody else) would like to give it a try, I might be able
> > > to create some package and share this with you (or maybe create the
> > > Google Code project right away). There is similar framework (don't
> > > remember the name but can be found by Google ;-) ), which didn't
> > > really didn't do the job for me because it was pretty difficult to
> > > generate the reflection information that is needed (please correct me
> > > if I got that wrong). My approach uses GWT generators and annotations
> > > to specify which packages and which classes should participate in
> > > reflection information generation. I'm supporting similar
> > > functionality that java Class gives you with some modifications, but
> > > you can obtain annotations, get/set fields and even call public
> > > methods and create new instance in reflective way (but you need to be
> > > careful on what info you add because it could greatly enlarge your
> > > resulting JS code). I also have unit tests (of course) for bunch of
> > > stuff but it would require a lot of cleanup I guess.
>
> > > So if anyone is interested just leave a message ;-)
>
> > > --
> > > Honza Rames
>
> > > On 31 kvě, 16:20, Adolfo Panizo Touzon 
> > > wrote:
> > > > Can somebody the function about de class Generator and all the similar
> > > > classes which is contained int he packpage "com.google.gwt.core.ext",
> > > it´s
> > > > used for deferred binding?
>
> > > > Maybe if I want use reflection in my app, I must use these classes??
>
> > > > --
> > > > El precio es lo que pagas. El valor es lo que recibes.
> > > > Warren Buffet
>
> > > --
> > > 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.

-- 
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: Reflection && Class Generator

2011-06-02 Thread Honza Rames
OK, I'm making some preparations to release it on Google Code. I'll
post all the info there (I mean what it can
 and cannot do and why some things are little bit different from java
reflection API). Hopefully I'll manage to do this during the
weekend...

--
Honza Rames

On 2 čvn, 13:07, Nagin Kothari  wrote:
> I am very interessed on it. May you send the project to do a look to the
> code?
>
> regards
>
> Nagin Kothari
>
>
>
>
>
>
>
> On Wed, Jun 1, 2011 at 8:10 PM, Honza Rames  wrote:
> > Hi, from what I can tell GWT doesn't support reflection at all in
> > client side (JS translatable) code. Just a few simple features like
> > getting class name (but I can't really call that reflection can
> > I ;-) ). I have been experimenting with reflection in client side code
> > though, and with a lot of success I must say :-). I'm planning to
> > share the code on Google Code when I feel its ready, I'm currently
> > testing it on business application I'm working on and then we'll see.
> > If you (or anybody else) would like to give it a try, I might be able
> > to create some package and share this with you (or maybe create the
> > Google Code project right away). There is similar framework (don't
> > remember the name but can be found by Google ;-) ), which didn't
> > really didn't do the job for me because it was pretty difficult to
> > generate the reflection information that is needed (please correct me
> > if I got that wrong). My approach uses GWT generators and annotations
> > to specify which packages and which classes should participate in
> > reflection information generation. I'm supporting similar
> > functionality that java Class gives you with some modifications, but
> > you can obtain annotations, get/set fields and even call public
> > methods and create new instance in reflective way (but you need to be
> > careful on what info you add because it could greatly enlarge your
> > resulting JS code). I also have unit tests (of course) for bunch of
> > stuff but it would require a lot of cleanup I guess.
>
> > So if anyone is interested just leave a message ;-)
>
> > --
> > Honza Rames
>
> > On 31 kvě, 16:20, Adolfo Panizo Touzon 
> > wrote:
> > > Can somebody the function about de class Generator and all the similar
> > > classes which is contained int he packpage "com.google.gwt.core.ext",
> > it´s
> > > used for deferred binding?
>
> > > Maybe if I want use reflection in my app, I must use these classes??
>
> > > --
> > > El precio es lo que pagas. El valor es lo que recibes.
> > > Warren Buffet
>
> > --
> > 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.

-- 
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: Reflection && Class Generator

2011-06-01 Thread Honza Rames
Hi, from what I can tell GWT doesn't support reflection at all in
client side (JS translatable) code. Just a few simple features like
getting class name (but I can't really call that reflection can
I ;-) ). I have been experimenting with reflection in client side code
though, and with a lot of success I must say :-). I'm planning to
share the code on Google Code when I feel its ready, I'm currently
testing it on business application I'm working on and then we'll see.
If you (or anybody else) would like to give it a try, I might be able
to create some package and share this with you (or maybe create the
Google Code project right away). There is similar framework (don't
remember the name but can be found by Google ;-) ), which didn't
really didn't do the job for me because it was pretty difficult to
generate the reflection information that is needed (please correct me
if I got that wrong). My approach uses GWT generators and annotations
to specify which packages and which classes should participate in
reflection information generation. I'm supporting similar
functionality that java Class gives you with some modifications, but
you can obtain annotations, get/set fields and even call public
methods and create new instance in reflective way (but you need to be
careful on what info you add because it could greatly enlarge your
resulting JS code). I also have unit tests (of course) for bunch of
stuff but it would require a lot of cleanup I guess.

So if anyone is interested just leave a message ;-)

--
Honza Rames

On 31 kvě, 16:20, Adolfo Panizo Touzon 
wrote:
> Can somebody the function about de class Generator and all the similar
> classes which is contained int he packpage "com.google.gwt.core.ext", it´s
> used for deferred binding?
>
> Maybe if I want use reflection in my app, I must use these classes??
>
> --
> El precio es lo que pagas. El valor es lo que recibes.
> Warren Buffet

-- 
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.



FormPanel.onSubmit not canceled

2010-02-24 Thread Honza Rames
Hi everyone!

First of all, this is not the issue with hidden iframe not assigned to
a form.

I have two similar forms in my GWT app. Both of them cancel the submit
in onSubmit handler but one of them works (meaning the form isn't
sent) but the other one doesn't. I think it a browser error because I
tried to step through the code after GWT compiler produces the
resulting JS code and I modified hookEvents to show me the result
passed to form.onsubmit like this:
form.onsubmit = $entry(function(){
iframe && (iframe.__formAction = form.action);
var __res = listener.onFormSubmit();
alert(__res);
return __res;
  }
__res indeed is false but the form is sent regardless of it.

It looks like its a problem in Firefox (3.6), Chrome works just fine.

I fixed this by assigning dummy action that loads empty file.

Did anyone came ocross this problem as well? Do you have any other
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-tool...@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: Developing a plugin based application

2009-12-22 Thread Honza Rames
Hi,
I recently had very similar problem. I have an app in which there are
Views (similar to your layers) and I wanted views to be completely
independent of the App (before I made the changes the App's class was
responsible for creating Views which I found very sloppy). I did
pretty much the same thing that Eric has proposed. The App's class has
a static list of Initializers which implement Initializer interface
which have two methods, first creates associated View's instance and
second adds itself into the App's list of Initializers so the App only
goes through the array and calls newInstance of each initializer. The
initializers implements EntryPoint so I can specify which Views to
create simply by adding a module to my gwt.xml or by adding more
EntryPoints to it. I don't know if this is right method to implement
this but I'm using it together with code splitting and everything
seems fine (View's code and App's code are put in deferedjs and only
very small portion of code is executed in JS after the app startup
which speeds the initial loading time). After calling GWT.runAsync the
App properly initializes all registered views.

Honza

On Dec 19, 9:10 am, Marco Visonà  wrote:
> Hi Eric
>     thank to your advice I found a partial solution. I have an
> interface Layer implemented by each layer and I created this layer
> factory:
>
> public class LayerFactory {
>
>         public enum LayerType {
>                 SENSORS_LAYER, TEST_LAYER
>         }
>
>         public Layer newInstance(LayerType type) {
>                 switch (type) {
>                 case SENSORS_LAYER:
>                         return new SensorsLayer(lm, mapAttrs);
>                 case TEST_LAYER:
>                         return new TestLayer(lm, mapAttrs);
>                 default:
>                         return null;
>                 }
>         }
>
> }
>
> so in my code I can iterate through each element in the enum to
> instantiate the layers.
>
> for(LayerType type : LayerType.values()) {
>         lFactory.newInstance(type);
>
> }
>
> However this is not your solution. You told about creating a wrapper
> class (let's say to call it LayerWrapper) implementing an interface
> containing a newInstance method, and putting each layer class inside
> the corresponding layer. So let's say to have the wrapper array you
> told about in your previous post:
> LayerWrapper[] layersWrap = new LayerWrapper[2]
>
> then I would cycle through the elements, but how can I instantiate the
> correct layer? I don't think that the following would be the correct
> procedure:
>
> for(int i=0; i < layersWrap.length; i++) {
>   layersWrap[i]= LayerWrapper.newInstance()
>
> }
>
> because how can the call to the method LayerWrapper.newInstance()
> understand which is the correct implementation to call?
>
> Thank for your help, I owe you a beer :)
> Bye
>
> Marco
>
> On 16 Dic, 23:45, Marco Visonà  wrote:
>
>
>
> > Hi Eric
>
> > thanks for your immediate response.
> > I figured out your technique. I'll try to apply your suggetions
> > tomorrow.
>
> > Bye
> > Marco
>
> > On 16 Dic, 22:51, Eric Ayers  wrote:
>
> > > Hi Marco,
>
> > > You don't want deferred binding in this case.  Deferred binding is for the
> > > case where you want to choose from only one of several options to be 
> > > present
> > > at run time (like what language or browser-type).
>
> > > Just pretend like this is a plain Java App and you are constrained from
> > > using reflection.  You probably want to do something clever like create an
> > > object that wraps the class to be instantiated and includes an interface 
> > > to
> > > a factory that returns layer instances.  Fill an array with these 
> > > wrappers,
> > > pass it into your code, then at the appropriate time the code can iterate
> > > through the array and invoke the factory method on each one.
>
> > > On Wed, Dec 16, 2009 at 4:09 PM, Marco Visonà  wrote:
> > > > I'll try to be a bit more clear.
> > > > I have an abstract class called Layer an a set of classes that inherit
> > > > from it. There is a method in my code where i declare new instances of
> > > > my layer in a manner like the following:
> > > > new SensorsLayer(param1, param2);
> > > > new TestLayer(param1,param2,param3)
>
> > > > and so on (both the classes inherit from Layer). Each layer basically
> > > > fills a panel with specific widgets and event handlers.
> > > > In this situation somebody that develops a new layer subclass has to
> > > > instantiate it in the same point of the application, but that position
> > > > is supposed to be a "core" position of my application, so I would like
> > > > other programmers wouldn't put their hands on it.
>
> > > > So let's say I had an array containing the class names of the layers
> > > > (that I could read from whatever source).If there were some technique
> > > > to call the right constructor for each layer basing on the class name,
> > > > I would be done, because the instantiation could be executed through
> >