Re: UiBinder + CssResource + @ClassName = Error

2015-08-17 Thread DaveC
I get the same error if I use {style.defaultStyle}. Could you clarify 
why {style.panel-default} is not a valid value?

Thanks.

On Saturday, 15 August 2015 20:37:57 UTC+1, Thomas Broyer wrote:

 Have you tried using {style.defaultStyle} in your attribute? 
 {style.panel-default} is not a valid value AFAICT, but maybe it'd be 
 detected only later (and is hidden by the current error)

 On Wednesday, August 5, 2015 at 11:28:37 AM UTC+2, DaveC wrote:

 Hi,

 I have the following UiBinder:

 !DOCTYPE ui:UiBinder SYSTEM http://dl.google.com/gwt/DTD/xhtml.ent;
 ui:UiBinder xmlns:ui=urn:ui:com.google.gwt.uibinder xmlns:g=
 urn:import:com.google.gwt.user.client.ui
 ui:style type=com.saaconsultants.gwt.ui.test.client.Main.Style
 .panel-default {
 background: grey;
 }
 /ui:style
 g:HTMLPanel addStyleNames={style.panel-default}Hello World!
 /g:HTMLPanel
 /ui:UiBinder 

 and CssResource:

 public interface Style extends CssResource {
  @ClassName(panel-default)
  String defaultStyle();
 }

 When I compile the above code I get an error stating The following 
 obfuscated style classes were missing from the source CSS 
 file: panel-default: Fix by adding .panel-default{}.

 Any idea 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.
For more options, visit https://groups.google.com/d/optout.


UiBinder + CssResource + @ClassName = Error

2015-08-05 Thread DaveC
Hi,

I have the following UiBinder:

!DOCTYPE ui:UiBinder SYSTEM http://dl.google.com/gwt/DTD/xhtml.ent;
ui:UiBinder xmlns:ui=urn:ui:com.google.gwt.uibinder xmlns:g=
urn:import:com.google.gwt.user.client.ui
ui:style type=com.saaconsultants.gwt.ui.test.client.Main.Style
.panel-default {
background: grey;
}
/ui:style
g:HTMLPanel addStyleNames={style.panel-default}Hello World!
/g:HTMLPanel
/ui:UiBinder 

and CssResource:

public interface Style extends CssResource {
 @ClassName(panel-default)
 String defaultStyle();
}

When I compile the above code I get an error stating The following 
obfuscated style classes were missing from the source CSS 
file: panel-default: Fix by adding .panel-default{}.

Any idea 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.
For more options, visit https://groups.google.com/d/optout.


Re: CellTable Memory Leak in IE8

2015-08-05 Thread DaveC
No worries, glad it worked! ;)

I've not personally committed any code to the core gwt project but you can 
find out more here 
http://www.gwtproject.org/makinggwtbetter.html#contributingcode

Bear in mind that GWT 3.0 is going to be a very different animal (for 
instance, from what I understand there will be no widgets or gwt-rpc...), 
so perhaps there isn't such a need to get these things fixed... I might be 
wrong though.

Cheers,
Dave

