Re: SuperDevMode Running With GWT 2.6.1 (ant/Command Line)

2015-04-20 Thread James Bearden
No, I didn't run accross that nugget and I wish I had. The biggest issues I 
had were A) coming up with an ant target to run CodeServer and B) figuring 
out these basic concepts:

 * SuperDevMode completely replaces DevMode.
 * Unlike DevMode, SuperDevMode has nothing to do with actually 
launching/running your application.
 * There is nothing special you need to do when launching your application 
(seperately).

That last bit had me baffled the longest because with my setup I had to use 
a URL different from the default to get DevMode working, and that took me a 
while to figure out at the time. So with SuperDevMode it took me a LONG 
time to try just running my server and pointing my web browser at it 
without any funky parameters like you do with DevMode.

James

On Sunday, April 19, 2015 at 3:31:53 AM UTC-5, Thomas Broyer wrote:

 Did you stumble on https://stackoverflow.com/a/18333050/116472 during 
 your research? If you did, was there something missing there?
 I might create a new question on SO and copy/paste that answer as a 
 community wiki; or maybe copy/paste that to my blog, to make it easier to 
 find (given that it's not the accepted answer for that question)

 On Sunday, April 19, 2015 at 2:55:35 AM UTC+2, James Bearden wrote:

 Hello,

 I upgraded from GWT 2.6.1 to GWT 2.7 and immediately starting getting 
 reports of my app not launching after being loaded. I was unable to 
 reproduce the issue, so I went back to using GWT 2.6.1 for now. I will try 
 again with 2.7.1 maybe. However, in the mean time, I got REALLY attached to 
 SuperDevMode, or rather not having to manage stale and a fresh versions of 
 my browser. So I really wanted to get SuperDevMode working with GWT 2.6.1. 
 Unfortunately I seem to be one of the few people that prefer not use an IDE 
 to develop, so most of the examples of how to do what I want have been less 
 than helpful. To make things even more interesting, I am using JSON to talk 
 to a Perl server instead of the standard server. I just got it working, so 
 I wanted to share the wealth.

 First edit your project.gwt.xml file and add:

   add-linker name=xsiframe/

 Second, edit your build.xml file and add something like:

   target name=sdm depends=javac description=starts the 
 superdevmode
 java fork=true failonerror=true 
 classname=com.google.gwt.dev.codeserver.CodeServer
   classpath
 pathelement location=src/
 path refid=project.class.path/
 pathelement location=${gwt.sdk}/gwt-codeserver.jar/
 pathelement location=${gwt.sdk}/validation-api-1.0.0.GA.jar /
 pathelement 
 location=${gwt.sdk}/validation-api-1.0.0.GA-sources.jar /
   /classpath
   arg value=-src/
   arg value=${basedir}/src/
   arg value=com.myproject.Project/
 /java
   /target

 Third, assuming everything works right, when you ant the sdm target it 
 will provide a URL. If you go to that URL it will give you a bookmarkable 
 URL to start SuperDevMode and another one to stop it. Yes, you really need 
 to at least add the Dev Mode On bookmark. After you do that then you can 
 close the tab and probably never visit it again.

 Fourth, and this was the hardest part for me to figure out from the 
 information given, is you need to go to the same base URL to run your 
 application that regular DevMode uses. In other words, omit the gwt.codesvr 
 parameter.  In my case that is http://localhost:3000/app/index.htm;, 
 but it will definitely be different for you unless you are running a 
 development Mojolicious server. Your app should load, and then you click 
 your Dev Mode On bookmark to recompile and reload. It's a little clunky 
 having to click the button to recompile, but it's a whole lot better than 
 running an old version of a browser.

 James



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


SuperDevMode Running With GWT 2.6.1 (ant/Command Line)

2015-04-18 Thread James Bearden
Hello,

I upgraded from GWT 2.6.1 to GWT 2.7 and immediately starting getting 
reports of my app not launching after being loaded. I was unable to 
reproduce the issue, so I went back to using GWT 2.6.1 for now. I will try 
again with 2.7.1 maybe. However, in the mean time, I got REALLY attached to 
SuperDevMode, or rather not having to manage stale and a fresh versions of 
my browser. So I really wanted to get SuperDevMode working with GWT 2.6.1. 
Unfortunately I seem to be one of the few people that prefer not use an IDE 
to develop, so most of the examples of how to do what I want have been less 
than helpful. To make things even more interesting, I am using JSON to talk 
to a Perl server instead of the standard server. I just got it working, so 
I wanted to share the wealth.

First edit your project.gwt.xml file and add:

  add-linker name=xsiframe/

Second, edit your build.xml file and add something like:

  target name=sdm depends=javac description=starts the superdevmode
java fork=true failonerror=true 
classname=com.google.gwt.dev.codeserver.CodeServer
  classpath
pathelement location=src/
path refid=project.class.path/
pathelement location=${gwt.sdk}/gwt-codeserver.jar/
pathelement location=${gwt.sdk}/validation-api-1.0.0.GA.jar /
pathelement 
location=${gwt.sdk}/validation-api-1.0.0.GA-sources.jar /
  /classpath
  arg value=-src/
  arg value=${basedir}/src/
  arg value=com.myproject.Project/
/java
  /target

Third, assuming everything works right, when you ant the sdm target it will 
provide a URL. If you go to that URL it will give you a bookmarkable URL to 
start SuperDevMode and another one to stop it. Yes, you really need to at 
least add the Dev Mode On bookmark. After you do that then you can close 
the tab and probably never visit it again.

Fourth, and this was the hardest part for me to figure out from the 
information given, is you need to go to the same base URL to run your 
application that regular DevMode uses. In other words, omit the gwt.codesvr 
parameter.  In my case that is http://localhost:3000/app/index.htm;, but 
it will definitely be different for you unless you are running a 
development Mojolicious server. Your app should load, and then you click 
your Dev Mode On bookmark to recompile and reload. It's a little clunky 
having to click the button to recompile, but it's a whole lot better than 
running an old version of a browser.

James

-- 
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: GWT 2.70 and emulated compiler stack mode

2015-02-28 Thread James Bearden
Whoops, to be clear, it was working up to and including GWT 2.6.1, but has 
stopped working in GWT 2.7.0.

James

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


GWT 2.70 and emulated compiler stack mode

2015-02-26 Thread James Bearden
Hello,

My client application talks via JSON to a non-Java based server, and up 
until GWT 2.6.1 I was using the emulated compiler stack mode feature to 
generate a stack trace when the client had an exception and then submitted 
it via a JSON request to be logged on the server. Thankfully it doesn't 
happen very often, but when it does it is incredibly useful to have that 
stack trace. Unfortunately that feature doesn't appear to be working with 
GWT 2.7.1. Can anybody offer any advice as to how I can get it working, or 
what a viable alternative might be?


In my gwt.xml I had the following:

  set-property name=compiler.stackMode value=emulated /
  set-configuration-property 
name=compiler.emulatedStack.recordLineNumbers value=true/
  set-configuration-property name=compiler.emulatedStack.recordFileNames 
value=true/


TIA,

James

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


GWT 2.7 Window Close Handle Bug?

2015-02-24 Thread James Bearden
Hello,

Since I upgraded to GWT 2.7 my window close handler has stopped working. 
Before I submitted a bug report I wanted to see if anybody else was having 
this issue and to verify that nothing has changed and I was still doing it 
right. My code is:


import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.logical.shared.CloseEvent;
import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.user.client.Window;

public class MyClass implements EntryPoint {
  public void onModuleLoad() {
 
  Session session = new Session();

 ...

   Window.addWindowClosingHandler(new Window.ClosingHandler() {
@Override public void onWindowClosing(Window.ClosingEvent event) {
  session.reset();
}
  });

Window.addCloseHandler(new CloseHandlerWindow() {
@Override public void onClose(CloseEventWindow event) {
  session.reset();
}
  });
}

I have tried and failed to do the above using JSNI, so bonus points if 
anybody can give me an example on how to do it that way as a backup. I 
REALLY need to get this working again because the users never use the 
logout button and close the browser instead. If I can't resolve the issue 
soon I'm going to have to downgrade to GWT 2.6.

James

-- 
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: canvas toDataUrl() works in mouse event but not in touch event

2013-11-16 Thread James Bearden
Thank you for the reply, but I don't quite follow. That bug seems to refer 
to toDataURL not working at all for certain Android versions, but that 
isn't the issue I have. My issue is that it works sometimes (in a mouse 
event) but not others (in a touch event).

On Friday, November 15, 2013 12:58:41 PM UTC-6, Jim Douglas wrote:

 https://code.google.com/p/android/issues/detail?id=7901

 On Friday, November 15, 2013 9:36:21 AM UTC-8, James Bearden wrote:

 Hello,

 I have implemented a signature widget using the GWT 2.5 Canvas. It works 
 great on the desktop (mouse event), but not on a tablet (touch event). 
 Unfortunately the only table I have available for testing is an Android 
 2.3.4 tablet. 



-- 
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: canvas toDataUrl() works in mouse event but not in touch event

2013-11-16 Thread James Bearden
OK, I rolled the code out to production and borrowed a newer android phone 
and it works like a champ. Go team. I still don't understand why, but oh 
well.

James

On Saturday, November 16, 2013 10:45:58 AM UTC-6, James Bearden wrote:

 Thank you for the reply, but I don't quite follow. That bug seems to refer 
 to toDataURL not working at all for certain Android versions, but that 
 isn't the issue I have. My issue is that it works sometimes (in a mouse 
 event) but not others (in a touch event).

 On Friday, November 15, 2013 12:58:41 PM UTC-6, Jim Douglas wrote:

 https://code.google.com/p/android/issues/detail?id=7901

 On Friday, November 15, 2013 9:36:21 AM UTC-8, James Bearden wrote:

 Hello,

 I have implemented a signature widget using the GWT 2.5 Canvas. It works 
 great on the desktop (mouse event), but not on a tablet (touch event). 
 Unfortunately the only table I have available for testing is an Android 
 2.3.4 tablet. 



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


