Question

I'm searching for a balloon-like widget for a GWT application, e.g. like the balloons Google Maps shows when displaying search results on a map.

When searching I only found Javascript widgets, but aren't there any widgets to use in GWT?

Was it helpful?

Solution

Take a look at OverLib. It is an open source javascript lib to show enhanced pop up hint windows. It can be easy integrated into GWT. Plus you have the freedom to create you own HTML pop ups.

Here is a snippet of my over lib helper code (overlib must be unpacked into the public folder of your GWT project). The attributes produced with getSimpleToolTip are just added to your GWT elements:

    public static String getSimpleToolTip(String text, Integer width, Integer height)
 {
  String alt = "onmouseout=\"" + getOnMouseOutAttribute() + "\""; 
  alt = alt + " onmouseover=\"" + getOnMouseOverAttribute(text, width, height) + "\"";
  return alt;
 }

 public static String getOnMouseOutAttribute()
 {
  return "return nd();"; 
 }

 public static String getOnMouseOverAttribute(String text, Integer width, Integer height)
 {
  String out = "return overlib('" + text + "'";
  out = out + ", DELAY, 750";

  if (width != null)
  {
   out = out + ", WIDTH, " + width.toString();
  }

  if (height != null)
  {
   out = out + ", HEIGHT, " + height.toString();
  }

  out = out + ");";

  return out;
 }

OTHER TIPS

In GWT create your own widget with the help of popup panel.Have image like baloon (Image background should be transparent) and set it as a popup panel background.After that depends on your requirement add your results like "A","B",etc... as a label in popup panel.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top