Balloon-widget for GWT

2.2k views Asked by At

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?

2

There are 2 answers

0
Drejc On BEST ANSWER

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;
 }
2
DonX On

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.