On Wednesday, 5 August 2015 13:24:27 UTC+1, Harvard Pan wrote:

 Dave,

 Thank you SO much for this. I tested this using my test project and it 
 seems to have solved the memory leak completely! I've attached my version 
 of the file (modified from 2.5.1-rc1 branch) with your changes.

 What's the best way to get this fix to the GWT code base so that future 
 versions of GWT will have this fix as well? I'd previously logged Issue 
 #9164 (https://github.com/gwtproject/gwt/issues/9164) on the gwtproject 
 page.

 Thanks again!
 Harvard

 On Tuesday, August 4, 2015 at 7:11:24 AM UTC-4, DaveC wrote:

 Hi,

 I think you'll have to dig into AbstractCellTable in order to fix this. I 
 did a quick test of a fix I implemented and it appears to work for IE11 
 running IE8/IE9 mode but not IE10 mode, I've not tested it in a real IE8 or 
 IE9.

 Basically what I did was exaactly what you said - set row.innerHTML to 
 null.

 I took a copy of AbstractCellTable (including the package structure) and 
 placed it in my test project. In the ImplTrident inner class I've tweaked 
 the methods replaceTableSection and replaceAllRowsImplLegacy to set the 
 innerHTML to null for each row e.g. 

 *private native final void setRowInnerHtmlToNull(Element row)/*-{*
 *row.innerHTML = null;*
 *}-*/;*

 private void replaceTableSection.

  TableElement tableElement = table.getElement().cast();
   
 *  Element child = section.getFirstChildElement();*
 *  while (child != null) {*
 *setRowInnerHtmlToNull(child);*
 *child = child.getNextSiblingElement();*
 *  }*
   
   tableElement.replaceChild(newSection, section);

 .}

  protected void replaceAllRowsImplLegacy(AbstractCellTable? table, 
 TableSectionElement section,
 SafeHtml html) {
   // Remove all children.
   Element child = section.getFirstChildElement();
   while (child != null) {
 Element next = child.getNextSiblingElement();
 section.removeChild(child);
 *setRowInnerHtmlToNull(child);*
 child = next;
   }

 }

 Hope this helps.

 Cheers,
 Dave

 On Thursday, 23 July 2015 22:05:10 UTC+1, Harvard Pan wrote:

 Hello,

 Our company uses GWT 2.5.1-rc1 and many of our customers (healthcare) 
 use IE8. We were hopeful that the memory leak in CellTable would have been 
 addressed by the memory leak fix for FlexTable. That leak (Issue 6938 - 
 https://code.google.com/p/google-web-toolkit/issues/detail?id=6938) was 
 fixed in 2.6. After grabbing the fix and merging it into the 2.5.1-rc1 
 code, we can confirm that FlexTable indeed is fixed and no longer leaking. 
 However, we still have leaking resources in CellTable. I've written a small 
 sample application to demonstrate the code that leaks. It's available on 
 BitBucket for anyone to pull.


 https://bitbucket.org/harvardpan/celltableleak/src/3eb0d9941df6fe40b4b09eef0ce1968c6db90da3/src/com/healthfortis/sample/celltableleak/client/CellTableLeak.java?at=master

 The root cause of 6938 was described in a Microsoft Connect page: 
 http://connect.microsoft.com/IE/feedback/details/790340/memory-leak-in-ie9-ie10-tables
 In it, it describes multiple reasons for the leak, including:

- rows with ids
- cells with ids
- code that references a row.cells expression, even if it does not 
store or use the result (that's the fix in 6938)
- code that does not set row.innerHTML to null after invoking 
table.deleteRow() for the row.

 I imagine that the CellTable leak is related to one of the conditions 
 above. I suspect the last one as I never do actually see any setting to 
 null of innerHTML in the javascript. Wanted to check in to see if anyone on 
 this forum had any ideas on where we could investigate next.

 Thanks!
 Harvard



-- 
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: CellTable Memory Leak in IE8

2015-08-04 Thread DaveC
Hi,

I think you'll have to dig into AbstractCellTable in order to fix this. I 
did a quick test of a fix I implemented and it appears to work for IE11 
running IE8/IE9 mode but not IE10 mode, I've not tested it in a real IE8 or 
IE9.

Basically what I did was exaactly what you said - set row.innerHTML to null.

I took a copy of AbstractCellTable (including the package structure) and 
placed it in my test project. In the ImplTrident inner class I've tweaked 
the methods replaceTableSection and replaceAllRowsImplLegacy to set the 
innerHTML to null for each row e.g. 

*private native final void setRowInnerHtmlToNull(Element row)/*-{*
*row.innerHTML = null;*
*}-*/;*

private void replaceTableSection.

 TableElement tableElement = table.getElement().cast();
  
*  Element child = section.getFirstChildElement();*
*  while (child != null) {*
*setRowInnerHtmlToNull(child);*
*child = child.getNextSiblingElement();*
*  }*
  
  tableElement.replaceChild(newSection, section);

.}

 protected void replaceAllRowsImplLegacy(AbstractCellTable? table, 
TableSectionElement section,
SafeHtml html) {
  // Remove all children.
  Element child = section.getFirstChildElement();
  while (child != null) {
Element next = child.getNextSiblingElement();
section.removeChild(child);
*setRowInnerHtmlToNull(child);*
child = next;
  }

}

Hope this helps.

Cheers,
Dave

On Thursday, 23 July 2015 22:05:10 UTC+1, Harvard Pan wrote:

 Hello,

 Our company uses GWT 2.5.1-rc1 and many of our customers (healthcare) use 
 IE8. We were hopeful that the memory leak in CellTable would have been 
 addressed by the memory leak fix for FlexTable. That leak (Issue 6938 - 
 https://code.google.com/p/google-web-toolkit/issues/detail?id=6938) was 
 fixed in 2.6. After grabbing the fix and merging it into the 2.5.1-rc1 
 code, we can confirm that FlexTable indeed is fixed and no longer leaking. 
 However, we still have leaking resources in CellTable. I've written a small 
 sample application to demonstrate the code that leaks. It's available on 
 BitBucket for anyone to pull.


 https://bitbucket.org/harvardpan/celltableleak/src/3eb0d9941df6fe40b4b09eef0ce1968c6db90da3/src/com/healthfortis/sample/celltableleak/client/CellTableLeak.java?at=master

 The root cause of 6938 was described in a Microsoft Connect page: 
 http://connect.microsoft.com/IE/feedback/details/790340/memory-leak-in-ie9-ie10-tables
 In it, it describes multiple reasons for the leak, including:

- rows with ids
- cells with ids
- code that references a row.cells expression, even if it does not 
store or use the result (that's the fix in 6938)
- code that does not set row.innerHTML to null after invoking 
table.deleteRow() for the row.

 I imagine that the CellTable leak is related to one of the conditions 
 above. I suspect the last one as I never do actually see any setting to 
 null of innerHTML in the javascript. Wanted to check in to see if anyone on 
 this forum had any ideas on where we could investigate next.

 Thanks!
 Harvard


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


Compiler throws StringIndexOutOfBoundsException when parsing ui:style

2015-08-04 Thread DaveC
Hi,

I've a ui:style with a CSS class that has double hyphens in it (the CSS 
follows the BEM https://css-tricks.com/bem-101/pattern) e.g.

!DOCTYPE ui:UiBinder SYSTEM http://dl.google.com/gwt/DTD/xhtml.ent;
ui:UiBinder xmlns:ui=urn:ui:com.google.gwt.uibinder xmlns:g=
urn:import:com.google.gwt.user.client.ui
ui:style

  .panel--default {
  background: grey;
  }

/ui:style

g:HTMLPanel addStyleNames={style.panel--default}Hello World!
/g:HTMLPanel
/ui:UiBinder 

When the compiler runs it throws a StringIndexOutOfBoundsException:

java.lang.StringIndexOutOfBoundsException: String index out of range: 1
at java.lang.String.substring(String.java:1907)
at com.google.gwt.uibinder.attributeparsers.CssNameConverter.convertName
(CssNameConverter.java:46)
at com.google.gwt.uibinder.attributeparsers.FieldReferenceConverter.
expandDots(FieldReferenceConverter.java:205)
at com.google.gwt.uibinder.attributeparsers.FieldReferenceConverter.
convert(FieldReferenceConverter.java:191)
at com.google.gwt.uibinder.attributeparsers.StringAttributeParser.parse(
StringAttributeParser.java:59)...

(Also the Eclipse plugin throws the same error when trying to save the 
UiBinder file - I'm not sure if it shares the same code as I couldn't find 
the source code for the plugin).

I think there's a couple of issues here:

1. The CssNameConverter.convertName() method should handle double hyphens - 
using a StringTokenizer (or similar) would fix this problem
2. A valid CSS identifier 
http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier is not a valid 
Java identifier 
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html IMHO 
UiBinder and the Eclipse plugin should cope with this.

(Incidentally I don't get this error when using ClientBundle/CssResource 
but then I'll have to expose all the CSS through the CssResource.)

I'm not sure if the CssNameConverter is the correct place to be validating 
CSS class names - I don't know enough about GWTs internals or anything 
about the Eclipse plugin to suggest where it should go. Also I think 
issues/errors with CSS should be highlighted by the plugin (in the IDE) and 
not later at compile time.

I think it would also be useful if the documentation made it clear what 
is/isn't supported - it's important to remember that not everyone 
developing for a GWT project comes from a Java background.

I'm more than willing to get my hands dirty (submitting patches, updating 
documentation) but it's not something I've done for the main GWT project.

I've not raised a bug yet as docs said to post here first.

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.
For more options, visit https://groups.google.com/d/optout.


Re: Emulated stack mode not resolving symbols

2013-05-01 Thread DaveC
Anyone

On Thursday, 25 April 2013 09:53:53 UTC+1, 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:

 set-property name=gwt.logging.simpleRemoteHandler 
 value=ENABLED /
 set-property name=compiler.stackMode value=strip,emulated /
 set-configuration-property 
 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 meta 
 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.




Emulated stack mode not resolving symbols

2013-04-25 Thread DaveC
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:

set-property name=gwt.logging.simpleRemoteHandler 
value=ENABLED /
set-property name=compiler.stackMode value=strip,emulated /
set-configuration-property 
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 meta 
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: IE + SSL + Image.setURL throws an Operation Exception at runtime

2011-09-20 Thread DaveC
There was also another runtime Exception being thrown - this time the
culprit was the iFrame for GWT History (the exception was thrown at
the point the iframe's document was being accessed)... it was unused
and removing it fixed the problem.

I find it hard to believe that no one else has seen this error???

Anyone?

On Sep 19, 11:53 am, DaveC david.andrew.chap...@gmail.com wrote:
 I think this maybe be a bug with GWT (but I'm not sure).

 I'm running my app under https/ssl, in IE (7  8) I get an Operation
 Exception (Network Error) if I set a previsouly created Image
 widget's url to an unsecured url (which causes IE to popup a dialog
 asking the user for permission).

 The following code causes an exception to be thrown (using HTTPS/SSL
 self signed certs):

 public class TestingDeferImageLoad implements EntryPoint {

     public void onModuleLoad() {

         final Image image = new Image();
         RootPanel.get().add(image);

         Timer deferImageLoad = new Timer() {

             @Override
             public void run() {
                 try {
                     image.setUrl(http://www.google.co.uk/logos/2011/
 Albert_Szent_Gyorgyi-2011-hp.jpg);
                 } catch(Exception e) {
                     Window.alert(e.getLocalizedMessage());
                }
             }

         };

         deferImageLoad.schedule(1000);
     }

 }

 Without SSL everything works fine. Obviously I can catch/handle the
 exception but should I have to? - It was a pain to track down.

 Note: I've mirrored the same code in vanilla Javascript without the
 Exception being thrown.

 Although it's a bit of an edge case, has anyone else come accross this
 problem? Should I file a bug??

 Cheers,
 Dave

-- 
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: IE + SSL + Image.setURL throws an Operation Exception at runtime

2011-09-20 Thread DaveC
There was also another runtime Exception being thrown - this time the
culprit was the iFrame for GWT History (the exception was thrown at
the point the iframe's document was being accessed)... it was unused
and removing it fixed the problem.

I find it hard to believe that no one else has seen this error???

Anyone?

On Sep 19, 3:46 pm, DaveC david.andrew.chap...@gmail.com wrote:
 I think this maybe be a bug with GWT (but I'm not sure).

 I'm running my app under https/ssl, in IE (7  8) I get an Operation
 Exception (Network Error) if I set a previously created Image
 widget's url to an unsecured url (which causes IE to popup a dialog
 asking the user for permission).

 The following code causes an exception to be thrown (using HTTPS/SSL
 self signed certs):

 public class TestingDeferImageLoad implements EntryPoint {

     public void onModuleLoad() {

         final Image image = new Image();
         RootPanel.get().add(image);

         Timer deferImageLoad = new Timer() {

             @Override
             public void run() {

                 try {
                     image.setUrl(http://www.google.co.uk/logos/2011/
 Albert_Szent_Gyorgyi-2011-hp.jpg);
                 } catch(Exception e) {
                     Window.alert(e.getLocalizedMessage());
                }

             }
         };

         deferImageLoad.schedule(1000);
     }

 }

 Without SSL everything works fine. Obviously I can catch/handle the
 exception but should I have to? - It was a pain to track down.

 Note: I've mirrored the same code in vanilla Javascript without the
 Exception being thrown.

 Although it's a bit of an edge case, has anyone else come accross this
 problem? Should I file a bug??

 Cheers,
 Dave

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


[gwt-contrib] Re: IE + SSL + Image.setURL throws an Operation Exception at runtime

2011-09-20 Thread DaveC
Thanks for the replies John  Jens,

The app can run in http/https, the user can then configure the app to
consume various resources, for example rss feeds, web services - in
this instance the feed resources contained images which were then
loaded over http.

The issue was/is that IE throws a javascript network error when the
image has it's url set - this is only reproducible in IE + GWT + SSL -
mimicking the GWT code in vanilla Javascript + IE +SSL doesn't throw
any errors, so I don't *think* it's a certificate/ssl/browser thing.

Your right we should be using history management - but the inclusion
of an iframe shouldn't cause a runtime error. Again this only occurs
in IE + GWT + SSL.

Cheers,
Dave

On Sep 20, 2:26 pm, Jens jens.nehlme...@gmail.com wrote:
 I think its a mixed-mode content problem (HTTPS for app and HTTP for your
 requested image). I can't see the issue in our app which uses HTTPS for both
 the app and all resources (to avoid the mixed-mode warning of browsers).

 -- J.

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


IE + SSL + Image.setURL throws an Operation Exception at runtime

2011-09-19 Thread DaveC
I think this maybe be a bug with GWT (but I'm not sure).

I'm running my app under https/ssl, in IE (7  8) I get an Operation
Exception (Network Error) if I set a previsouly created Image
widget's url to an unsecured url (which causes IE to popup a dialog
asking the user for permission).

The following code causes an exception to be thrown (using HTTPS/SSL
self signed certs):

public class TestingDeferImageLoad implements EntryPoint {

public void onModuleLoad() {

final Image image = new Image();
RootPanel.get().add(image);

Timer deferImageLoad = new Timer() {

@Override
public void run() {
try {
image.setUrl(http://www.google.co.uk/logos/2011/
Albert_Szent_Gyorgyi-2011-hp.jpg);
} catch(Exception e) {
Window.alert(e.getLocalizedMessage());
   }
}

};

deferImageLoad.schedule(1000);
}

}

Without SSL everything works fine. Obviously I can catch/handle the
exception but should I have to? - It was a pain to track down.

Note: I've mirrored the same code in vanilla Javascript without the
Exception being thrown.

Although it's a bit of an edge case, has anyone else come accross this
problem? Should I file a bug??

Cheers,
Dave

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



IE + SSL + Image.setURL throws an Operation Exception at runtime

2011-09-19 Thread DaveC
I think this maybe be a bug with GWT (but I'm not sure).

I'm running my app under https/ssl, in IE (7  8) I get an Operation
Exception (Network Error) if I set a previsouly created Image
widget's url to an unsecured url (which causes IE to popup a dialog
asking the user for permission).

The following code causes an exception to be thrown (using HTTPS/SSL
self signed certs):

public class TestingDeferImageLoad implements EntryPoint {

public void onModuleLoad() {

final Image image = new Image();
RootPanel.get().add(image);

Timer deferImageLoad = new Timer() {

@Override
public void run() {
try {
image.setUrl(http://www.google.co.uk/logos/2011/
Albert_Szent_Gyorgyi-2011-hp.jpg);
} catch(Exception e) {
Window.alert(e.getLocalizedMessage());
   }
}

};

deferImageLoad.schedule(1000);
}

}

Without SSL everything works fine. Obviously I can catch/handle the
exception but should I have to? - It was a pain to track down.

Note: I've mirrored the same code in vanilla Javascript without the
Exception being thrown.

Although it's a bit of an edge case, has anyone else come accross this
problem? Should I file a bug??

Cheers,
Dave

-- 
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] IE + SSL + Image.setURL throws an Operation Exception at runtime

2011-09-19 Thread DaveC
I think this maybe be a bug with GWT (but I'm not sure).

I'm running my app under https/ssl, in IE (7  8) I get an Operation
Exception (Network Error) if I set a previously created Image
widget's url to an unsecured url (which causes IE to popup a dialog
asking the user for permission).

The following code causes an exception to be thrown (using HTTPS/SSL
self signed certs):

public class TestingDeferImageLoad implements EntryPoint {

public void onModuleLoad() {

final Image image = new Image();
RootPanel.get().add(image);

Timer deferImageLoad = new Timer() {

@Override
public void run() {

try {
image.setUrl(http://www.google.co.uk/logos/2011/
Albert_Szent_Gyorgyi-2011-hp.jpg);
} catch(Exception e) {
Window.alert(e.getLocalizedMessage());
   }

}
};

deferImageLoad.schedule(1000);
}

}

Without SSL everything works fine. Obviously I can catch/handle the
exception but should I have to? - It was a pain to track down.

Note: I've mirrored the same code in vanilla Javascript without the
Exception being thrown.

Although it's a bit of an edge case, has anyone else come accross this
problem? Should I file a bug??

Cheers,
Dave

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


Re: Activities and Places and Layouts (again)

2011-08-17 Thread DaveC
No worries :o)

On Aug 15, 7:10 pm, Mike Dee mdichiapp...@gmail.com wrote:
 Dave,

 I think you got it.  Double checked and wasn't setting height to
 100%.  Thanks, that seems to have done it.  Thought I was doing that.

 Mike

 On Aug 15, 9:01 am, DaveC david.andrew.chap...@gmail.com wrote:



  Hi Mike,

  I'm trying to understand your issue...

  I'm assuming that DockLayoutPanel is in an Activity and that you're
  adding it to the SimplePanel using panel.setWidget() in the start
  method...? (I don't want to teach you to suck eggs - but you can use
  Firebug (or similar) to check the DOM of your page and make sure the
  DockLayoutPanel is actually being added).

  If so, it sounds like you just need to force the DockLayoutPanel to be
  100% the height of it's container:

  dlp.setHeight(100%);

  If not I can give you a basic structure that at least works for me...

  Cheers,
  Dave

  On Aug 15, 3:51 pm, Mike Dee mdichiapp...@gmail.com wrote:

   I replaced RootPanel with RootLayoutPanel.

   Here is the EntryPoint from HelloMVP:

    private SimplePanel appWidget = new SimplePanel();
    ...
    RootPanel.get().add( appWidget );
    activityManager.setDisplay( appWidget );

   I replaced RootPanel with RootLayoutPanel:

    private SimplePanel appWidget = new SimplePanel();
    ...
    RootLayoutPanel.get().add( appWidget );
    activityManager.setDisplay( appWidget );

   Maybe I'm a little too naive in thinking that would do much.

   Also, when I look at the page source generated, it appears a DOCTYPE
   is already there.  Here is the page source generated by the GWT app
   (HelloMVP).

    !doctype html
    !-- The DOCTYPE declaration above will set the    --
    !-- browser's rendering engine into               --
    !-- Standards Mode. Replacing this declaration  --
    !-- with a Quirks Mode doctype may lead to some --
    !-- differences in layout.                        --

   If I create a simple GWT app (not Activities  Places) and plop a
   DockLayoutPanel in the RootPanel, it just works.  Fills the page
   nicely without having to add any onResize handlers.  Is there a reason
   why adding handlers would be needed in an Activities  Places
   framework (such as that provided by HelloMVP)?  I'd like to understand
   that a bit more.

   On Aug 15, 4:44 am, P.G.Taboada pgtabo...@googlemail.com wrote:

You need rootlayoutpanel, the host page should be in standards mode
( see doctype declaration).

Then you should look if all the panels being used implement provides
resize/ requires resize. That is the way resize events get propagated
to child elements in gwt.

On Aug 15, 8:00 am, Mike Dee mdichiapp...@gmail.com wrote:

 Getting started with Activities and Places.  I'd like to use a
 DockLayoutPanel to comprise the entire view (page).  When I try, it
 doesn't work.

 Note I'm using HelloMVP is a starting point and that in the EntryPoint
 a SimplePanel is set up as the default Panel.  I've tried adding a
 DockLayoutPanel to that.  I also tried first adding a VerticalPanel
 and then a DockLayoutPanel based on some suggestions here.

 The DockLayoutPanel simply doesn't display.  This was also mentioned
 in this message from last Oct:http://tinyurl.com/3z8mn4v.  The
 resolution there was to adjust the positioning styles to be absolute.
 However, they appear to already be absolute.

 I've played around with setting the width and height of the parent
 (SimplePanel) panel to 100%.  I've changed RootPanel to
 RootLayoutPanel in onLoadModule.  Nothing seems to work.  Seems like
 this would be something that is commonly done OR am I heading down the
 wrong path?

 Any ideas?
 Mike

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



Best/Correct way to attach events to an element

2011-08-15 Thread DaveC
Hi,

I've got some generated HTML that I'm trying to hook into using GWT to
listen to events. At the moment I've this:

public class LightWeightUiObject extends UIObject {

public LightWeightUiObject(Element element) {

setElement(element);

sinkEvents(Event.ONTOUCHSTART);
sinkEvents(Event.ONTOUCHMOVE);
sinkEvents(Event.ONTOUCHEND);
}

}

Is this the best/correct way of doing this?
(What I'm trying to do is avoid using Widgets as this dramtically
increases the size of my compiled app)

Cheers,
Dave

-- 
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: ClickHandlers and Anchors?

2011-06-03 Thread DaveC
if (event.getSource() instanceof Anchor) {
...
}

Cheers,
Dave


On Jun 3, 1:17 pm, kevin kalo...@gmail.com wrote:
 I have a Anchor as a cell of a FlexTable. Both the Anchor and the
 FlexTable have click handlers and as a result, I'm getting two events
 fired when I click on the anchor. Any one have an idea how to detect
 that the FlexTable event is actually a click on the anchor?

-- 
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: combine GWT application from several modules coming from JARs or OSGI bundles

2011-06-03 Thread DaveC
If you mean dynamically loading code at runtime, I don't *think* this
is possible - we have a similar app (written originally against GWT
1.6) we have the notion of a plugin - it's a separate GWT module in
it's own project, but is pulled in at compile time... these modules
are pulled in using Gin/Guice so adding another plugin is as simple as
pulling it in using DI... I didn't write this bit but I think thats
how it works.

On Jun 3, 2:06 am, Juan Pablo Gardella gardellajuanpa...@gmail.com
wrote:
 +1 to who know a manner to resolve this

 2011/6/2 Alexey Skor als...@gmail.com



  I need a web UI with pages like Info, Support, etc. That's easy.
  In addition, I have some plugins  with their own editors, which need to
  be shown in the same web UI.
  It's something similar to Extensions page shown in Google Chrome: every
  extension has an Options link, which can contain any editor the extension
  wants.

  So, my main application does not know upfront how many plugins and
  editors it has. All it  knows is how to call the plugin's showEditor()
  method.
  (this is how it's currently implemented in my Eclipse-based desktop app,
  which I'm trying to port to web)

  I'm wondering if GWT is applicable for this kind of applications. So far
  looks that GWT applications are monolithic and all pages / panels need to
  be referenced in the common gwt.xml file, which means I can't configure
  the distributive to include only plugin1 and plugin2 or only plugin 2 and
  plugin 3 - I have to always include everything since it's referenced in the
  common xml file.

  Any ideas how to use modularity with GWT so that UI panels can come from
  some modules/plugins?

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



@Import CssResource not working (as expected?)

2011-06-03 Thread DaveC
Hi,

Given:

@ImportedWithPrefix(unordered)
interface UnorderedListStyles extends CssResource {
 list();
}

@ImportedWithPrefix(list)
interface ListItemStyles extends CssResource {
 item();
}

interface Resources extends ClientBundle {

  @Import(value = {UnorderedListStyles.class, ListItemStyles.class})
  @Source(project.css)
  CssResource styles();

  interface Styles extends CssResource {
   widget();
  }

 }

/// project.css

.widget .unordered-list {
background:red;
}

.widget .unordered-list .list-item {
color:green;
}

/

The above styles don't get applied. What am I doing wrong?

Cheers,
Dave

-- 
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: Odg.: Re: How to speed up Hosted mode

2011-04-19 Thread DaveC
I've also noticed that moving from a GWT 1.7 version of building apps
to the 2.1 way (UiBinder CellWidgets etc) makes a noticable
difference... (less java/ecmascript code I guess).

On Apr 18, 9:24 pm, Jeff Larsen larse...@gmail.com wrote:
 Lotus notes ouch!

-- 
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: Odg.: Re: How to speed up Hosted mode

2011-04-18 Thread DaveC
I might be on the wrong track but have you checked the temp directory
where java writes out files (on windows xp it's something like c:/
documents and settings//*user*/localsettings) I regularly (once a
week) have to clear tens of thousands of files and GBs of data
otherwise eclipse (and lotus notes) comes to a crawl...

On Apr 18, 3:51 pm, mike b mbaker.t...@gmail.com wrote:
 I just remembered one other major difference between my environment and my
 coworker's...  I downloaded the gwt 2.2 code branch from google and compiled
 it with only ie6 and gecko1_8 enabled. (see UserAgent.gwt.xml in
 gwt-user.jar)

 Maybe async will help you compile only what has changed, rather than
 everythying?  This conversation just went out of my (so seamingly small)
 realm of knowledge!!!

 Good luck,
 Mike

-- 
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: ListEditor is there a way to edit a generic type?

2010-12-09 Thread DaveC
Thanks for the reply rjcarr but, perhaps I didn't ask the right
question... given the following ListEditor bits:

interface ListEditorDriver extends
SimpleBeanEditorDriverListAbstractAnimal,
ListEditorAbstractAnimal, AbstractAnimalkEditor {}

private ListEditorAbstractAnimal, AbstractAnimalEditor editor =
ListEditor.of(new AbstractAnimalSource());

private ListEditorDriver driver = GWT.ListEditorDriver
create(ListEditorDriver.class);


class AbstractAnimalSource extends EditorSourceAbstractAnimalEditor
{

public AbstractAnimalSource() {}

@Override
public AbstractAnimalEditor create(int index) {
AbstractAnimalEditor abstractAnimalEditor = new
AbstractAnimalEditor();

container.insert(abstractAnimalEditor , index);

return abstractAnimalEditor ;
}

@Override
public void dispose(AbstractAnimalEditor subEditor) {
 subEditor.removeFromParent();
}

@Override
public void setIndex(AbstractAnimalEditor editor, int index) {
  container.insert(editor, index);
}

}



class AbstractAnimalEditor extends Composite implements
EditorAbstractAnimal {

TextBox name;

public AbstractAnimalEditor() {
FlowPanel fp = new FlowPanel();
initWidget(fp);

InlineLabel nameLabel = new InlineLabel(Name: );
fp.add(nameLabel);

name = new TextBox();
fp.add(name);
}

}

Is there any way I can tell the Editor Framework that my
AbstractAnimal is either a Bird, Mammal, Fish etc...?

The Editor Framework does all the widget instantiation and setting/
getting of values there doesn't appear to be a point where I can say
If the type is Bird use the BirdEditor, if the type is Fish use the
FishEditor...

Cheers,
Dave

On Dec 9, 7:41 am, rjcarr rjc...@gmail.com wrote:
 Is this a GWT question?  It sounds like a generic polymorphism
 question.

 If the latter, you have two options.  Either add wing span information
 to the parent type (Animal) or do explicit checks for Birds and then
 do a cast.

 Good luck!

 On Dec 8, 9:11 am, DaveC david.andrew.chap...@gmail.com wrote:



  Hi,

  What I'm trying to do is pass ListEditor a list of generic types e.g.
  an AbstractAnimal type but what the list gets might be a Bird type, a
  Fish type, Mammal... etc...

  The problem is that that my Bird type has a property wingSpan which
  the Fish type does not.. they might also share a property e.g. name
  or canFly.

  The Editor complains that it couldn't find a getter for canFly in
  proxy type ...AbstractAnimal.

  Is there any way around this?

  Thanks for you help in advance.

  Cheers,
  Dave

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



ListEditor is there a way to edit a generic type?

2010-12-08 Thread DaveC
Hi,

What I'm trying to do is pass ListEditor a list of generic types e.g.
an AbstractAnimal type but what the list gets might be a Bird type, a
Fish type, Mammal... etc...

The problem is that that my Bird type has a property wingSpan which
the Fish type does not.. they might also share a property e.g. name
or canFly.

The Editor complains that it couldn't find a getter for canFly in
proxy type ...AbstractAnimal.

Is there any way around this?

Thanks for you help in advance.

Cheers,
Dave

-- 
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: GWT JavaDoc failures KeyPress v. KeyDown

2010-12-08 Thread DaveC
@Greg

I felt the need to reply on the topic of what GWT is/does...

What (Java) devs think GWT is/does...

*** Removes the need for them to understand ANY front end web
technologies (e.g. HTML, Javascript, DOM, CSS + xbrowser differences)
***

All of our Java developers (where I work) have found that they still
need to understand some CSS, HTML, DOM + xbrowser differences... what
GWT gives you is Java, Type Checking, Refactoring, Dependancy
Injection, code optimisations etc...all from a Java perspective...

As a non-Java developer I struggle with GWT... I find it gets in my
way, I have to understand Java, I don't like that fact that what I
write is not what gets run in the browser, devmode is slow...

But I agree with your point about Java docs/examples they are
sometimes a little thin especially for someone (like me) who is not a
Java Dev.

Cheers,
Dave


On Dec 8, 12:15 am, Jeff Chimene jchim...@gmail.com wrote:
 As one who writes documentation professionally, I see the impedance mismatch
 between Greg's desires and Javadoc. AFAICT, Greg wants to know why;
 Javadoc describes how. A toolkit that evolves as rapidly as GWT does not
 lend itself to in-depth why documentation.

 I see that the GWT team puts substantial effort into sample programs; which
 examples may be as close as we can get to why combined with how.

 I'm sure that the GWT team would welcome documentation contributions. The
 issue I have is ensuring such contributions have a lifetime  6 months.

 On Tue, Dec 7, 2010 at 3:17 PM, A. Stevko andy.ste...@gmail.com wrote:
  Greg - I admire your position on the quality of documentation.
  IMO, a measure of a sw engineer is not how much arcana he knows but rather
  knowing where to find it.
  Javadocs have long been a great source for the many of the details that I
  face daily although they typically suck for usability.

  A question to the group - Is it possible to crowd source the GWT and GAE
  javadocs?
  If we can't get to the source to augment the documentation, how about some
  kind of sister wiki site that can be the proving ground for training and
  usability improvements while also providing a very specific location to
  discuss API meta issues.

  The first thought on an approach to this is to have the javadoc template
  automatically write external links into a google site or similar.

  --Andy Stevko

  On Tue, Dec 7, 2010 at 12:30 PM, Jeff Schwartz 
  jefftschwa...@gmail.comwrote:

  Good luck!

  On Tue, Dec 7, 2010 at 3:08 PM, Greg Dougherty 
  dougherty.greg...@mayo.edu wrote:

  Hi Jeff,

  If it ever comes to be the situation that the only way I can do
  programming is on the web, then I'll waste the time to learn the
  current iteration of web programming.  But life is currently not so
  dim or dreary, and doesn't look to be that way any time soon.  (And if
  I am going to take the time to read, read, read on new programming
  ideas, it'll be on the Android (where there's a decent job market, and
  worthwhile development tools) or the iPhone (I've got one iPhone app
  out, but I'd like to learn more networking, and some of the newer
  technologies, not on a constantly changing standards body heavily
  influenced by Microsoft and Internet Explorer.)  I have a finite
  supply of learn time, and I have thigns that, for me, are far better
  ways to spend it than reading W3C documents.

  Let me put it another way: I have absolutely NO desire to be a master
  Web applications developer.  If I wanted to be one of those, I
  wouldn't be using GWT.  I'd be rolling my own.

  I took a look at SpringToolsSuite and Spring Roo.  Their documentation
  sucks, their tutorials are out of date, their integration with Eclipse
  is poor, and the support on the forums is weak.  So, since I AM a good
  SQL developer, I said the heck with that, and rolled my own for my
  current project.  And do not regret the choice at all.  The difference
  is that I find SQL a lot more interesting than JavaScript.

  Look, I'm glad that there are people out there who WANT to dig into
  the arcana of web programming.  I'm not one of them.  I'm someone who
  wants to solve other problems.  It was my impression that GWT exists
  to serve the people who want to solve those other problems, and don't
  want to have to dig in to that web BS (like worrying about IE vs.
  FF).  If that IS GWT's purpose, then their documentation sucks, and is
  not in line with their purpose.

  If that ISN'T GWTs purpose, what is?

  Greg

  On Dec 7, 11:24 am, Jeff Schwartz jefftschwa...@gmail.com wrote:
   Hi Greg,

   I have been in IT for a very long time. You see, I am what the youngins
   sometimes refer to as an ol' fart :). As a matter of fact, I've been a
   developer in one form or another for so long that everything else prior
  to
   that seems to me to be prehistory - a vague sense of something there
  but not
   having much substance (oh GOD, help me lol).

   My point is that as technologies advance I try to stay 

Re: ImageBundle and IE7

2010-11-15 Thread DaveC
I think what you need to be using instead of ImageResource is
DataResource.

GWT uses a different method for bundling resources for the different
browsers - those that support Data URIs (IE8+, Firefox, Chrome et al)
get their images turned into base64 encoded strings - IE6/7 gets a
sprite image (all the images merged into one).

Cheers,
Dave

On Nov 15, 7:32 am, Frédéric MINATCHY frederic.minat...@gmail.com
wrote:
 Hi everybody...

 I have a problem with images bundle and IE7...

 In some cases images are not rendered in other cases all images are rendered
 on the same button... (I use those images as icons to custom buttons)

 I don't understand everything seems ok on Firefox and Chrome (as usual)

 I use gwt 2.1 and smartgwt

 There is a part of my code :

 public interface UsersAdministrationImagesResources extends ClientBundle {

     public static UsersAdministrationImagesResources INSTANCE =
 GWT.create(UsersAdministrationImagesResources.class);

     @Source(user_add.png)
     ImageResource addUserImage();

     @Source(user_delete.png)
     ImageResource deleteUserImage();

     @Source(user_edit.png)
     ImageResource editUserImage();

     @Source(group_add.png)
     ImageResource addGroupImage();

     @Source(group_delete.png)
     ImageResource deleteGroupImage();

     @Source(group_edit.png)
     ImageResource editGroupImage();

 }

 and the way i use it :

 to show a smartgwt button :

 modificationButton = new ImgButton();

 modificationButton.setSrc(UsersAdministrationImagesResources.INSTANCE
                 .editUserImage().getURL());

 and in a real gwt button :

     createButton = new Button();
         createButton.setHTML( label+i18n.createUser() + /label img
 src=\ + UsersAdministrationImagesResources.INSTANCE
                 .editUserImage().getURL() + \);
         createButton.setWidth(200);
         createButton.setHeight(22);

 Why is it always so difficult with IE?

 Is there someone to help me pleaz

-- 
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: TabPanel - 100% height for client widget?

2010-07-12 Thread DaveC
Have you tried using CSS?

.my-tab-content {
 position: absolute;
 top: 0;
 left: 0;
 bottom: 0;
 right: 0;
}

this *should* work as long as it's parent is positioned (relative/
absolute)...

The new layout panels I think require a RootLayoutPanel not a
RootPanel... but I can't remember exactly.

Cheers,
Dave

On Jul 11, 6:52 pm, Magnus alpineblas...@googlemail.com wrote:
 Hi,

 sorry for repeating and posting in this thread without solution, but I
 must say that TabLayoutPanel is useless for me if its size cannot be
 maximized.

 So I'll have to build my own TabPanel, but this is not satisfactory
 since a framework should prevent me from building my own versions of
 things that should be already available.

 I cannot understand why TabLayoutPanel insists on having its content
 area squeezed at the top...

 Magnus

 On Jul 4, 12:24 am, Magnus alpineblas...@googlemail.com wrote:

  Thanks! I tried with dummy panels, VerticalPanel and SimplePanel. I
  tried absolute and relative sizes but nothing seems to have an effect.

   private void init ()
   {
    TabPanel pnl = new TabPanel ();
    pnl.setSize (100%,100%);
    //pnl.setHeight (100px);

    SimplePanel p = new SimplePanel ();
    p.setPixelSize (100,200);
    HTML txt1 = new HTML(This isa Text 1.);
    p.add (txt1);
   //  txt1.setPixelSize (200,200);
    pnl.add (p,Home 1);

    HTML txt2 = new HTML(This is Text 2.);
    pnl.add (txt2,Home 2);
   }

  Magnus

  On Jul 3, 6:43 pm, aditya sanas 007aditya.b...@gmail.com wrote:

   I think for that you will require to set its border explicitly.
   that will settle this issue.
   you can add a dummy panel on tab home1 or home2 and set its height
   but here  if you set height using % then it will not work you will have to
   set height in pixels or any other like em...

   i hope this will work.

   --
   Aditya

   On Sat, Jul 3, 2010 at 7:09 PM, Magnus alpineblas...@googlemail.com 
   wrote:
In addition, it would set the wrong height! The height of the TabPanel
(pnl) is ok, it covers 100 % of the available space.
But the VerticalPanel p that I add as the client panel to one of the
tab pages is not affected.

Look at this screenshot:
   http://yfrog.com/4rtabpanelp

The TabPanel (red border) is ok. But its child panel (blue border) is
crunched at the top.

How can I get the blue border maximized to the red border?

Thanks
Magnus

--
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.comgoogle-web-toolkit%2bunsubscr...@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-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: Detecting browser in GWT 2.0.3

2010-07-12 Thread DaveC
There *might* be a way to do it... e.g.

1. only invalidate the session on a specific log out request
2. store a flag/timestamp clientside to either invalidate the session
or not
3. onload reads this flag and decides whether or not to to invalidate
the session (if a number of seconds/minutes have elapsed)

There are/maybe security implications with this method that may mean
it's just not worth it...

You can use LocalStorage, SessionStorage and window.name etc to store/
read the flag...

Cheers,
Dave

On Jul 9, 2:29 pm, Stefan Bachert stefanbach...@yahoo.de wrote:
 Hi,

 from times to times this questions comes up.
 The user has the control over the browser, not javascript over the
 browser or the user.
 And this is a good idea because of security.

 Developers and customers must accept that there is no control over F5/
 Refresh. The same is true for power off ;-)

 This is no problem when all data is send as soon as possible to the
 server.

 Stefan Bacherthttp://gwtworld.de

 On 9 Jul., 02:01, SanjeevG sanjeev.g...@gmail.com wrote:

  Hi,

  I am working on an application that uses GWT 2.0.3 and GXT 2.2.0. I
  have implemented the onClose method of the CloseHandler to terminate
  the session on browser close, however this is causing an obvious
  problem of terminating the session on browser refresh as well.

  Can someone put some ideas on how to detect the browser refresh and
  avoid the RPC call that causes the session termination.

  Thanks.
  Sanjeev.

-- 
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: GWT adoption

2010-07-12 Thread DaveC
The majority of what GWT can do can be done by a good web developer/
designer... but what GWT is good at is all the compile time
optimisations - when you're trying to squeeze every last bit of
performance out of of your app... and if you only/have to write Java.

It is a crutch IMHO, probably quite a good one though ;o) - but a
crutch no less.

