org.wings
Class SPopup

java.lang.Object
  extended by org.wings.SComponent
      extended by org.wings.SPopup
All Implemented Interfaces:
Serializable, Cloneable, Renderable

public class SPopup
extends SComponent

Popups are used to display a SComponent to the user, typically on top of all the other SComponents in a particular containment hierarchy.

The general contract is that if you need to change the size of the SComponent, or location of the SPopup, you should obtain a new Popup.

SPopup does not descend from SComponent, rather implementations of SPopup are responsible for creating and maintaining their own SComponents to render the requested SComponent to the user.

Author:
Christian Schyma
See Also:
Serialized Form

Field Summary
static String BOTTOM_LEFT
           
static String BOTTOM_RIGHT
           
static String TOP_LEFT
           
static String TOP_RIGHT
           
 
Fields inherited from class org.wings.SComponent
DONE_RENDERING, dynamicStyles, enabled, propertyChangeSupport, SELECTOR_ALL, START_RENDERING, visible, WHEN_FOCUSED_OR_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_FRAME
 
Constructor Summary
SPopup(SComponent owner, SComponent contents, int x, int y)
          Creates a SPopup.
 
Method Summary
protected  void finalize()
           
 SComponent getComponent()
          Returns the Component returned from createComponent that will hold the Popup.
 String getContentsCorner()
           
 SComponent getContext()
           
 String getContextCorner()
           
 int getHeight()
           
 SComponent getOwner()
           
 int getWidth()
           
 int getX()
           
 int getY()
           
 boolean isAnchored()
           
 void setContext(SComponent context, String contentsCorner, String contextCorner)
          Anchors the popup to the the given component context.
 
Methods inherited from class org.wings.SComponent
addComponentListener, addDynamicStyle, addEventListener, addNotify, addParentFrameListener, addPropertyChangeListener, addPropertyChangeListener, addRenderListener, addScriptListener, addStyle, clone, fireComponentChangeEvent, fireFinalEvents, fireKeyEvents, fireRenderEvent, getActionMap, getBackground, getBorder, getCG, getClientProperty, getComponentPopupMenu, getDynamicStyle, getDynamicStyles, getFocusTraversalIndex, getFont, getForeground, getHorizontalAlignment, getInputMap, getInputMap, getListenerCount, getListenerList, getListeners, getLowLevelEventId, getName, getParent, getParentFrame, getPreferredSize, getRequestURL, getResidesInForm, getScriptListenerList, getScriptListeners, getSession, getShowAsFormComponent, getStyle, getToolTipText, getVerticalAlignment, invite, isDifferent, isEnabled, isFocusOwner, isRecursivelyVisible, isReloadForced, isUpdatePossible, isVisible, paramString, processComponentEvent, processKeyEvents, processLowLevelEvent, putClientProperty, reload, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, removeComponentListener, removeDynamicStyle, removeEventListener, removeNotify, removeParentFrameListener, removePropertyChangeListener, removePropertyChangeListener, removeRenderListener, removeScriptListener, removeStyle, requestFocus, scrollRectToVisible, setActionMap, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setBackground, setBorder, setCG, setComponentPopupMenu, setDynamicStyles, setEnabled, setFocusTraversalIndex, setFont, setForeground, setHorizontalAlignment, setInputMap, setInputMap, setName, setNameRaw, setParent, setParentFrame, setPreferredSize, setReloadForced, setShowAsFormComponent, setStyle, setToolTipText, setVerticalAlignment, setVisible, toString, update, updateCG, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TOP_RIGHT

public static final String TOP_RIGHT
See Also:
Constant Field Values

TOP_LEFT

public static final String TOP_LEFT
See Also:
Constant Field Values

BOTTOM_RIGHT

public static final String BOTTOM_RIGHT
See Also:
Constant Field Values

BOTTOM_LEFT

public static final String BOTTOM_LEFT
See Also:
Constant Field Values
Constructor Detail

SPopup

public SPopup(SComponent owner,
              SComponent contents,
              int x,
              int y)
Creates a SPopup. x and y specify the preferred initial location to place the SPopup at. Based on screen size, or other paramaters, the SPopup may not display at x and y.

N.B.: check that the contents SComponent has a valid preferred size! (getPreferredSize())

Parameters:
owner - owner of component SPopup, if null the root frame will be used
contents - Contents of the Popup
x - Initial x screen coordinate
y - Initial y screen coordinate
Throws:
IllegalArgumentException - if contents is null
Method Detail

setContext

public void setContext(SComponent context,
                       String contentsCorner,
                       String contextCorner)
Anchors the popup to the the given component context.

Parameters:
context - component to be anchored to
contentsCorner - anchor point: e.g. SAnchoredPopup.TOP_LEFT
contextCorner - anchor point: e.g. SAnchoredPopup.BOTTOM_LEFT

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

getComponent

public SComponent getComponent()
Returns the Component returned from createComponent that will hold the Popup.


getContentsCorner

public String getContentsCorner()

getContextCorner

public String getContextCorner()

getHeight

public int getHeight()

getWidth

public int getWidth()

getX

public int getX()

getY

public int getY()

getOwner

public SComponent getOwner()

isAnchored

public boolean isAnchored()

getContext

public SComponent getContext()


wingS Swings ;-)