Re: Feature Detection

2016-06-21 Thread Thomas Broyer
What about laptops with touch screens? (Surface, Chrome Pixel, etc.) Maybe the 
user will use the mouse primarily in those? Maybe not?

I seem to remember that touch-enabled couldn't be detected, because one could 
also just plug a touch screen to the device while the browser is open (and a 
page loaded!)
So this is likely to generate a lot of false positives.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: SimplePanel can only contain one child widget

2016-06-21 Thread 'Janine Joachim' via GWT Users
Diagram is not a SimplePanel, its an AbsolutePanel. Diagram is a class by 
libary gwt-connectors.
Maybe something is wrong with my Initializing? When i do this inside the 
clickevent no error occurs. But then i cannot use my diagramlistener...


-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: SimplePanel can only contain one child widget

2016-06-21 Thread Gilberto
AbsolutePanel is not a SimplePanel, so the problem isn't there. I guess it 
is something related to your own domain classes - maybe Diagram.

You can also use the browser debugger to see exactly where the error occurs.


>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT Material Design Addins

2016-06-21 Thread Gilberto
By the way Thomas you can use subpackages after the namespace declaration 
in UIBinder (GWT Material uses all the time):


xmlns:ma="urn:import:gwt.material.design.addins.client"

https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Feature Detection

2016-06-21 Thread Gilberto
This is what I do:

public static native boolean isOnTouchDevice()/*-{
return 'ontouchstart' in window || navigator.maxTouchPoints;
}-*/;

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


SimplePanel can only contain one child widget

2016-06-21 Thread 'Janine Joachim' via GWT Users

up vote
down votefavorite 


When i run the following Code and push Button "Push", more than once a 
time, i get browser error "simplePanel can only contain one child widget". 
How can i solve that problem? thank you in advance! Jogi

public class Projekt implements EntryPoint {

private RootPanel rootPanel;

public void onModuleLoad() {

rootPanel = RootPanel.get("gwtContainer");
rootPanel.setSize("1902", "868");

 final AbsolutePanel boundaryPanel = new AbsolutePanel();
 boundaryPanel.setStyleName("frame1");
 boundaryPanel.setSize("1455px", "600px");   

 final Diagram diagram = new Diagram(boundaryPanel);

 RootPanel.get().add(boundaryPanel, 446, 242);


 final Connector con = new Connector(100, 300, 300, 500);

 Button la = new Button("Push");
 la.setSize("200", "200");
 RootPanel.get().add(la);

 Button la2 = new Button("Push2");
 la2.setSize("200", "200");
 RootPanel.get().add(la2);

 final Image img = new Image("images/concrete.svg");
 img.setSize("200", "200");


 final Shape shapei = new Shape(img);


 Image img2 = new Image("images/variable.svg");
 img2.setSize("200", "200");
 boundaryPanel.add(img2, 200,200);

 final Shape shapei2 = new Shape(img2);
 shapei2.showOnDiagram(diagram);

 la.addClickHandler(new ClickHandler(){

@Override
public void onClick(ClickEvent event) {
 boundaryPanel.add(img, 100,100);
 shapei.showOnDiagram(diagram);
}

 });
 la2.addClickHandler(new ClickHandler(){

@Override
public void onClick(ClickEvent event) {

 con.showOnDiagram(diagram);
}

 });


 diagram.addDiagramListener(new DiagramListenerAdapter() {

  @Override
  public void onElementConnect(ElementConnectEvent event) {
if (con.startEndPoint.isGluedToConnectionPoint()) {
Widget connected = 
con.startEndPoint.gluedConnectionPoint.parentWidget;
if(connected.equals(shapei.connectedWidget)){
  Image logo = new Image("images/xor.svg");
  logo.setSize("100", "100");
  boundaryPanel.add(logo);
}
else if(connected.equals(shapei2.connectedWidget)){
 Image logo2 = new Image("images/and.svg");
  logo2.setSize("100", "100");
  boundaryPanel.add(logo2);
};
  }}
});

}}

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT 2.8 and Guava 20

2016-06-21 Thread Thomas Broyer


On Tuesday, June 21, 2016 at 3:59:51 PM UTC+2, Johan Falk wrote:
>
> While not only a GWT question, I thought this was the best place to ask. 
> I've got an GWT 2.7 application which is being upgraded to 2.8. I'm using 
> one of the latest snapshot (2.8.0-269) together with Guava 
> (20.0.220-SNAPSHOT).
>
> The problem is I get the same type of error that is mentioned in this 
> issue: https://github.com/gwtproject/gwt/issues/9323, but just adding 
> both error_prone_annotations and j2objc-annotations jars to the classpath 
> when running the CodeServer doesn't seem to work for me.
>
> I did get it working by manually adding a GWT module file 
> (Annotations.gwt.xml) to both jars, which just sets the source path:
> 
> 
>
> 
> 
> 
> 
>
> And then add then reference this in my main Module file:
> 
> 
>
> But I would like to avoid manually modifying those jars (as that makes 
> each upgrade more of a pain, and I need to upload the modified jars to our 
> maven repository instead of just mirroring the existing ones). Anyone have 
> any idea what I'm missing?
>

No idea why GWT complains, but just a note in passing that you don't have 
to "patch" the JARs: GWT works from the classpath, so it only matters that 
the Annotations.gwt.xml files exist in the 
com.google.errorprone.annotations and com.google.j2objc.annotations 
packages, whichever the exact location "on disk"; so they can just live in 
your app sources, or for example in small JARs deployed to your Maven repo, 
that would depend on the error_prone_annotations and j2objc-annotations 
source JARs. 

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


GWT 2.8 and Guava 20

2016-06-21 Thread Johan Falk
While not only a GWT question, I thought this was the best place to ask. 
I've got an GWT 2.7 application which is being upgraded to 2.8. I'm using 
one of the latest snapshot (2.8.0-269) together with Guava 
(20.0.220-SNAPSHOT).

The problem is I get the same type of error that is mentioned in this 
issue: https://github.com/gwtproject/gwt/issues/9323, but just adding both 
error_prone_annotations 
and j2objc-annotations jars to the classpath when running the CodeServer 
doesn't seem to work for me.

I did get it working by manually adding a GWT module file 
(Annotations.gwt.xml) to both jars, which just sets the source path:








And then add then reference this in my main Module file:



But I would like to avoid manually modifying those jars (as that makes each 
upgrade more of a pain, and I need to upload the modified jars to our maven 
repository instead of just mirroring the existing ones). Anyone have any 
idea what I'm missing?

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Feature Detection

2016-06-21 Thread Frank
https://github.com/kaimallea/isMobile

Just wrap this in GWT

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.