On Jul 12, 2:57 pm, nino ekambi jazzmatad...@googlemail.com wrote:
 For me i think GWT is the future.
 It s just a genius way to write desktop type web application.

 2010/7/9 mk munna.kaka.ch...@gmail.com

  Do you guys think that GWT will the most widely used framework in
  future ( or there will be mix of other frameworks in future. If yes
  than which frameworks).

  I am little worried that why GWT is not adopted at a rate I would have
  thought for last 4 yrs.  why why...

  --
  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.comgoogle-web-toolkit%2bunsubscr...@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-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: Button embedded in a rich text area

2010-07-12 Thread DaveC

RichTextArea rt = new RichTextArea();

rt.addMouseDownHandler(new MouseDownHandler() {

@Override
public void onMouseDown(MouseDownEvent event) {

Window.alert(MouseDown!);

Window.alert( + 
event.getNativeEvent().getEventTarget());
}
});

rt.setHTML(h1Test/h1pinput type=\button\ name=\name\
value=\+\/p);

Appears to work.

Cheers,
Dave

On Jul 12, 1:34 pm, Jan jan.morl...@googlemail.com wrote:
 Hi,

 I am using a GWT RichTextArea. The html code it displays contains also
 some buttons. Here is a simplified example:

 div
 h1Test/h1
 pinput type=button name=name value=+/p
 /div

 Is there a way to connect the pressing of this button with a gwt
 event?

 Thanks for your help

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



ImageResource Sprites and RepeatStyle.Horizontal/Vertical generating massive images

2010-07-09 Thread DaveC
Hello,

This is really just a heads up...

We are currently developing a large/complex GWT app and are making use
of ClientBundle, CssResource and ImageResource. We've run into an
issue where by GWT is generating massive sprite images (for instance
one is 163,000 x 300 pixels) - which obviously causes memory problems
in the compiler, dev mode and in browsers tyring to load/render this
image.

There is something specific about our Widget/CSS structure that is
causing GWT to do this - we haven't found out what it is yet (we have
widgets that nest HorizontalPanel/VerticalPanel/FlowPanel/ScrollPanel
and some are positioned absolutely and some are relative etc, etc).

Does anyone know if there is any debug that can be turned on (in the
compiler) that maybe hints at what is wrong?

Or has anyone come across this problem before?