canvas toDataUrl() works in mouse event but not in touch event

2013-11-15 Thread James Bearden
Hello,

I have implemented a signature widget using the GWT 2.5 Canvas. It works 
great on the desktop (mouse event), but not on a tablet (touch event). 
Unfortunately the only table I have available for testing is an Android 
2.3.4 tablet. So here is my code snippet:

  _canvas.setTabIndex(tabIndex);
  _canvas.addStyleName(neoheader);
  _canvas.setSize(width + px, height + px);
  _canvas.setCoordinateSpaceHeight(height);
  _canvas.setCoordinateSpaceWidth(width);

  final Context2d context = _canvas.getContext2d();
  context.setLineWidth(2);
  context.setStrokeStyle(CssColor.make(0,0,0));

  _canvas.addMouseMoveHandler(new MouseMoveHandler() {
  public void onMouseMove(MouseMoveEvent event) {
if (_drawing) {
  int thisX = event.getRelativeX(_canvas.getElement());
  int thisY = event.getRelativeY(_canvas.getElement());
  if (_lastX = 0  _lastY = 0) {
_exists = true;
context.beginPath();
context.moveTo(_lastX, _lastY);
context.lineTo(thisX, thisY);
context.stroke();
  }
  _lastX = thisX;
  _lastY = thisY;
}
  }
});
  _canvas.addMouseDownHandler(new MouseDownHandler() {
  public void onMouseDown(MouseDownEvent event) { _drawing = true; }
});
  _canvas.addMouseOutHandler(new MouseOutHandler() {
  public void onMouseOut(MouseOutEvent event) { 
_lastX = -1;
_lastY = -1;
_drawing = false; 
_canvas.setFocus(false);
if (_exists) _handler.sigChanged(_canvas.toDataUrl());
  }
});
  _canvas.addMouseUpHandler(new MouseUpHandler() {
  public void onMouseUp(MouseUpEvent event) { 
_lastX = -1;
_lastY = -1;
_drawing = false; 
_canvas.setFocus(false);
if (_exists) _handler.sigChanged(_canvas.toDataUrl());
  }
});
  
  _canvas.addTouchMoveHandler(new TouchMoveHandler() {
  public void onTouchMove(TouchMoveEvent event) {
if (event.getTouches().length()  0) {
  Touch touch = event.getTouches().get(0);
  int thisX = touch.getRelativeX(_canvas.getElement());
  int thisY = touch.getRelativeY(_canvas.getElement());
  if (_lastX = 0  _lastY = 0) {
_exists = true;
context.beginPath();
context.moveTo(_lastX, _lastY);
context.lineTo(thisX, thisY);
context.stroke();
  }
  _lastX = thisX;
  _lastY = thisY;
}
event.preventDefault();
event.stopPropagation();
  }
});
  
  _canvas.addTouchStartHandler(new TouchStartHandler() {
  public void onTouchStart(TouchStartEvent event) { 
event.preventDefault();
  }
});
  
  _canvas.addTouchEndHandler(new TouchEndHandler() {
  public void onTouchEnd(TouchEndEvent event) {
if (_exists) {
  _lastX = -1;
  _lastY = -1;
  _canvas.setFocus(false);
  _handler.sigChanged(_canvas.toDataUrl());
  com.google.gwt.user.client.Window.alert(onTouchEnd:  + 
_canvas.toDataUrl());
}
event.preventDefault();
  }
});

As I said it works flawlessly in a desktop web browser using mouse events, 
but on the tablet _canvas.toDataUrl() always returns data:, even though 
the canvas has been visibly drawn on. Any help would be greatly appreciated.

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