to.etc.domui.component.layout
Class FloatingWindow

java.lang.Object
  extended by to.etc.domui.dom.css.CssBase
      extended by to.etc.domui.dom.html.NodeBase
          extended by to.etc.domui.dom.html.NodeContainer
              extended by to.etc.domui.dom.html.Div
                  extended by to.etc.domui.component.layout.FloatingWindow
All Implemented Interfaces:
java.lang.Iterable<NodeBase>, IModelBinding, INodeErrorDelegate, IDraggable, IDropTargetable
Direct Known Subclasses:
MsgBox, MultipleSelectionLookup, OddCharacters, SimpleLookup, TreeSelectionWindow

public class FloatingWindow
extends Div

A simple floating window, non-blocking, with a title bar which can be dragged. This also acts as an error fence, limiting all errors generated within this control to be displayed within this window.

Author:
Frits Jalvingh Created on Jul 30, 2008

Constructor Summary
protected FloatingWindow()
           
protected FloatingWindow(boolean modal, java.lang.String txt)
          Create a floating window with the specified title in the title bar.
 
Method Summary
 void close()
          Close this floater and cause it to be destroyed from the UI.
 void closePressed()
          Close the window !AND CALL THE CLOSE HANDLER!.
static FloatingWindow create(NodeBase parent)
          Create and link a modal floating window.
static FloatingWindow create(NodeBase parent, java.lang.String ttl)
           
static FloatingWindow create(NodeBase parent, java.lang.String ttl, boolean modal)
           
 void createContent()
          Create the floater.
protected  NodeContainer createTitleBar()
          Create the title bar for the floater.
 IClicked<FloatingWindow> getOnClose()
          Get the current "onClose" handler.
 java.lang.String getWindowTitle()
          Return the floater's title bar title string.
 boolean isClosable()
          Returns T if the window can be closed using a close button on the title bar.
 void linkToPageModally(NodeBase parent)
          This links this floater as a "modal" window to the page specified by the base node.
 void onAddedToPage(Page p)
           
 void onRemoveFromPage(Page p)
           
 void setClosable(boolean closable)
          When set to TRUE, the floater will display a close button on it's title bar, and will close if that thingy is pressed.
 void setIcon(java.lang.String ico)
          Set an icon for the title bar, using the absolute path to a web resource.
 void setOnClose(IClicked<FloatingWindow> onClose)
          Set a Clicked handler to be called when this floater is closed by it's close button.
 void setWindowTitle(java.lang.String windowTitle)
          Set the floater's title bar string.
 
Methods inherited from class to.etc.domui.dom.html.Div
afterCreateContent, componentHandleWebAction, fadeIn, fadeIn, fadeOut, getDragHandler, getDropBody, getDropHandler, getDropMode, getReturnPressed, setDragHandler, setDropBody, setDropHandler, setReturnPressed, slideDown, slideUp, tb, visit
 
Methods inherited from class to.etc.domui.dom.html.NodeContainer
add, add, add, addTable, canContain, delegateTo, findChildIndex, forceRebuild, getChild, getChildCount, getChildren, getDeepChild, getDeepChildren, getErrorFence, internalCheckNotDirty, internalClearDelta, internalClearDeltaFully, internalGetOldChildren, internalShelve, internalUnshelve, iterator, moveControlToModel, moveModelToControl, onRefresh, removeAllChildren, removeChild, removeChild, replaceChild, setControlsEnabled, setErrorFence, setErrorFence, setText, setValue
 
Methods inherited from class to.etc.domui.dom.html.NodeBase
$, acceptRequestParameter, addCssClass, addGlobalMessage, appendAfterMe, appendBeforeMe, appendCreateJS, appendJavascript, build, changed, clearFocusRequested, clearGlobalMessage, clearGlobalMessage, clearGlobalMessage, clearMessage, findComponentBundle, getActualID, getClicked, getComponentBundle, getCreateJS, getCssClass, getErrorDelegate, getErrorLocation, getMessage, getOnClickJS, getOnMouseDownJS, getPage, getParent, getParent, getParent, getSharedContext, getSpecialAttribute, getSpecialAttributeList, getTag, getTestID, getTitle, getUserObject, handleDrop, hasCssClass, hasError, internalGetOldParent, internalHasChangedAttributes, internalNeedClickHandler, internalOnClicked, internalSetHasChangedAttributes, internalSetHasChangedAttributes, internalSetTag, isBuilt, isFocusRequested, onBeforeFullRender, onForceRebuild, onHeaderContributors, onShelve, onUnshelve, refresh, remove, removeCssClass, renderJavascriptState, replaceWith, setClicked, setComponentBundle, setCssClass, setErrorDelegate, setErrorLocation, setFocus, setMessage, setOnClickJS, setOnMouseDownJS, setSpecialAttribute, setTestID, setTitle, setUserObject, stretchHeight, toString
 