I was going to submit a bug, but until I can find out what causes this
there isn't any point doing that.

Cheers,
Dave

-- 
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: ImageResource Sprites and RepeatStyle.Horizontal/Vertical generating massive images

2010-07-09 Thread DaveC
No, forgot about those (I check them)... but I have some more info
now... I can trigger the big sprites by changing the size of the image
(thats repeated) e.g.

image 62 x 60 px  triggers big sprite
image 500 x 60 px no big sprite...

On Jul 9, 1:02 pm, Frederic Conrotte frederic.conro...@gmail.com
wrote:
 Did you check your Compile reports ?

 http://code.google.com/webtoolkit/release-notes.html#Release_Notes_2_...

 On Jul 9, 1:55 pm, DaveC david.andrew.chap...@googlemail.com wrote:

  Hello,

  This is really just a heads up...

  We are currently developing a large/complex GWT app and are making use
  of ClientBundle, CssResource and ImageResource. We've run into an
  issue where by GWT is generating massive sprite images (for instance
  one is 163,000 x 300 pixels) - which obviously causes memory problems
  in the compiler, dev mode and in browsers tyring to load/render this
  image.

  There is something specific about our Widget/CSS structure that is
  causing GWT to do this - we haven't found out what it is yet (we have
  widgets that nest HorizontalPanel/VerticalPanel/FlowPanel/ScrollPanel
  and some are positioned absolutely and some are relative etc, etc).

  Does anyone know if there is any debug that can be turned on (in the
  compiler) that maybe hints at what is wrong?

  Or has anyone come across this problem before?

  I was going to submit a bug, but until I can find out what causes this
  there isn't any point doing that.

  Cheers,
  Dave

-- 
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: ImageResource Sprites and RepeatStyle.Horizontal/Vertical generating massive images

2010-07-09 Thread DaveC
Checked the compile report, but I can't seem to find where it
references (if it even does) the generated ImageResourceBundles...

On Jul 9, 1:58 pm, DaveC david.andrew.chap...@googlemail.com wrote:
 No, forgot about those (I check them)... but I have some more info
 now... I can trigger the big sprites by changing the size of the image
 (thats repeated) e.g.

 image 62 x 60 px  triggers big sprite
 image 500 x 60 px no big sprite...

 On Jul 9, 1:02 pm, Frederic Conrotte frederic.conro...@gmail.com
 wrote:

  Did you check your Compile reports ?

 http://code.google.com/webtoolkit/release-notes.html#Release_Notes_2_...

  On Jul 9, 1:55 pm, DaveC david.andrew.chap...@googlemail.com wrote:

   Hello,

   This is really just a heads up...

   We are currently developing a large/complex GWT app and are making use
   of ClientBundle, CssResource and ImageResource. We've run into an
   issue where by GWT is generating massive sprite images (for instance
   one is 163,000 x 300 pixels) - which obviously causes memory problems
   in the compiler, dev mode and in browsers tyring to load/render this
   image.

   There is something specific about our Widget/CSS structure that is
   causing GWT to do this - we haven't found out what it is yet (we have
   widgets that nest HorizontalPanel/VerticalPanel/FlowPanel/ScrollPanel
   and some are positioned absolutely and some are relative etc, etc).

   Does anyone know if there is any debug that can be turned on (in the
   compiler) that maybe hints at what is wrong?

   Or has anyone come across this problem before?

   I was going to submit a bug, but until I can find out what causes this
   there isn't any point doing that.

   Cheers,
   Dave

-- 
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: ImageResource Sprites and RepeatStyle.Horizontal/Vertical generating massive images

2010-07-09 Thread DaveC
Yeh, we were seeing browser memory usage jump from about 40Mb to over
300Mb.

We already split images/resources up (into modules/plugins with
specific functionality e.g. Search, RSSFeed, AppFramework etc, etc) -
for example in one bundle there are 17 images (9 of those are for a
DecoratorPanel, 5 are icons) and one css file. Four of those images
have the RepeatStyle.Horizontal attribute.

For example, when one of the tiled images is 62x60px the sprite ends
up being 163000 px wide when I change it to 500x60px it leaves it out
of the sprite... but the sprite still ends up being over 5000px wide -
still unnecessarily wide.

Is there no way I can tell the compiler don't make a sprite wider
than 500px?

Thanks for the replys btw.
Cheers,
Dave

On Jul 9, 2:35 pm, Stefan Bachert stefanbach...@yahoo.de wrote:
 Hi Dave,

 163000x300 pixel is extreme.
 I see two causes
 a) you have such a lot images. Than I would try for splitting up the
 ClientBundle
 b) GWT has a bug which causes huge images as a result. Maybe a) puts
 the compiler in a more stable state

 Stefan Bacherthttp://gwtworld.de

 On 9 Jul., 13:55, DaveC david.andrew.chap...@googlemail.com wrote:

  Hello,

  This is really just a heads up...

  We are currently developing a large/complex GWT app and are making use
  of ClientBundle, CssResource and ImageResource. We've run into an
  issue where by GWT is generating massive sprite images (for instance
  one is 163,000 x 300 pixels) - which obviously causes memory problems
  in the compiler, dev mode and in browsers tyring to load/render this
  image.

  There is something specific about our Widget/CSS structure that is
  causing GWT to do this - we haven't found out what it is yet (we have
  widgets that nest HorizontalPanel/VerticalPanel/FlowPanel/ScrollPanel
  and some are positioned absolutely and some are relative etc, etc).

  Does anyone know if there is any debug that can be turned on (in the
  compiler) that maybe hints at what is wrong?

  Or has anyone come across this problem before?

  I was going to submit a bug, but until I can find out what causes this
  there isn't any point doing that.

  Cheers,
  Dave

-- 
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: Why does GWT use UserAgent Sniffing?

2010-03-01 Thread DaveC
@Chris - yes I realise it *might* be a hack but it isn't *really*,
e.g.

The opera object (in window)

Pros:
 has been around since Opera 5 - it's used mostly by User
JavaScript files (http://www.opera.com/browser/tutorials/userjs/specs/
index.dml)
 is unique to Opera

Cons:
 not part of any standard - so there's no guarantee that Opera
will include it in future versions.


Conditional compilation (http://msdn.microsoft.com/en-us/library/
7kx09ct1(VS.80).aspx)

Pros:
 is unique to Trident/JScript

Cons:
 not part of any standard - so there's no guarantee that MS will
include it in future versions.


watch()/unwatch() methods

Pros:
 is unique to Gecko

Cons:
 not part of any standard - so there's no guarantee that Mozilla/
Gecko will include it in future versions, this has been hi-lighted
recently as some JS libraries use another Gecko only method
(getBoxObjectFor()) to detect Gecko - which has been removed in FF3.6.


