com.sencha.gxt.widget.core.client
Class Popup

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.container.Container
                  extended by com.sencha.gxt.widget.core.client.container.ResizeContainer
                      extended by com.sencha.gxt.widget.core.client.container.SimpleContainer
                          extended by com.sencha.gxt.widget.core.client.Popup
All Implemented Interfaces:
HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, AcceptsOneWidget, HasOneWidget, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, ProvidesResize, RequiresResize, HasLayout, AddEvent.HasAddHandlers, BeforeAddEvent.HasBeforeAddHandlers, BeforeHideEvent.HasBeforeHideHandlers, BeforeRemoveEvent.HasBeforeRemoveHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, ContainerHandler.HasContainerHandlers, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, MoveEvent.HasMoveHandlers, RemoveEvent.HasRemoveHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, HasFocusSupport, HasItemId, Iterable<Widget>

public class Popup
extends SimpleContainer

A panel that can be displayed over other widgets.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
IndexedPanel.ForIsWidget
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
Popup()
          Creates a new popup panel.
 
Method Summary
 void center()
          Centers the panel within the viewport.
 Style.AnchorAlignment getDefaultAlign()
          Returns the default alignment.
 CompositeElement getIgnoreList()
          Any elements added to this list will be ignored when auto close is enabled.
 int getXOffset()
          Returns the x offset.
 int getYOffset()
          Returns the y offsets.
 void hide()
          Hides the popup.
 boolean isAnimate()
          Returns true if animations are enabled.
 boolean isAutoFocus()
          Returns true if auto focus is enabled.
 boolean isAutoHide()
          Returns true if auto hide is enabled.
 boolean isConstrainViewport()
          Returns true if constrain to viewport is enabled.
 void setAnimate(boolean animate)
          True to enable animations when showing and hiding (defaults to false).
 void setAutoFocus(boolean autoFocus)
          True to move focus to the popup when being opened (defaults to true).
 void setAutoHide(boolean autoHide)
          True to close the popup when the user clicks outside of the menu (default to true).
 void setConstrainViewport(boolean constrainViewport)
          True to ensure popup is displayed within the browser's viewport.
 void setDefaultAlign(Style.AnchorAlignment defaultAlign)
          The default XElement.alignTo(com.google.gwt.dom.client.Element, com.sencha.gxt.core.client.Style.AnchorAlignment, int[]) anchor position value for this menu relative to its element of origin (defaults to "tl-bl?").
 void setXOffset(int xOffset)
          Sets the xOffset when constrainViewport == true (defaults to 10).
 void setYOffset(int yOffset)
          Sets the yOffset when constrainViewport == true (defaults to 15).
 void show()
          Displays the popup.
 void show(Component widget)
          Displays the popup aligned to the bottom left of the widget.
 void show(Element elem, Style.AnchorAlignment pos)
          Displays the popup.
 void show(Element elem, Style.AnchorAlignment pos, int[] offsets)
          Displays the popup.
 void showAt(int x, int y)
          Shows the popup at the specified location.
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.SimpleContainer
add, add, getWidget, isResize, setResize, setWidget, setWidget
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.ResizeContainer
forceLayout, isLayoutRunning, isOrWasLayoutRunning, onResize
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.Container
add, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, clear, disable, enable, findWidget, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove, remove, remove
 
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disableEvents, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, onBrowserEvent, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, sync, syncSize, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Popup

public Popup()
Creates a new popup panel.

Method Detail

center

public void center()
Centers the panel within the viewport.


getDefaultAlign

public Style.AnchorAlignment getDefaultAlign()
Returns the default alignment.

Returns:
the default align

getIgnoreList

public CompositeElement getIgnoreList()
Any elements added to this list will be ignored when auto close is enabled.

Returns:
the list of ignored elements

getXOffset

public int getXOffset()
Returns the x offset.

Returns:
the offset

getYOffset

public int getYOffset()
Returns the y offsets.

Returns:
the offset

hide

public void hide()
Hides the popup.

Overrides:
hide in class Component

isAnimate

public boolean isAnimate()
Returns true if animations are enabled.

Returns:
the animation state

isAutoFocus

public boolean isAutoFocus()
Returns true if auto focus is enabled.

Returns:
the auto focus state

isAutoHide

public boolean isAutoHide()
Returns true if auto hide is enabled.

Returns:
the auto hide state

isConstrainViewport

public boolean isConstrainViewport()
Returns true if constrain to viewport is enabled.

Returns:
the constrain viewport state

setAnimate

public void setAnimate(boolean animate)
True to enable animations when showing and hiding (defaults to false).

Parameters:
animate - true to enable animations

setAutoFocus

public void setAutoFocus(boolean autoFocus)
True to move focus to the popup when being opened (defaults to true).

Parameters:
autoFocus - true for auto focus

setAutoHide

public void setAutoHide(boolean autoHide)
True to close the popup when the user clicks outside of the menu (default to true).

Parameters:
autoHide - true for auto hide

setConstrainViewport

public void setConstrainViewport(boolean constrainViewport)
True to ensure popup is displayed within the browser's viewport.

Parameters:
constrainViewport - true to constrain

setDefaultAlign

public void setDefaultAlign(Style.AnchorAlignment defaultAlign)
The default XElement.alignTo(com.google.gwt.dom.client.Element, com.sencha.gxt.core.client.Style.AnchorAlignment, int[]) anchor position value for this menu relative to its element of origin (defaults to "tl-bl?").

Parameters:
defaultAlign - the default alignment

setXOffset

public void setXOffset(int xOffset)
Sets the xOffset when constrainViewport == true (defaults to 10).

Parameters:
xOffset - the x offset

setYOffset

public void setYOffset(int yOffset)
Sets the yOffset when constrainViewport == true (defaults to 15).

Parameters:
yOffset - the offset

show

public void show()
Displays the popup.

Overrides:
show in class Component

show

public void show(Component widget)
Displays the popup aligned to the bottom left of the widget. For exact control of popup position see show(Element, com.sencha.gxt.core.client.Style.AnchorAlignment, int[]).

Parameters:
widget - the widget to use for alignment

show

public void show(Element elem,
                 Style.AnchorAlignment pos)
Displays the popup.

Parameters:
elem - the element to align to
pos - the position

show

public void show(Element elem,
                 Style.AnchorAlignment pos,
                 int[] offsets)
Displays the popup.

Parameters:
elem - the element to align to
pos - the position
offsets - the offsets

showAt

public void showAt(int x,
                   int y)
Shows the popup at the specified location.

Parameters:
x - the x coordinate
y - the y coordinate


Copyright © 2012. All Rights Reserved.