Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.jboss.errai.demo.grocery.client.local;
  
  
 
A container that can hold a widget and show and hide itself on demand. The appearance is based on (and depends on) the Twitter Bootstrap stylesheet collection. It does not require jQuery or the Bootstrap jquery.popup.js plugin (it is a GWT-based replacement for that plugin).

Author(s):
Jonathan Fuerth <jfuerth@gmail.com>
 
 public class PopoverContainer extends Composite {

  
This is the widget that contains the user-supplied title we show in the popover.
 
   private DivElement popoverTitle = Document.get().createDivElement();

  
This is the widget that contains the user-supplied content we show in the popover.
 
   private VerticalPanel popoverContent;

  
Positions the popover so that its arrow points at the centre of the given widget Makes the popover visible

Parameters:
positionNear
 
   public void show(Widget positionNear) {
     getElement().getStyle().setLeft(positionNear.getAbsoluteLeft() + positionNear.getOffsetWidth(), .);
             positionNear.getAbsoluteTop() + positionNear.getOffsetHeight() / 2
             - getElement().getOffsetHeight() / 2, .);
   }

  
Causes this popover to become invisible.
 
   public void hide() {
   }

  
Sets the widget that will be displayed as the title of this popover, replacing any existing title widget.
 
   public void setTitleHtml(SafeHtml html) {
   }

  
Sets the widget that will be displayed as the title of this popover, replacing any existing body widget.
 
   public void setBodyWidget(Widget bodyWidget) {
     .clear();
     .add(bodyWidget);
   }

  
Adds this popover to the document so it can be made visible. This method is called automatically when this bean is created.
 
   @SuppressWarnings("unused")
   private void init() {
     RootPanel.get().add(this);
   }

  
Removes this popover from the document so it does not leak resources. This method is called automatically when this bean is destroyed.
 
   @SuppressWarnings("unused")
   private void destroy() {
     RootPanel.get().remove(this);
   }
New to GrepCode? Check out our FAQ X