Although the user-agent string does have a standard (http://
tools.ietf.org/html/rfc1945#section-10.15 and 
http://tools.ietf.org/html/rfc2068#section-14.42)
they differ (Http 1.0 doesn't have to have a user-agent field where as
http 1.1 does)... they are also quite ambiguous I especially like...

By convention, the product tokens are listed in order of their
significance for identifying the application.

  User-Agent = User-Agent : 1*( product | comment )

   Example:

  User-Agent: CERN-LineMode/2.15 libwww/2.17b3

IE7  - Mozilla/4.0 (compatible;.
FF3.5 - Mozilla/5.0 (Windows;.
O9.6 - Mozilla/5.0 (Windows NT 5.1;
S4.0 - Mozilla/5.0 (Windows;

Therefore according to the specs all the above user-agents are
Mozilla with IE being the only version 4.0 - the rest are 5.0...???

WRT content negociation yeh, I understand why/when you need this - but
to turn this on it's head why would I want a user to be able to view
my application knowing that it will break e.g. Opera pretending to be
Firefox?

I still stand by my original point, if there is no *good* reason GWT
is sniffing the useragent string then it shouldn't do it - it should
follow best practise.

It almost does - in that in detecting IE8 it looks for
document.documentMode (which is a proprietry MS property... not part
of any standard - so there's no guarantee... etc, etc) rather than
looking for MSIE8 and/or Trident/4.0???

Perhaps the UA string should be (unchangable) in the format Engine/
Version UserAgent/Version OS Locale e.g. Webkit/542.45+Safari/
4.05+OSX 10.05.6+en_gb - but thats another bag of worms...

Cheers,
Dave

On 25 Feb, 19:17, Chris Lercher cl_for_mail...@gmx.net wrote:
 Well... I don't know if this will really be more reliable - to be
 honest, it looks a little bit like a very, very dirty hack ;-) At
 least, I can't look at it and without knowing a lot of details about
 all existing browser versions ever, understand what this does. If
 there was something like document.browserInfo.product,
 document.browserInfo.majorVersion, ... (similar to JDBC's
 java.sql.DatabaseMetaData), then this could be a different discussion.

 However, even then I might still use the user agent string BTW, for
 the reasons I explained above: Think of the user agent string as a
 form of content negotiation, which can be influenced by the user if
 they want to. To make an analogy: If I go to pt.wikipedia.org, then I
 want the Portuguese version, no matter what the locale of my user
 agent is.

 I understand your decision, if your site really must ignore such a
 user setting. I also agree, that user agent strings should ideally be
 less ambiguous. So if I ever run into a situation, where the user
 agent string isn't enough to decide, I might actually fall back to
 your test - so I'll keep it bookmarked :-)

 Chris

 On Feb 25, 7:22 pm, mmoossen mmoos...@gmail.com wrote:

  thanks dave for sharing :)
  i think i will start using your code for browser identification

  Michael

  On Feb 25, 10:44 am, DaveC david.andrew.chap...@googlemail.com
  wrote:

   Thanks for all the replies.

   Thomas, I get your point - but I don't agree ;o), I think there are
   more reliable ways for testing... here's something I've used in the
   past:

   script
        var isPresto = !!(window.opera); // The opera object/property
   has been in existance since version 5 (I think) and is consistent
   regardless of changes to the UA string.
        var isTrident = /*...@cc_on!@*/false; // Or use !!(document.expando
document.uniqueId) if you don't *like* conditional compliation
        var isGecko = !!(document.watch);
        var isWebkit = !!(!isPresto  !isTrident  !isGecko 
   document.evaluate  document.querySelector);

        var ie8 = !!(isTrident  document.documentMode = 8);
        var ie87 = !!(isTrident  document.documentMode === 7);
        var ie8q = !!(isTrident  document.documentMode === 5);
        var ie7 = !!(isTrident 
   document.documentElement.currentStyle.maxWidth !== undefined

Re: Why does GWT use UserAgent Sniffing?

2010-03-01 Thread DaveC
I think we're going to have to agree to disagree!!!

One of the first GWT apps/websites I saw was https://studyblue.com/
now I have to be honest loading 1.5Mb in 60 odd http requests didn't/
doesn't exactly make me think Wow!! That GWT thing must be amazing!
- granted it *might* not all be GWT's fault... anyway... the company I
work for chose GWT and I'm now building apps using it... but still
after using ClientBundle and CssResource my relatively simple app
weights in at 720Kb and about 20 http requests.

I think CSS Hacks are bad too (see my comment above ...they [browser
vendors] fix a bug that developers had built logic on.).

I also think browser sniffing is bad too - see above ;o)

Sometimes both are necessary.

would see GWT as absolutely appropriate for building public facing
websites/applications, because it provides a lot of advantages
compared to other web frameworks. 

To that I would say what about accessibility, SEO, Mobile Browsers,
browers that predate IE6, people on slow connections and/or slow
computers/devices, what about UAs that aren't JS capable or users that
have it turned off... etc, etc.

What about : http://www.w3.org/Consortium/mission

Web for All
The social value of the Web is that it enables human communication,
commerce, and opportunities to share knowledge. One of W3C's primary
goals is to make these benefits available to all people, whatever
their hardware, software, network infrastructure, native language,
culture, geographical location, or physical or mental ability.


IMHO/experience the best way of building *really good* web
applications is a team with the right mix of skills ((UX) Designers,
front end engineers, web developers, programmers etc...) and start
with the lowest common denominator (HTML) - unfortunately I am one
*web guy* amongst 30+ Java devs, hence the GWT choice (used to be
Echo2)... GWT et al is a compromise - (don't get me wrong I think what
the compiler does is amazing...).

I think this has probably gone way off topic!

Cheers,
Dave

On 1 Mar, 15:03, Chris Lercher cl_for_mail...@gmx.net wrote:
 Hi Dave,

 I agree that it will depend on the requirements for your site. Still,
 I would see GWT as absolutely appropriate for building public facing
 websites/applications, because it provides a lot of advantages
 compared to other web frameworks. And I would hope that it will
 continue to work (mostly) with all future, CSS 2.1 compliant browsers
 (plus the bunch of legacy browsers that are also supported by GWT). So
 if one year from now, e.g. the Apache foundation were to release a
 completely new browser (Apachium maybe?), which is 100% standards
 compliant, it really shouldn't be impossible to make that browser
 render a page, because the page insists on presenting its Firefox
 version (so at least we should make sure that the algorithm -
 whichever is chosen - will fall back to the most standards compliant
 version).

 But we could discuss this forever - maybe a different argument might
 convince you:

 I generally believe that browser CSS-Hacks etc are a bad idea, and
 that it should be decided on the server, which version to serve. This
 should also be true for non-GWT sites. Now, not every non-GWT page
 will have the luxury of making one round-trip (first determining the
 browser version on the client, sending the result to the server and
 only then sending the actual content). So these sites will only be
 able to read the user agent string (because the client already sends
 this on its first request). If that wasn't enough for them to
 determine the browser, they'd again have to fall back to submitting
 pages that contain inline hacks.

 Therefore, the user agent string has to be enough to determine the
 browser anyway. If it wasn't anymore, that HTTP header would become
 more and more useless, until we'd all have to either use hacks, or be
 forced to make one round-trip.

 Cheers
 Chris

 On Mar 1, 2:55 pm, DaveC david.andrew.chap...@googlemail.com wrote:

  Hi Chris, yeh I think we're on the same page but... ;o)

  ... *Here* we're talking about GWT not about the public facing web
  so...

   ... e.g. I'd like to be able to view the pages also with Konqueror
   (whose KHTML engine is BTW is not so similar to WebKit browsers
   anymore). It may work best when the browser sends me the Firefox
   version, or it may work best with the Webkit version. I'll want to
   decide that as a user, because the site owner won't care about
   Konqueror. The same is true for any completely new browser that may be
   released in the future - if the site isn't maintained anymore, or the
   site owner doesn't care, I will be unable to view it, although I could
   view it, if only I could retrieve the site for example in the WebKit
   version.

  ... (for the public facing web) here's where browser detection fails -
  and feature detection + progressive enhancement wins.

   The same is true for any completely new browser that may be released
  in the future

Re: How to provide a local css resource file with a Module

2010-02-23 Thread DaveC
What about using ClientBundle and CssResource?

http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html
http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#CssResource

Cheers,
Dave

On Feb 23, 7:49 am, Ashar Lohmar asharloh...@gmail.com wrote:
 you should put the css in a folder named public inside your module
 package, the folder should be on the same level as the client folder
 there's no need for the stylesheet src='Music.css' / specification
 on the .gwt.xml file

 you could take a look at the GWT-Upload library it has same situation,
 their jar contains gwt module with no entry point and css that
 contains the css-classes for their widgets.

 good luck

 On Feb 22, 9:20 pm, Ashish Khivesara ashish.khives...@gmail.com
 wrote:

  Any one with a solution for this issue?
  I even tried using UiBinder and css in conjunction to solve this issue but
  have not been able to.

  Any direction would be helpful.

  Thanks
  Ashish

  On Fri, Feb 19, 2010 at 5:52 PM, Ashish Khivesara 

  ashish.khives...@gmail.com wrote:
   This looks like a bug.

   Issue: If a module without a entry point includes a stylesheet element 
   then
   the path is considered to be relative to the module that may inherit it.
   This make it rigid and thereby adds a dependency between the inheriting
   module.

   In my case Music module had this line in the Music.gwt.xml
   stylesheet src='Music.css' /

   Now Home module inherits Music modules.

   But GWT instead of looking for /music/Music.css, looks for the css 
   resource
   in /home/Music.css

   [WARN] 404 - GET /home/Music.css (127.0.0.1) 1400 bytes

   On Fri, Feb 19, 2010 at 5:31 PM, Ashish Khivesara 
   ashish.khives...@gmail.com wrote:

   Well the issue here would maybe because the module here in question does
   not an Entry point and hence there is no hostpage to inject this css
   reference into.
   So this there a way to make sure the inheriting module injects this
   stylesheet in its host page??

   Thanks
   Ashish

   On Fri, Feb 19, 2010 at 5:18 PM, Ashish Khivesara 
   ashish.khives...@gmail.com wrote:

   I need to associate a local css resource file with a module. This module
   does not have Entry point hence I cannot simply import it in the html.
   Here is what I did

   I added this line in my Music.gwt.xml

   stylesheet src='Music.css' /

   Music.css resides in the war/ directory

   Now I inherit this module in another Module. However the css resource
   does not seem to be attached / downloaded.

   Any pointers?

   Thanks
   Ashish

-- 
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: Why does GWT use UserAgent Sniffing?

2010-02-23 Thread DaveC
 So perhaps your question ought to be why GWT uses the user agent to put
 the browser into its 6 categories rather than using browser capability
 detection to put them into the same 6 categories.

E... isn't that what I asked?

So my question is NOT- why do we have deferred binding or why does
gwt
test for different browser platforms BUT:

Why does gwt parse the useragent string rather than using object/
feature detection - due to the fragility of sniffing the ua string? 

On Feb 23, 11:00 am, Paul Robinson ukcue...@gmail.com wrote:
 DaveC wrote:
  Gal, I'm not sure what you mean by this:

  You can write your own properties detection to do it.
  But can't you see the what you are telling means compile 100+ different
  versions of the page if you evaluate individual properties?
  The way gwt do it give you 6 versions only, one for each browser...

 If GWT were to check for browser capabilities instead of the user agent,
 it would have many variables, in terms of all the things the browser
 does and does not support. You can't implement deferred binding for each
 of them because you'd end up with an awful lot of permutations in your
 compile, making it take much, much longer.

 So even if GWT were to do it this way, it would have to use the
 detection to identify the type of browser into the same (or similar) 6
 categories it does now with user agent so it can keep the number of
 permutations small.

 So perhaps your question ought to be why GWT uses the user agent to put
 the browser into its 6 categories rather than using browser capability
 detection to put them into the same 6 categories.

 Paul

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



Why does GWT use UserAgent Sniffing?

2010-02-22 Thread DaveC
It's *generally* considered by the web development community that
useragent sniffing is bad and object/feature detection is good... why
then does GWT sniff the useragent?

Can anyone explain why - is there a benefit??

Cheers,
Dave

-- 
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: Why does GWT use UserAgent Sniffing?

2010-02-22 Thread DaveC
Thanks for the reply Martin,

OK, I think you maybe misunderstood my question though.

I understand what Deferred Binding is and why it's a good thing - what
I wanted to know was why does GWT sniff use the navigator.useragent
string e.g.

  var ua = navigator.userAgent.toLowerCase();

  if (ua.indexOf(opera) != -1) {
return opera;
  } else if (ua.indexOf(webkit) != -1) {
return safari;
  } else if (ua.indexOf(msie) != -1) {
if (document.documentMode = 8) {
  return ie8;
} else {
  var result = /msie ([0-9]+)\.([0-9]+)/.exec(ua);

etc, etc...

when it's well documented/considered best practise to not sniff the
useragent string because browsers can lie...?

Cheers,
Dave

On Feb 22, 1:37 pm, Martin Trummer martin.trum...@24act.at wrote:
 because it's much 
 better:http://code.google.com/intl/de-DE/webtoolkit/doc/latest/DevGuideCodin...

-- 
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: Is there a best practice for compiling multiple modules?

2010-02-19 Thread DaveC
The only thing I could suggest is outlined here
http://code.google.com/webtoolkit/doc/latest/FAQ_DebuggingAndCompiling.html#Can_I_speed_up_the_GWT_compiler?
(but you've probably already looked at this...)

Sorry I can't be more help - it has got me thinking though, where I
work will probably run into the same problem in the (near) future.

Cheers,
Dave

On Feb 19, 12:47 am, JimmyJoe skwee...@gmail.com wrote:
 I appear to be in a rare situation with regard to GWT use:  my team
 has dozens of independent GWT modules and our compile times are rising
 as we add more modules.

 A couple years back the company I work for decided to switch to GWT
 for new product development.  We have a SaaS portal that has dozens of
 legacy applications written in JSPs, so this was a big change for
 us.

 Now that we do all new development in GWT, we are developing all new
 products as separate modules, each of which is hosted in its own JSP
 (to take advantage of all our legacy code there, punt on some
 development costs, etc.).  They fit in with our existing code very
 well.

 Long story short, we now find ourselves with upwards of 20 modules and
 climbing, and our complete build times are getting extraordinarily
 long.

 Here's a little more info:

 Many of our modules are built on a common framework which is its own
 module sans entrypoint.  Often a module will consist of a single page
 of functionality distinct from other features in our product suite --
 for instance setting org preferences, searching for emails, etc.  Some
 of the modules could be combined, such as administration modules; my
 concern with that approach is that we're still using GWT 1.7 and don't
 have code splitting to keep our performance numbers good if we go that
 direction.

 Regardless of that special case, however, we will eventually have
 dozens of large(-ish?), complex GWT modules that need to be regularly
 compile.  Even with Ant's parallel and GWT's localWorkers we are
 already seeing significantly extended compile times.

 Our current approach for single product development is to comment out
 all the modules that are not under development (Google's own best
 practice, as far as I have heard), and we are using development mode
 extensively, which obviously removes the need to compile the GWT code
 often.  We also do no internationalization or localization.

 What are your thoughts?  Is there a good way to manage a large number
 of modules and keep compile times down?

-- 
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: How to write a simple overlay implementation?

2010-01-26 Thread DaveC
Your create method is returning an Element - not an SVGPanel...

I'd personally start with a Widget (not a JavascriptObject) and use
GWT DOM methods (these will be optimised for each of the supported
browsers)... I have the same problem as you - going from a JS world to
a GWT/Java world sometimes seems (or is) over complicated...

Cheers,
Dave

On Jan 25, 7:22 pm, markww mar...@gmail.com wrote:
 Hi,

 I'd like to make some really simple overlay classes in GWT to wrap
 some SVG stuff. I'd basically like to get a rectangle drawn, this is
 how I do it in javascript:

   var svg = document.createElementNS('http://www.w3.org/2000/svg',
 'svg');
   svg.setAttribute('width', '100%');
   svg.setAttribute('height', '100%');
   document.body.appendChild(svg);

   var rect = document.createElementNS('http://www.w3.org/2000/
 svg','rect');
   rect.setAttribute(width,300);
   rect.setAttribute(height,100);
   svg.appendChild(rect);

 and now I'm having trouble translating that to GWT. I was hoping I
 could do a really thin overlay around all those calls, something like
 this:

 public class SVGPanel extends JavaScriptObject {
     protected SVGPanel() {}

     public static native SVGPanel create(String width, String height) /
 *-{
         var svg = document.createElementNS('http://www.w3.org/2000/
 svg', 'svg');
         svg.setAttribute('width', width);
         svg.setAttribute('height', height);
         return svg;
     }-*/;

 }

 public MyProject implements EntryPoint {

     public void onModuleLoad() {
         SVGPanel panel = SVGPanel.create(100%, 100%);
         Document.get().getBody().appendChild(panel);
     }

 }

 yeah but I do not have a grasp on how we can jump from the javascript
 representation of the SVG stuff to GWT java classes. For one, the
 SVGPanel class extends JavaScriptObject, but I can't simply add it to
 the Document body class because it's expecting an Element type. If
 someone could just point out the right way to do that bridge I should
 be able to get going after that.

 Also, I'm not sure if this the optimal way to incorporate some simple
 SVG classes, should I be modeling them using the DOM classes instead
 of trying to use JSNI ?

 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-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: mousemove listener for document?

2010-01-26 Thread DaveC
The way I've done it (I think is):

1. Create a new Class that extends Widget and implements
HasMouseMoveHandlers

2. Grab the RootPanel Element and pass that into your new Class
constructor (the one that takes an Element as a param) - this should
call setElement(Element element) with you passed in element...

You can now add MouseMove handlers to you new Widget...

On Jan 26, 12:49 am, markww mar...@gmail.com wrote:
 Hi,

 Is there a way to listen for mousemoves on the main document? In
 javascript, I usually do this:

   window.onload = function() {
       document.onmousemove = function(e) {
           alert(the mouse was moved!);
       };
   }

 can we add some sort of similar listener in GWT? I'm just not sure
 where to start,

 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-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: mousemove listener for document?

2010-01-26 Thread DaveC
I've run into (perfornance) issues using a NativePreviewHandler as it
will recieve *ALL* events (mouseover/out/move/up/down etc, etc...)
which is why I don't use that method.

On Jan 26, 11:08 am, Fazeel Kazi fazzze...@gmail.com wrote:
 Another simpler solution using EventPreview:

 Event.addNativePreviewHandler(new Event.NativePreviewHandler()
 {
      public void onPreviewNativeEvent(NativePreviewEvent foEvent)
      {
         switch(foEvent.getTypeInt())
         {
            case Event.ONCLICK: handleClick(foEvent); break;
            case Event.ONMOUSEOVER: handleMouseOver(foEvent); break;
         }// end switch
      }

 });

 Regards.

 On Tue, Jan 26, 2010 at 3:09 PM, DaveC
 david.andrew.chap...@googlemail.comwrote:

  The way I've done it (I think is):

  1. Create a new Class that extends Widget and implements
  HasMouseMoveHandlers

  2. Grab the RootPanel Element and pass that into your new Class
  constructor (the one that takes an Element as a param) - this should
  call setElement(Element element) with you passed in element...

  You can now add MouseMove handlers to you new Widget...

  On Jan 26, 12:49 am, markww mar...@gmail.com wrote:
   Hi,

   Is there a way to listen for mousemoves on the main document? In
   javascript, I usually do this:

     window.onload = function() {
         document.onmousemove = function(e) {
             alert(the mouse was moved!);
         };
     }

   can we add some sort of similar listener in GWT? I'm just not sure
   where to start,

   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-tool...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@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-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.



Am I using deffered binding correctly?

2010-01-25 Thread DaveC
I'm using deferred binding to separate out some browser specific code.

In my *.gwt.xml file I've got a property provider (with a bit of
Javascript doing some detection) and a replace-with/when... etc,

The deferred binfing works correctly and different browsers are
getting different implementations.

But when I compile the project, instead of the usual 6 versions (one
each for ie6,ie8,gecko,gecko1_8,safari and opera), it compiles 12 - if
I add another deferred binding (replace-with/when) it says it's
compiling 24!!

Is this correct behaviour? Or have I done something wrong?

Cheers,
Dave

-- 
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: Deferred binding with an external JavaScript file?

2010-01-25 Thread DaveC
Yeh it's possible - but I'm not sure thats the best way of doing
it... (for example I've used it when I have a 'Native' browser
implemention and a 'Gears' implementation both implementations extend
a default one - which is the one I use in my app code - GWT then
replaces this with either a Native implementation or a Gears
implementation...)

If the js file you're including isn't exposed to GWT then I would say
do the include yourself e.g. (in your HTML file)

!--[if IE]--
script src=test.js/script
!--![endif]--

But by doing it this way you don't get any benefit of the GWT
compiler.

What *might* be better would be to create a JSNI version of your JS
file...

But I'm certainly no expert, someone else might have a better idea.

Cheers,
Dave

On Jan 24, 5:56 pm, markww mar...@gmail.com wrote:
 Hi,

 I'm trying to do a bit of deferred binding, not sure if this is
 possible with GWT. I want to use an external js file, only if the
 browser is Internet Explorer. The deferred binding example I found
 shows how to load some gwt classes dynamically - I'd like to include
 this js file dynamically though. Something like:

 if (browser == 'ie')
     Use test.js

 is something like that possible?

 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-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: Am I using deffered binding correctly?

2010-01-25 Thread DaveC
Ah, Thanks Thomas.

Unfortunately, what I'm trying to detect is specific to a particular
browser version (existence of the HTML5 File API, which at the moment
is Firefox 3.6 only), I thought deferred binding was the right
solution (everything else gets a Gears implementation) - but I'm not
so sure (perhaps it's better to have a single Class that switches
between the two implementations?).

I had a similar problem with the HTML5 drag and drop - Firefox 3.0 had
a non-standard implementation...

What do you think is more appropriate, deferred binding or bunging it
all in one implementation?

Cheers,
Dave

On Jan 25, 5:34 pm, Thomas Broyer t.bro...@gmail.com wrote:
 On Jan 25, 3:12 pm, DaveC david.andrew.chap...@googlemail.com wrote:

  I'm using deferred binding to separate out some browser specific code.

  In my *.gwt.xml file I've got a property provider (with a bit of
  Javascript doing some detection) and a replace-with/when... etc,

  The deferred binfing works correctly and different browsers are
  getting different implementations.

  But when I compile the project, instead of the usual 6 versions (one
  each for ie6,ie8,gecko,gecko1_8,safari and opera), it compiles 12 - if
  I add another deferred binding (replace-with/when) it says it's
  compiling 24!!

  Is this correct behaviour? Or have I done something wrong?

 Each new property will add a new axis of permutations, so if it can
 take 2 values it'll double the number of permutations.
 This is the same behavior than when you add i18n, you'll have 6
 (user.agent) times the number of languages your app is translated in
 (locale, that you'd have extended with extend-property).

 If you're dealing with browser-specific code, then you'd rather use
 the existing user.agent property when possible.

 For instance, I developed a JSON module at work using native
 JSON.parse/stringify when available and resorting to eval() and
 JSONObject.toString() otherwise. I didn't introduce a new property but
 based my code only on the user.agent property. We know that ie6, opera
 and gecko don't support it, so they'll use the emulated
 implementation, while ie8 certainly does so it'll use the native
 impl. And for gecko1_8 and safari, I'm using a fallback impl that
 tests for native JSON before instantiating one of the emulated or
 native implementations and delegate to them. Given that they both
 have a pretty fast JS engine, having all implementations code compiled
 in isn't really an issue.

 GWT does the same in some cases where it needs to differentiate
 between Safari 2 and 3+, (it used to do it in HistoryImpl at least) or
 IE 6 and 7 (clipped image)

-- 
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: HTML5 DND and File Upload...

2010-01-22 Thread DaveC
I've got a little further (or a different error message) - running the
compiled code in Firefox 3.6 (as it supports the HTML5 File API) I get
the following Javascript Error...

_FileReader_handlerManager is undefined - I know nothing about
the mechanics of how GWT takes my Java Classes and turns them into
Javascript, but I do know that I'm creating the HandlerManager (in the
FileReader) as I can debug when I'm attaching the event handlers and
the handlerManager is being created and attaching the handler...

So can anyone help - as to why the instance of HandlerManager in
FileReader is undefined (which I think equates to null in GWT/Java
speak)?

Cheers,
Dave

On Jan 21, 4:49 pm, DaveC david.andrew.chap...@googlemail.com wrote:
 OK,

 I've have a working implementation in IE, FF and Chrome (using Gears
 where necessary - GWT 2.0) that allows me to capture when a file is
 dragged from the desktop and dropped into the browser window.

 The next part of the puzzle is to grab the file data/content and
 upload it... grabbing the data is trivial when using the Gears
 implementation (as Gears creates a Blob as a property of the File -
 I've implemented my own GWT Gears API as the one on Google Code wasn't
 compatible with GWT 2).

 I've created a GWT implementation of the HTML5 File spec (FileList,
 FileError, File... etc) and have a FileReader that does the reading of
 the file in browsers that currently support the spec (Firefox 3.6)

 I've created a bunch of Handlers and Events for the FileReader
 (loadstart, loadend, progress etc) and I've added a HandlerManager to
 my FileReader class... and this is where things go wrong...

 The events come out of the Native (javascript) FileReader which calls
 (for instance) LoadStartEvent.fire() which gets all the way to the
 HandlerManager in the FileReader class and then a low level (JS) error
 is thrown... something like cannot find static it also appears
 to be not detectecting that (for instance) the event passed in is a
 LoadStartEvent - it just thinks it's a generic GwtEvent...

 My question is should I be using HandlerManager? Or is this only
 supposed to be for Widgets... I cannot believe that something like
 this is so hard/complicated to do in GWT/Java... when I have a fully
 working JS version (in a about 20 lines of code) - I'm trying to port
 to GWT for use inside an Enterprise B2B app...

 Please, are there any GWT engineers/experts listening that can (at
 least) point me in the right direction - I realise that there are
 probably NDAs relating to how to do this in GWT (because of the WAVE
 Client App) - but just a nod in the right direction would help...

 My intention is to open source all this once I've got something that
 works.

 Cheers,
 Dave

-- 
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: HandlerManager

2010-01-22 Thread DaveC
Just so I know we're talking about the same thing :o)

An Blur event will fire when I either tab out of the Widget or when I
click somewhere else in the application - is this how you are trying
to cause the blur event to fire? (I had the above code working for me
in Firefox 3.0/Dev mode GWT 2 - what browser(s) are you viewing this
in?)

On Jan 21, 6:24 pm, PaulBee pauloabe...@gmail.com wrote:
 Thank you DaveC,

 But the BlurHandler doesn't seem to work on the FocusPanel.
 I've tryed every way of taking the focus away from the panel, and it
 is just not calling the BLurHandler...

-- 
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: My icons are missing

2010-01-22 Thread DaveC
Note the first forward slash in your image url - this points to the
root of your server and not /appname/...

Cheers,
Dave

On Jan 22, 4:41 pm, darkling darkling...@aol.com wrote:
 I'm trying to add icons to my application. Everything worked fine when
 I ran in the google browser but now that I've published the system to
 my dev server (its Sun Application server 9.1) the icons are all
 missing. I'm also noticing that any servlets I try to access via HTTP
 (FormPanels) rather than RPC also come up as 404s. My RPC servlets
 work fine.

 The icons I'm trying to access are the grid icons from EXT-GWT which
 always worked fine up until now. I packaged up my war and dropped it
 into the autodeploy in Glassfish just as I always would but now the
 links aren't working. Am I doing something wrong for GWT?

 My war structure is

 /images
 /appName (with all the GWT JS files)
 appName.html
 gxt-grey.css
 gxt-all.css

 I'm trying to access

  .x-grid3-dirty-cell {
     background-image:url(/images/default/grid/dirty.gif);

 }

 which isn't working.

 When I try to input the URL

 http://localhost:8080/appName/images/default/grid/dirty.gif

 The icon appears.

 Can anyone tell me what I'm doing wrong?
 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-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.



HTML5 DND and File Upload...

2010-01-21 Thread DaveC
OK,

I've have a working implementation in IE, FF and Chrome (using Gears
where necessary - GWT 2.0) that allows me to capture when a file is
dragged from the desktop and dropped into the browser window.

The next part of the puzzle is to grab the file data/content and
upload it... grabbing the data is trivial when using the Gears
implementation (as Gears creates a Blob as a property of the File -
I've implemented my own GWT Gears API as the one on Google Code wasn't
compatible with GWT 2).

I've created a GWT implementation of the HTML5 File spec (FileList,
FileError, File... etc) and have a FileReader that does the reading of
the file in browsers that currently support the spec (Firefox 3.6)

I've created a bunch of Handlers and Events for the FileReader
(loadstart, loadend, progress etc) and I've added a HandlerManager to
my FileReader class... and this is where things go wrong...

The events come out of the Native (javascript) FileReader which calls
(for instance) LoadStartEvent.fire() which gets all the way to the
HandlerManager in the FileReader class and then a low level (JS) error
is thrown... something like cannot find static it also appears
to be not detectecting that (for instance) the event passed in is a
LoadStartEvent - it just thinks it's a generic GwtEvent...

My question is should I be using HandlerManager? Or is this only
supposed to be for Widgets... I cannot believe that something like
this is so hard/complicated to do in GWT/Java... when I have a fully
working JS version (in a about 20 lines of code) - I'm trying to port
to GWT for use inside an Enterprise B2B app...

Please, are there any GWT engineers/experts listening that can (at
least) point me in the right direction - I realise that there are
probably NDAs relating to how to do this in GWT (because of the WAVE
Client App) - but just a nod in the right direction would help...

My intention is to open source all this once I've got something that
works.

Cheers,
Dave
-- 
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: HandlerManager

2010-01-21 Thread DaveC
Something like...


ListBox box = new ListBox();
box.addItem(Hello);
box.addItem(World!);

final PushButton button = new PushButton(Hidden);


FocusPanel p = new FocusPanel();
p.addFocusHandler(new FocusHandler() {

@Override
public void onFocus(FocusEvent event) {
button.setVisible(true);
}
});

p.addBlurHandler(new BlurHandler() {

@Override
public void onBlur(BlurEvent event) {
button.setVisible(false);
}
});

FlowPanel f = new FlowPanel();

f.add(box);
f.add(button);

p.add(f);


Cheers,
Dave

On Jan 21, 4:54 pm, PaulBee pauloabe...@gmail.com wrote:
 I think that would be a good solution but neither FlexTable nor Panel
 (be it Horizontal or Vertical) have OnFocus and Blur handlers...

 Do you have any container to suggest?

 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-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: Injected CSS rules are evaluated after onModuleLoad/Widget#onLoad

2010-01-09 Thread DaveC
Cool, nope I've not noticed any performance issues - I'm in the middle
of writing an app (for my employer) that will be shipped as part of a
enterprise b2b product at the moment there is about 8 separate
stylesheets that are being injected - will probably be at least 10
when finished so any performance issues will become apparent as the
dev progresses.

Cheers,
Dave

On Jan 9, 12:28 pm, Sebastian Beigel sebast...@beigel.de wrote:
 Replacing

 globalResources.fooCss().ensureInjected();

 with

 StyleInjector.inject(globalResources.fooCss().getText(), true);

 solves the problem as well! Thanks Dave.

 In the meanwhile, I wrapped my onModuleLoad code in a
 DeferredCommand() (mainly for an UncaughtExceptionHandler) and removed
 the DeferredCommand wrap in Widget#onLoad (as described in my previous
 post). That also works.

 Anyway, I use both modifications, deferring the onModuleLoad (mainly
 for the logger) and ensuring immediate CSS injection -- explicit is
 better than implicit :) Or do you see any (performance) issues with
 this approach?

 Sebastian

 On Sat, Jan 9, 2010 at 1:25 AM, DaveC





 david.andrew.chap...@googlemail.com wrote:
  Have you tried StyleInjector.inject(cssText, true) ...?

   the DOM will be updated immediately instead of just before returning
  to the event loop. Using this option excessively will decrease
  performance, especially if used with an inject-css-on-init coding
  pattern

  I had a similar problem using the gwt-fx library (which parses the
  stylesheets in the DOM looking for selectors I passed in) the styles
  weren't injected in time.

  Cheers,
  Dave

  On Jan 8, 4:39 pm, Sebastian Beigel sebast...@beigel.de wrote:
  I found a work around, I wrapped the positioning code in my onLoad()
  method in a DeferredCommand and it works. Is this the preferred
  solution for this problem?

  Sebastian

  On Fri, Jan 8, 2010 at 4:38 PM, Sebastian Beigel sebast...@beigel.de 
  wrote:
   Hi,

   I tried to follow the best practices and moved my static CSS files
   from style-tags in the HTML-page to CssResources in a ClientBundle
   declared in my EntryPoint and injected in a static initializer.

   Unfortunately, this doesn't work for me because I do some element
   positioning in an onLoad-method of a Widget (which is contained in the
   UIBinder template of my EntryPoint). The calculations of the
   (relative) positions are wrong and I found out that the injected CSS
   rules are not evaluated until my positioning code runs.
   Profiling the generated JS code shows the following timing:

   - entering onModuleLoad
   - entering Widget#onLoad
   - leaving onLoad
   - leading onModuleLoad
   - injecting CSS

   Tested in Webkit and Firefox 3.5 on a Mac with Snow Leopard.

   If I defer the positioning (by triggering it manually via a Button
   click in the UI) everything works as expected.

   Is this a bug? Is there a work-around? I really don't want to move my
   CSS back to static files and lose all the great advantages from using
   ClientBundles. But I need my CSS rules parsed and evaluated *before*
   my code runs.

   Thank you,
   Sebastian

  --
  Sebastian Beigelhttp://beigel.de/sebastian

  --
  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 
  athttp://groups.google.com/group/google-web-toolkit?hl=en.

 --
 Sebastian Beigelhttp://beigel.de/sebastian