Methods inherited from class to.etc.domui.dom.css.CssBase
getBackgroundAttachment, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorderBottomColor, getBorderBottomStyle, getBorderBottomWidth, getBorderLeftColor, getBorderLeftStyle, getBorderLeftWidth, getBorderRightColor, getBorderRightStyle, getBorderRightWidth, getBorderTopColor, getBorderTopStyle, getBorderTopWidth, getBottom, getCachedStyle, getClear, getColor, getDisplay, getFloat, getFontFamily, getFontSize, getFontSizeAdjust, getFontStyle, getFontVariant, getFontWeight, getHeight, getLeft, getLineHeight, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOverflow, getPosition, getRight, getTextAlign, getTop, getTransform, getVerticalAlign, getVisibility, getWidth, getZIndex, internalSetDisplay, setBackgroundAttachment, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBorder, setBorderBottomColor, setBorderBottomStyle, setBorderBottomWidth, setBorderColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderStyle, setBorderTopColor, setBorderTopStyle, setBorderTopWidth, setBorderWidth, setBottom, setBottom, setCachedStyle, setClear, setColor, setDisplay, setFloat, setFontFamily, setFontSize, setFontSizeAdjust, setFontStyle, setFontVariant, setFontWeight, setHeight, setLeft, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOverflow, setPosition, setRight, setRight, setTextAlign, setTop, setTop, setTransform, setVerticalAlign, setVisibility, setWidth, setZIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FloatingWindow

protected FloatingWindow()

FloatingWindow

protected FloatingWindow(boolean modal,
                         java.lang.String txt)
Create a floating window with the specified title in the title bar.

Parameters:
txt -
Method Detail

create

public static FloatingWindow create(NodeBase parent)
Create and link a modal floating window.

Returns:

create

public static FloatingWindow create(NodeBase parent,
                                    java.lang.String ttl)

create

public static FloatingWindow create(NodeBase parent,
                                    java.lang.String ttl,
                                    boolean modal)

onAddedToPage

public void onAddedToPage(Page p)
Overrides:
onAddedToPage in class NodeBase

onRemoveFromPage

public void onRemoveFromPage(Page p)
Overrides:
onRemoveFromPage in class NodeBase

createContent

public void createContent()
                   throws java.lang.Exception
Create the floater.

Overrides:
createContent in class NodeBase
Throws:
java.lang.Exception
See Also:
NodeBase.createContent()

setIcon

public void setIcon(java.lang.String ico)
Set an icon for the title bar, using the absolute path to a web resource. If the name is prefixed with THEME/ it specifies an image from the current THEME's directory.

Parameters:
ico -

createTitleBar

protected NodeContainer createTitleBar()
Create the title bar for the floater. Also replaces existing title bar in case that new is set.

Returns:

closePressed

public void closePressed()
                  throws java.lang.Exception
Close the window !AND CALL THE CLOSE HANDLER!.

Throws:
java.lang.Exception

isClosable

public boolean isClosable()
Returns T if the window can be closed using a close button on the title bar.

Returns:

setClosable

public void setClosable(boolean closable)
When set to TRUE, the floater will display a close button on it's title bar, and will close if that thingy is pressed.

Parameters:
closable -

close

public void close()
Close this floater and cause it to be destroyed from the UI.


getOnClose

public IClicked<FloatingWindow> getOnClose()
Get the current "onClose" handler.

Returns:

setOnClose

public void setOnClose(IClicked<FloatingWindow> onClose)
Set a Clicked handler to be called when this floater is closed by it's close button. This does not get called when the floater is closed programmatically (i.e. when close() is called).

Parameters:
onClose -

getWindowTitle

public java.lang.String getWindowTitle()
Return the floater's title bar title string.

Returns:

setWindowTitle

public void setWindowTitle(java.lang.String windowTitle)
Set the floater's title bar string.

Parameters:
windowTitle -

linkToPageModally

public void linkToPageModally(NodeBase parent)
This links this floater as a "modal" window to the page specified by the base node.

Parameters:
parent -