-- 
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: better place for image

2010-01-09 Thread DaveC
Like wise there wasn't a lot I needed to adjust when I moved from 1.7
to 2.0...

Cheers,
Dave

On Jan 8, 5:35 pm, Thad thad.humphr...@gmail.com wrote:
 If it's any help, I found moving from 1.7 to 2.0 a **lot** less effort
 than moving from 1.4 to 1.5.  In fact, it was trivial by comparison.

 On Jan 8, 11:46 am, ale aleee...@gmail.com wrote:



  Thanks for the answer, I will try your example.
  I'm a little afraid to upgrade to gwt 2.0, because I have a lot of
  pages developed with 1.7 ...
  and the idea of rewrite a lot of code now...

  Cheers
  Ale

  On Jan 8, 3:06 pm, DaveC david.andrew.chap...@googlemail.com wrote:

   I use ClientBundle (and CssResource) (I'm using GWT 2 by the way...)
   e.g.

   public interface RichToolTipClientBundle extends ClientBundle {

       @Source(resources/css/rich-tooltip.css)
       public RichToolTipCssResource getCss();

       @Source(resources/img/logo.png)
       public ImageResource getLogo();

       @Source(resources/img/tooltip-top-left.png)
       @ImageOptions(repeatStyle = RepeatStyle.None)
       public ImageResource tooltipTopLeft();

       public interface RichToolTipCssResource extends CssResource {

           @ClassName(tooltip)
           String getToolTipStyleName();

       }

   }

   public class RichToolTipResources {

       private static RichToolTipClientBundle INSTANCE;

       public static final RichToolTipClientBundle getBundle() {

           if (INSTANCE == null) {

               INSTANCE = GWT.create(RichToolTipClientBundle.class);

               INSTANCE.getCss().ensureInjected();

               // or StyleInjector.inject(INSTANCE.getCss().getText(),
   true);
           }
           return INSTANCE;
       }

   }

   In your css...

   @sprite .tooltip {
           gwt-image: 'tooltipTopLeft';

   }

   then:

   public ToolTip extends Composite {

           // injects the css...
           private RichToolTipClientBundle resources =
   RichToolTipResources.getBundle();

           public ToolTip() {
                   FlowPanel panel = new FlowPanel();
                   initWidget(panel);
                   addStyleName(resources.getCss().getToolTipStyleName());

                   Image img = new Image(resources.getLogo());
                   panel.add(img);
           }

   }

   Using these methods makes use of the GWT compiler and all it clever
   optimisation such as inlining the images using data-uris when
   supported... which help make the page load faster.

   Hope this helps,

   Cheers,
   Dave

   On Jan 8, 9:03 am, ale aleee...@gmail.com wrote:

Hi,
I can not decide where put some image in a application, image like
logo, icon for button, ecc.

Is better put it in css or use the  ImageBundle and
AbstractImagePrototype?

I prefer the solution that make the load of the page faster.

Thanks!

Bye
Alessandro
-- 
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: better place for image

2010-01-08 Thread DaveC
I use ClientBundle (and CssResource) (I'm using GWT 2 by the way...)
e.g.

public interface RichToolTipClientBundle extends ClientBundle {

@Source(resources/css/rich-tooltip.css)
public RichToolTipCssResource getCss();

@Source(resources/img/logo.png)
public ImageResource getLogo();

@Source(resources/img/tooltip-top-left.png)
@ImageOptions(repeatStyle = RepeatStyle.None)
public ImageResource tooltipTopLeft();


public interface RichToolTipCssResource extends CssResource {

@ClassName(tooltip)
String getToolTipStyleName();


}

}


public class RichToolTipResources {

private static RichToolTipClientBundle INSTANCE;

public static final RichToolTipClientBundle getBundle() {

if (INSTANCE == null) {

INSTANCE = GWT.create(RichToolTipClientBundle.class);

INSTANCE.getCss().ensureInjected();

// or StyleInjector.inject(INSTANCE.getCss().getText(),
true);
}
return INSTANCE;
}
}

In your css...

@sprite .tooltip {
gwt-image: 'tooltipTopLeft';

}

then:

public ToolTip extends Composite {

// injects the css...
private RichToolTipClientBundle resources =
RichToolTipResources.getBundle();

public ToolTip() {
FlowPanel panel = new FlowPanel();
initWidget(panel);
addStyleName(resources.getCss().getToolTipStyleName());

Image img = new Image(resources.getLogo());
panel.add(img);
}

}

Using these methods makes use of the GWT compiler and all it clever
optimisation such as inlining the images using data-uris when
supported... which help make the page load faster.

Hope this helps,

Cheers,
Dave

On Jan 8, 9:03 am, ale aleee...@gmail.com wrote:
 Hi,
 I can not decide where put some image in a application, image like
 logo, icon for button, ecc.

 Is better put it in css or use the  ImageBundle and
 AbstractImagePrototype?

 I prefer the solution that make the load of the page faster.

 Thanks!

 Bye
 Alessandro
-- 
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: Clone a widget using DOM.clone ?

2010-01-08 Thread DaveC
public class ClonedWidget extends Widget {

public ClonedWidget(Element element) {
setElement(element);
}
}



ClonedWidget myNewWidget = new ClonedWidget(Dom.clone(elementToClone,
true));

Is that the kind of thing you're looking for?

Cheers,
Dave

On Jan 8, 12:07 am, Michael Dausmann mdausm...@gmail.com wrote:
 I wish to programatically clone a widget.  Dom.clone(... allows me to
 retrieve an Element.  Is it possible to create a new widget around
 this Element?  Is there another way of cloning the Widget?
-- 
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: Injected CSS rules are evaluated after onModuleLoad/Widget#onLoad

2010-01-08 Thread DaveC
Have you tried StyleInjector.inject(cssText, true) ...?

 the DOM will be updated immediately instead of just before returning
to the event loop. Using this option excessively will decrease
performance, especially if used with an inject-css-on-init coding
pattern

I had a similar problem using the gwt-fx library (which parses the
stylesheets in the DOM looking for selectors I passed in) the styles
weren't injected in time.

Cheers,
Dave

On Jan 8, 4:39 pm, Sebastian Beigel sebast...@beigel.de wrote:
 I found a work around, I wrapped the positioning code in my onLoad()
 method in a DeferredCommand and it works. Is this the preferred
 solution for this problem?

 Sebastian





 On Fri, Jan 8, 2010 at 4:38 PM, Sebastian Beigel sebast...@beigel.de wrote:
  Hi,

  I tried to follow the best practices and moved my static CSS files
  from style-tags in the HTML-page to CssResources in a ClientBundle
  declared in my EntryPoint and injected in a static initializer.

  Unfortunately, this doesn't work for me because I do some element
  positioning in an onLoad-method of a Widget (which is contained in the
  UIBinder template of my EntryPoint). The calculations of the
  (relative) positions are wrong and I found out that the injected CSS
  rules are not evaluated until my positioning code runs.
  Profiling the generated JS code shows the following timing:

  - entering onModuleLoad
  - entering Widget#onLoad
  - leaving onLoad
  - leading onModuleLoad
  - injecting CSS

  Tested in Webkit and Firefox 3.5 on a Mac with Snow Leopard.

  If I defer the positioning (by triggering it manually via a Button
  click in the UI) everything works as expected.

  Is this a bug? Is there a work-around? I really don't want to move my
  CSS back to static files and lose all the great advantages from using
  ClientBundles. But I need my CSS rules parsed and evaluated *before*
  my code runs.

  Thank you,
  Sebastian

 --
 Sebastian Beigelhttp://beigel.de/sebastian
-- 
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.




Trying to Implement HTML5 Drag And Drop API

2010-01-07 Thread DaveC
OK,

So far I have a working implementation in Firefox 3.0 - 3.6 (using
Gears for  3.6) and Chrome which allows me to capture (and inspect) a
file when it's dragged from the desktop and dropped into the browser.

I'm now trying to get an implementation working in IE (using Gears) -
but I feel a bit like Alice tumbling down the rabbit hole...

I've followed the same process (which seems quite complex, and long
winded) for the Chrome and Mozilla implementations...
1. Create a new DOMImplIE6.class...
2. Create HasDropTargetHandlers, DropEvent, DropHandler etc, etc...

But the events don't appear to be fired (at the DOMImpl... level) they
get to here:

private native void sinkHtml5Events(Element elem, int bits) /*-{

var chMask = (elem.__eventBits || 0) ^ bits;
elem.__eventBits = bits;

if (!chMask) return;

 chMask is always falsey...

Should I even be having to fiddle with what appears to be quite low
level stuff...?

Can anyone help (I know Wave implemented DND from desktop to browser
using GWT - so it must be possible).

Cheers,
Dave
-- 
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: DOMImpl for iPhone: How to do ?

2009-12-31 Thread DaveC
Ah, cool thanks - I've done all that just didn't put the MyDomImpl in
com.google.gwt.user.client.impl...

Cheers,
Dave

On Dec 31, 1:15 am, fvisticot fvisti...@gmail.com wrote:
 Hello,
 I have worked on the pb and i have made some progress !!!

 1. I have overloaded the DOMImpl class. The new overloaded class must
 be in a package named com.google.gwt.user.client.impl
 2. I have created dedicated events (extending DomEvent)
 3. I have created dedicated handlers (extending EventHandler)
 4. I have created dedicated HasHandlers
 5. In my module file i have added:

 replace-with class=com.google.gwt.user.client.impl.MyDomImpl
     when-type-is class=com.google.gwt.user.client.impl.DOMImpl/
     when-property-is name=user.agent value=safari/
 /replace-with

 6. I have created a new Widget implementing the
 public HandlerRegistration addYourHandler(YourHandler handler) {
             return addDomHandler(handler, YourEvent.getType());
         }
 7. My application create the new widget and call the
 addYourHandler...

 ... and it works perfectly...

 Hope it can help...

 On 31 déc, 01:28, DaveC david.andrew.chap...@googlemail.com wrote:



  It seems I'm trying to do the same 
  thinghttp://groups.google.com/group/google-web-toolkit/browse_thread/threa..
  and have come up against the same barriers.

  If I find the answer I'll let you know.

  Cheers,
  Dave

  On Dec 30, 10:23 pm, fvisticot fvisti...@gmail.com wrote:

   I would like to manage the iPhone touchstart touchmove... events with
   a clean solution.
   It seems that i need to create my own DOMImpl for the iPhone and link
   this new DOMImpl to the iPhone userAgent.

   Do i need to recompile the GWT sources for that ?
   It seems that i can not override the DOMImplSafari...so it seems that
   a re-compilation is required...

   I there a document/tuto with the differents mandatory steps to create
   a new DOMImpl ?
   Is there a list of class to implement when adding a new DOMImpl ?
   (DOMImpl, UserAgent.gwt.xml, Creating new DomEvent...)

   Is there allready a DOMImplIphone implementation (GoogleWave is
   available on the iPhonepearhaps are they using a dedicated
   implementation) ??

   Fred.

--

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: DOMImpl for iPhone: How to do ?

2009-12-31 Thread DaveC
Tried to rename the package, but I get an error and a warning:

Error: Method 'eventGetTypeInt(String)' in type
'com.applegreen.gwt.html5.dom.DOMImplMozillaHtml5' is native. Running
the modified program will cause UnsatisfiedLinkError.
Warn: Package 'com.google.gwt.user.client.impl' already exists in this
project in a folder

I guess if I downloaded the GWT source doing this would be straight
forward but I can't do that for this project... I need to stick with
the (2.0) release.

Any other suggestions?

On Dec 31, 9:26 am, DaveC david.andrew.chap...@googlemail.com wrote:
 Ah, cool thanks - I've done all that just didn't put the MyDomImpl in
 com.google.gwt.user.client.impl...

 Cheers,
 Dave

 On Dec 31, 1:15 am, fvisticot fvisti...@gmail.com wrote:



  Hello,
  I have worked on the pb and i have made some progress !!!

  1. I have overloaded the DOMImpl class. The new overloaded class must
  be in a package named com.google.gwt.user.client.impl
  2. I have created dedicated events (extending DomEvent)
  3. I have created dedicated handlers (extending EventHandler)
  4. I have created dedicated HasHandlers
  5. In my module file i have added:

  replace-with class=com.google.gwt.user.client.impl.MyDomImpl
      when-type-is class=com.google.gwt.user.client.impl.DOMImpl/
      when-property-is name=user.agent value=safari/
  /replace-with

  6. I have created a new Widget implementing the
  public HandlerRegistration addYourHandler(YourHandler handler) {
              return addDomHandler(handler, YourEvent.getType());
          }
  7. My application create the new widget and call the
  addYourHandler...

  ... and it works perfectly...

  Hope it can help...

  On 31 déc, 01:28, DaveC david.andrew.chap...@googlemail.com wrote:

   It seems I'm trying to do the same 
   thinghttp://groups.google.com/group/google-web-toolkit/browse_thread/threa..
   and have come up against the same barriers.

   If I find the answer I'll let you know.

   Cheers,
   Dave

   On Dec 30, 10:23 pm, fvisticot fvisti...@gmail.com wrote:

I would like to manage the iPhone touchstart touchmove... events with
a clean solution.
It seems that i need to create my own DOMImpl for the iPhone and link
this new DOMImpl to the iPhone userAgent.

Do i need to recompile the GWT sources for that ?
It seems that i can not override the DOMImplSafari...so it seems that
a re-compilation is required...

I there a document/tuto with the differents mandatory steps to create
a new DOMImpl ?
Is there a list of class to implement when adding a new DOMImpl ?
(DOMImpl, UserAgent.gwt.xml, Creating new DomEvent...)

Is there allready a DOMImplIphone implementation (GoogleWave is
available on the iPhonepearhaps are they using a dedicated
implementation) ??

Fred.

--

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: DOMImpl for iPhone: How to do ?

2009-12-31 Thread DaveC
Ignored those warnings/errors and renamed anyway it it compiled/runs
in hosted mode fine...

The only problem is that the events aren't being captured (or the
handlers aren't being added correctly)... would you be able to post
one of your Event classes?

Cheers,
DaveC

On Dec 31, 1:45 pm, DaveC david.andrew.chap...@googlemail.com wrote:
 Tried to rename the package, but I get an error and a warning:

 Error: Method 'eventGetTypeInt(String)' in type
 'com.applegreen.gwt.html5.dom.DOMImplMozillaHtml5' is native. Running
 the modified program will cause UnsatisfiedLinkError.
 Warn: Package 'com.google.gwt.user.client.impl' already exists in this
 project in a folder

 I guess if I downloaded the GWT source doing this would be straight
 forward but I can't do that for this project... I need to stick with
 the (2.0) release.

 Any other suggestions?

 On Dec 31, 9:26 am, DaveC david.andrew.chap...@googlemail.com wrote:



  Ah, cool thanks - I've done all that just didn't put the MyDomImpl in
  com.google.gwt.user.client.impl...

  Cheers,
  Dave

  On Dec 31, 1:15 am, fvisticot fvisti...@gmail.com wrote:

   Hello,
   I have worked on the pb and i have made some progress !!!

   1. I have overloaded the DOMImpl class. The new overloaded class must
   be in a package named com.google.gwt.user.client.impl
   2. I have created dedicated events (extending DomEvent)
   3. I have created dedicated handlers (extending EventHandler)
   4. I have created dedicated HasHandlers
   5. In my module file i have added:

   replace-with class=com.google.gwt.user.client.impl.MyDomImpl
       when-type-is class=com.google.gwt.user.client.impl.DOMImpl/
       when-property-is name=user.agent value=safari/
   /replace-with

   6. I have created a new Widget implementing the
   public HandlerRegistration addYourHandler(YourHandler handler) {
               return addDomHandler(handler, YourEvent.getType());
           }
   7. My application create the new widget and call the
   addYourHandler...

   ... and it works perfectly...

   Hope it can help...

   On 31 déc, 01:28, DaveC david.andrew.chap...@googlemail.com wrote:

It seems I'm trying to do the same 
thinghttp://groups.google.com/group/google-web-toolkit/browse_thread/threa..
and have come up against the same barriers.

If I find the answer I'll let you know.

Cheers,
Dave

On Dec 30, 10:23 pm, fvisticot fvisti...@gmail.com wrote:

 I would like to manage the iPhone touchstart touchmove... events with
 a clean solution.
 It seems that i need to create my own DOMImpl for the iPhone and link
 this new DOMImpl to the iPhone userAgent.

 Do i need to recompile the GWT sources for that ?
 It seems that i can not override the DOMImplSafari...so it seems that
 a re-compilation is required...

 I there a document/tuto with the differents mandatory steps to create
 a new DOMImpl ?
 Is there a list of class to implement when adding a new DOMImpl ?
 (DOMImpl, UserAgent.gwt.xml, Creating new DomEvent...)

 Is there allready a DOMImplIphone implementation (GoogleWave is
 available on the iPhonepearhaps are they using a dedicated
 implementation) ??

 Fred.

--

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: DOMImpl for iPhone: How to do ?

2009-12-31 Thread DaveC
..also I override the eventGetTypeInt(String) method in order to add
the html5 drag and drop events, is this what you did?

Cheers,
Dave

On Dec 31, 2:16 pm, DaveC david.andrew.chap...@googlemail.com wrote:
 Ignored those warnings/errors and renamed anyway it it compiled/runs
 in hosted mode fine...

 The only problem is that the events aren't being captured (or the
 handlers aren't being added correctly)... would you be able to post
 one of your Event classes?

 Cheers,
 DaveC

 On Dec 31, 1:45 pm, DaveC david.andrew.chap...@googlemail.com wrote:



  Tried to rename the package, but I get an error and a warning:

  Error: Method 'eventGetTypeInt(String)' in type
  'com.applegreen.gwt.html5.dom.DOMImplMozillaHtml5' is native. Running
  the modified program will cause UnsatisfiedLinkError.
  Warn: Package 'com.google.gwt.user.client.impl' already exists in this
  project in a folder

  I guess if I downloaded the GWT source doing this would be straight
  forward but I can't do that for this project... I need to stick with
  the (2.0) release.

  Any other suggestions?

  On Dec 31, 9:26 am, DaveC david.andrew.chap...@googlemail.com wrote:

   Ah, cool thanks - I've done all that just didn't put the MyDomImpl in
   com.google.gwt.user.client.impl...

   Cheers,
   Dave

   On Dec 31, 1:15 am, fvisticot fvisti...@gmail.com wrote:

Hello,
I have worked on the pb and i have made some progress !!!

1. I have overloaded the DOMImpl class. The new overloaded class must
be in a package named com.google.gwt.user.client.impl
2. I have created dedicated events (extending DomEvent)
3. I have created dedicated handlers (extending EventHandler)
4. I have created dedicated HasHandlers
5. In my module file i have added:

replace-with class=com.google.gwt.user.client.impl.MyDomImpl
    when-type-is class=com.google.gwt.user.client.impl.DOMImpl/
    when-property-is name=user.agent value=safari/
/replace-with

6. I have created a new Widget implementing the
public HandlerRegistration addYourHandler(YourHandler handler) {
            return addDomHandler(handler, YourEvent.getType());
        }
7. My application create the new widget and call the
addYourHandler...

... and it works perfectly...

Hope it can help...

On 31 déc, 01:28, DaveC david.andrew.chap...@googlemail.com wrote:

 It seems I'm trying to do the same 
 thinghttp://groups.google.com/group/google-web-toolkit/browse_thread/threa..
 and have come up against the same barriers.

 If I find the answer I'll let you know.

 Cheers,
 Dave

 On Dec 30, 10:23 pm, fvisticot fvisti...@gmail.com wrote:

  I would like to manage the iPhone touchstart touchmove... events 
  with
  a clean solution.
  It seems that i need to create my own DOMImpl for the iPhone and 
  link
  this new DOMImpl to the iPhone userAgent.

  Do i need to recompile the GWT sources for that ?
  It seems that i can not override the DOMImplSafari...so it seems 
  that
  a re-compilation is required...

  I there a document/tuto with the differents mandatory steps to 
  create
  a new DOMImpl ?
  Is there a list of class to implement when adding a new DOMImpl ?
  (DOMImpl, UserAgent.gwt.xml, Creating new DomEvent...)

  Is there allready a DOMImplIphone implementation (GoogleWave is
  available on the iPhonepearhaps are they using a dedicated
  implementation) ??

  Fred.

--

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: Having Trouble Extending MouseEvent...

2009-12-31 Thread DaveC
OK I've got a little further now: I've create a new DOMImpl... class
and overridden the eventGetTypeInt(String) method. everything compiles/
runs in hosted mode without errors - but no drag/drop events get
captured - it's like they haven't been added...

Here's my DropEvent class...

public class DropEvent extends DomEventDropHandler {

/**
 * Event type for drop events. Represents the meta-data associated
with this
 * event.
 */
private static final TypeDropHandler TYPE = new TypeDropHandler
(drop,
new DropEvent());

/**
 * Gets the event type associated with drop events.
 *
 * @return the handler type
 */
public static TypeDropHandler getType() {
return TYPE;
}

/**
 * Protected constructor, use
 * {...@link DomEvent#fireNativeEvent
(com.google.gwt.dom.client.NativeEvent,
com.google.gwt.event.shared.HasHandlers)}
 * to fire drop events.
 */
protected DropEvent() {
}

@Override
public TypeDropHandler getAssociatedType() {
return TYPE;
}

@Override
protected void dispatch(DropHandler handler) {
handler.onDrop(this);
}

}


... is there something I'm missing... and my DOMImpl class:

public class DOMImplMozillaHtml5 extends DOMImplMozillaOld {

  public native int eventGetTypeInt(String eventType) /*-{
switch (eventType) {
case blur: return 0x01000;
case change: return 0x00400;
case click: return 0x1;
case dblclick: return 0x2;
case focus: return 0x00800;
case keydown: return 0x00080;
case keypress: return 0x00100;
case keyup: return 0x00200;
case load: return 0x08000;
case losecapture: return 0x02000;
case mousedown: return 0x4;
case mousemove: return 0x00040;
case mouseout: return 0x00020;
case mouseover: return 0x00010;
case mouseup: return 0x8;
case scroll: return 0x04000;
case error: return 0x1;
case mousewheel: return 0x2;
case DOMMouseScroll: return 0x2;
case contextmenu: return 0x4;
case paste: return 0x8;
case drop: return 0x1;
case dragdrop: return 0x1;
case dragleave: return 0x1;
case dragover: return 0x1;
case dragenter: return 0x1;
}
  }-*/;

}

On Dec 31, 12:24 am, DaveC david.andrew.chap...@googlemail.com
wrote:
 OK, From what I have since found out is that *all* the native browser
 events are stored in a JSNI method in the DOMImpl class here
 DOMImpl.eventGetTypeInt(String name)... which is why the exception was
 being thrown (there is no drop, dragenter, etc events defined).

 So in order to add the new html5 events I would need to add my own
 DOMImpl class... which I can't seem to do... I appear to be trying to
 accomplish the same task as the person posting 
 herehttp://groups.google.com/group/google-web-toolkit/browse_thread/threa...

 This doesn't appear to be possible (or at least simple or obvious or
 documented)...

 Its frustrating for me as I've already written the (few lines of)
 javascript code to do this - I'm using GWT for a project so really I
 need a GWT implementation...

 Do any of the GWT experts have any suggestions??

 On Dec 30, 4:24 pm, DaveC david.andrew.chap...@googlemail.com wrote:



  I'm probably not doing this the right way but, I've been trying to
  extend MouseEvent to support HTML5 Drag and Drop (drag, dragenter,
  etc. etc.).

  I've created a:

  Has...Handlers interface
  bunch of Handler classes (DropHandler, DragEnterHandler, etc)
  and a bunch of Event classes that extend MouseEvent (DropEvent,
  DragEnterEvent, etc).

  I've also created a DropTarget Widget that implements the
  Has...Handlers interface which accepts a Widget as a param in its
  contructor which then calls setElement() passing in widget.getElement
  ()...

  I then add this DropTarget to the RootPanel (for testing purposes) in
  an onModuleLoad.

  But I'm getting a low level error (Something other than an int was
  returned from JSNI method):

  com.google.gwt.dev.shell.HostedModeException: Something other than an
  int was returned from JSNI method
  '@com.google.gwt.user.client.impl.domimpl::eventGetTypeInt(Ljava/lang/
  String;)': JS value of type undefined, expected int
      at com.google.gwt.dev.shell.JsValueGlue.getIntRange
  (JsValueGlue.java:266)
      at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt
  (ModuleSpace.java:242)
      at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt
  (JavaScriptHost.java:75

Having Trouble Extending MouseEvent...

2009-12-30 Thread DaveC
I'm probably not doing this the right way but, I've been trying to
extend MouseEvent to support HTML5 Drag and Drop (drag, dragenter,
etc. etc.).

I've created a:

Has...Handlers interface
bunch of Handler classes (DropHandler, DragEnterHandler, etc)
and a bunch of Event classes that extend MouseEvent (DropEvent,
DragEnterEvent, etc).

I've also created a DropTarget Widget that implements the
Has...Handlers interface which accepts a Widget as a param in its
contructor which then calls setElement() passing in widget.getElement
()...

I then add this DropTarget to the RootPanel (for testing purposes) in
an onModuleLoad.

But I'm getting a low level error (Something other than an int was
returned from JSNI method):

com.google.gwt.dev.shell.HostedModeException: Something other than an
int was returned from JSNI method
'@com.google.gwt.user.client.impl.DOMImpl::eventGetTypeInt(Ljava/lang/
String;)': JS value of type undefined, expected int
at com.google.gwt.dev.shell.JsValueGlue.getIntRange
(JsValueGlue.java:266)
at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt
(ModuleSpace.java:242)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt
(JavaScriptHost.java:75)
at com.google.gwt.user.client.impl.DOMImpl.eventGetTypeInt
(DOMImpl.java)
at com.google.gwt.user.client.Event$.getTypeInt(Event.java:491)
at com.google.gwt.user.client.ui.Widget.addDomHandler(Widget.java:
184)
at
com.applegreen.gwt.html5.dnd.client.DropTarget.addDragEnterHandler
(DropTarget.java:44)
at com.applegreen.gwt.test.client.DragAndDropTest.onModuleLoad
(DragAndDropTest.java:46)
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.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:
369)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule
(OophmSessionHandler.java:185)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection
(BrowserChannelServer.java:380)
at com.google.gwt.dev.shell.BrowserChannelServer.run
(BrowserChannelServer.java:222)
at java.lang.Thread.run(Unknown Source)

Can anyone shed any light on what I'm doing wrong or what method I
should have overidden (I'm not a java programmer btw)??

Cheers,
Dave

--

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: Having Trouble Extending MouseEvent...

2009-12-30 Thread DaveC
OK, From what I have since found out is that *all* the native browser
events are stored in a JSNI method in the DOMImpl class here
DOMImpl.eventGetTypeInt(String name)... which is why the exception was
being thrown (there is no drop, dragenter, etc events defined).

So in order to add the new html5 events I would need to add my own
DOMImpl class... which I can't seem to do... I appear to be trying to
accomplish the same task as the person posting here
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/560ff832885745b0#

This doesn't appear to be possible (or at least simple or obvious or
documented)...

Its frustrating for me as I've already written the (few lines of)
javascript code to do this - I'm using GWT for a project so really I
need a GWT implementation...

Do any of the GWT experts have any suggestions??

On Dec 30, 4:24 pm, DaveC david.andrew.chap...@googlemail.com wrote:
 I'm probably not doing this the right way but, I've been trying to
 extend MouseEvent to support HTML5 Drag and Drop (drag, dragenter,
 etc. etc.).

 I've created a:

 Has...Handlers interface
 bunch of Handler classes (DropHandler, DragEnterHandler, etc)
 and a bunch of Event classes that extend MouseEvent (DropEvent,
 DragEnterEvent, etc).

 I've also created a DropTarget Widget that implements the
 Has...Handlers interface which accepts a Widget as a param in its
 contructor which then calls setElement() passing in widget.getElement
 ()...

 I then add this DropTarget to the RootPanel (for testing purposes) in
 an onModuleLoad.

 But I'm getting a low level error (Something other than an int was
 returned from JSNI method):

 com.google.gwt.dev.shell.HostedModeException: Something other than an
 int was returned from JSNI method
 '@com.google.gwt.user.client.impl.domimpl::eventGetTypeInt(Ljava/lang/
 String;)': JS value of type undefined, expected int
     at com.google.gwt.dev.shell.JsValueGlue.getIntRange
 (JsValueGlue.java:266)
     at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
     at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt
 (ModuleSpace.java:242)
     at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt
 (JavaScriptHost.java:75)
     at com.google.gwt.user.client.impl.DOMImpl.eventGetTypeInt
 (DOMImpl.java)
     at com.google.gwt.user.client.Event$.getTypeInt(Event.java:491)
     at com.google.gwt.user.client.ui.Widget.addDomHandler(Widget.java:
 184)
     at
 com.applegreen.gwt.html5.dnd.client.DropTarget.addDragEnterHandler
 (DropTarget.java:44)
     at com.applegreen.gwt.test.client.DragAndDropTest.onModuleLoad
 (DragAndDropTest.java:46)
     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.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:
 369)
     at com.google.gwt.dev.shell.OophmSessionHandler.loadModule
 (OophmSessionHandler.java:185)
     at com.google.gwt.dev.shell.BrowserChannelServer.processConnection
 (BrowserChannelServer.java:380)
     at com.google.gwt.dev.shell.BrowserChannelServer.run
 (BrowserChannelServer.java:222)
     at java.lang.Thread.run(Unknown Source)

 Can anyone shed any light on what I'm doing wrong or what method I
 should have overidden (I'm not a java programmer btw)??

 Cheers,
 Dave

--

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: DOMImpl for iPhone: How to do ?

2009-12-30 Thread DaveC
It seems I'm trying to do the same thing
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/e1c6bd5a5d196ecf...
and have come up against the same barriers.

If I find the answer I'll let you know.

Cheers,
Dave

On Dec 30, 10:23 pm, fvisticot fvisti...@gmail.com wrote:
 I would like to manage the iPhone touchstart touchmove... events with
 a clean solution.
 It seems that i need to create my own DOMImpl for the iPhone and link
 this new DOMImpl to the iPhone userAgent.

 Do i need to recompile the GWT sources for that ?
 It seems that i can not override the DOMImplSafari...so it seems that
 a re-compilation is required...

 I there a document/tuto with the differents mandatory steps to create
 a new DOMImpl ?
 Is there a list of class to implement when adding a new DOMImpl ?
 (DOMImpl, UserAgent.gwt.xml, Creating new DomEvent...)

 Is there allready a DOMImplIphone implementation (GoogleWave is
 available on the iPhonepearhaps are they using a dedicated
 implementation) ??

 Fred.

--

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: GWT CSS3 sitting in a tree...

2009-10-20 Thread DaveC

Thanks for your reply Thomas.

Unfortunately this is as I expected.

WRT the vendor specific extentions I agree they aren't errors so why
does the spec suggest to handle them that way (why strip them when
they are not errors - if they're not errors leave them alone!)?

I'm not a Java programmer - but I can write a bit - so patching Flute,
CSSParser and GWT is probably beyond my knowledge - but maybe I'll
have a go at writing something in Javascript first and then port it to
Java!

On Oct 19, 4:15 pm, Thomas Broyer t.bro...@gmail.com wrote:
 On 19 oct, 11:38, DaveC david.andrew.chap...@googlemail.com wrote:

  I'm trying to use some css3 media queries in my GWT app via a
  CssResource and StyleInjector e.g.

  @media screen and (color) {

  ...

  }

  Unfortunately GWT’s CssResource doesn't yet support this - it strips
  out the bit it doesn't understand and outputs:

  @MEDIA screen{}

  …removing any rules I declared inside.

 Your @media rule is not valid CSS 2.1 (it only accepts comma-separated
 media, each medium being an identifier), and GWT (Flute, actually)
 expectedly chokes on the and:
 [WARN] Line 7 column 14: encountered and. Was expecting one of: {
 ,

 Seehttp://www.w3.org/TR/CSS21/grammar.html
 Your @media rule is CSS3 media 
 queries-style:http://www.w3.org/TR/css3-mediaqueries/
 which Flute(the CSS aprser used by GWT) doesn't support
 (unfortunately, CSSParser doesn't either AFAICT).

  I also came across a similar thing when trying to use vendor
  specific extensions, but found a working around that caused the GWT
  compiler to ignore them (I escaped the starting hyphen e.g. \-moz-
  inline-box).

 Yes, it's because Flute is somewhat outdated (supports CSS 2.0 but not
 CSS 2.1):http://code.google.com/p/google-web-toolkit/issues/detail?id=3595#c3

  I find the W3C spec a bit ambiguous:

  Quote: An initial dash or underscore is guaranteed never to be used
  in a property or keyword by any current or future level of CSS. Thus
  typical CSS implementations may not recognize such properties and may
  ignore them according to the rules for handling parsing
  errors.  (Note usage of may and may not - are they errors or
  not?)

 They're not errors.

  My question is does anyone know of a way I can get the GWT Compiler to
  recognise my media queries?

 Apart from patching Flute (or rather CSSParser and then GWT, to use
 CSSParser instead of Flute), I don't see.
--~--~-~--~~~---~--~~
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 CSS3 sitting in a tree...

2009-10-19 Thread DaveC

I'm trying to use some css3 media queries in my GWT app via a
CssResource and StyleInjector e.g.

@media screen and (color) {

...

}

Unfortunately GWT’s CssResource doesn't yet support this - it strips
out the bit it doesn't understand and outputs:

@MEDIA screen{}

…removing any rules I declared inside.

I also came across a similar thing when trying to use vendor
specific extensions, but found a working around that caused the GWT
compiler to ignore them (I escaped the starting hyphen e.g. \-moz-
inline-box).

I find the W3C spec a bit ambiguous:

Quote: An initial dash or underscore is guaranteed never to be used
in a property or keyword by any current or future level of CSS. Thus
typical CSS implementations may not recognize such properties and may
ignore them according to the rules for handling parsing
errors.  (Note usage of may and may not - are they errors or
not?)

So...

My question is does anyone know of a way I can get the GWT Compiler to
recognise my media queries?

Cheers,
Dave
--~--~-~--~~~---~--~~
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: Wait until widget is ready

2009-10-19 Thread DaveC

Hi Michael,

The Widget.onLoad method should be called after its attached to the
document (rendered)...

Assuming that you have a MyComponent inside a ScrollPanel, perhaps
try this in your MyComponent:

@Override
public onLoad() {

Widget parent = getParent();

if (parent != null  parent.isAttached()  parent.isVisible
()) {
 // set parent scrollPosition...
}
}

How are you calculating the scollPosition?

Cheers,
Dave

On Oct 19, 11:27 am, grue michael.gruetz...@googlemail.com wrote:
 Hi,

 I have placed a GWT component within my web application which contains
 a ScrollPanel. The initial scroll position
 should be set when the page is loaded. Now the problem is that this
 will only work when the content of the ScrollPanel
 is ready (so there actually is anything scrollable inside the panel).
 When I call the setScrollPosition() in the constructor of my component
 nothing happens because the component is
 not rendered yet (there is no async stuff in my component).
 How can I execute any method after a component is rendered? I have
 tried window.onload but it doesn't seem to work.
 Also Widget.onLoad() is called before the widget is rendered.

 Thanks in advance for any hints.
 Michael
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---