Class WPopup
- java.lang.Object
-
- com.github.bordertech.wcomponents.AbstractWComponent
-
- com.github.bordertech.wcomponents.WPopup
-
- All Implemented Interfaces:
WComponent,WebComponent,Serializable
public class WPopup extends AbstractWComponent
This component enables a pop up browser window to an arbitrary location. Pop-ups are initially invisible, to display a pop-up, callAbstractWComponent.setVisible(boolean). This will set the pop-up visible for the render cycle only.- Since:
- 1.0.0
- Author:
- Yiannis Paschalidis
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWPopup.PopupModelStores the WPopup state information.-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWComponent
AbstractWComponent.WComponentRef
-
-
Field Summary
-
Fields inherited from interface com.github.bordertech.wcomponents.WComponent
DEFAULT_APPLICATION_ID, DEFAULT_INTERNAL_ID, DEFAULT_NO_ID, ID_CONTEXT_SEPERATOR, ID_FRAMEWORK_ASSIGNED_SEPERATOR, ID_VALIDATION_PATTERN
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterPaint(RenderContext renderContext)Make the popup not visible after painting.protected WPopup.PopupModelgetComponentModel()Returns the effective component model for this component.intgetHeight()protected WPopup.PopupModelgetOrCreateComponentModel()Retrieves the model for this component so that it can be modified.StringgetTargetWindow()Retrieves the target window name.StringgetUrl()intgetWidth()booleanisResizable()booleanisScrollable()protected WPopup.PopupModelnewComponentModel()Creates a new component model.voidsetHeight(int height)Sets the window height.voidsetResizable(boolean resizable)Sets whether the popup window is resizable.voidsetScrollable(boolean scrollable)Sets whether the popup window should have a scroll bar.voidsetTargetWindow(String targetWindow)Sets the target window name.voidsetUrl(String url)Sets the URL.voidsetWidth(int width)Sets the popup window width.StringtoString()Creates a String representation of this component; usually for debugging purposes.-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWComponent
addHtmlClass, addHtmlClass, addNotify, assertAddSupported, beforePaint, createErrorDiagnostic, createErrorDiagnostic, forward, getAccessibleText, getAttribute, getBaseUrl, getDefaultModel, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getScratchMap, getTabIndex, getTag, getTemplate, getTemplateMarkUp, getToolTip, handleRequest, hasNoComponentModel, hasTabIndex, initialiseComponentModel, invokeLater, invokeLaters, isDebugStructure, isDefaultState, isFlagSet, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, paintComponent, preparePaint, preparePaintComponent, removeAttribute, removeComponentModel, removeHtmlClass, removeHtmlClass, removeNotify, replaceWComponent, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFlag, setFocussed, setHidden, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showErrorIndicatorsForComponent, showWarningIndicators, showWarningIndicatorsForComponent, tidyUpUIContext, tidyUpUIContextForTree, validate, validateComponent, writeReplace
-
-
-
-
Constructor Detail
-
WPopup
public WPopup()
Creates a new Window with no URL.
-
WPopup
public WPopup(String url)
Creates a new popup containing the specified content.- Parameters:
url- the popup url.
-
-
Method Detail
-
getHeight
public int getHeight()
- Returns:
- The height of the popup window. Default is 600px.
-
setHeight
public void setHeight(int height)
Sets the window height.- Parameters:
height- The height of the popup window.
-
getWidth
public int getWidth()
- Returns:
- The width of the popup window. Default is 800px.
-
setWidth
public void setWidth(int width)
Sets the popup window width.- Parameters:
width- The width of the popup window.
-
isResizable
public boolean isResizable()
- Returns:
- true if the popup window is resizable.
-
setResizable
public void setResizable(boolean resizable)
Sets whether the popup window is resizable.- Parameters:
resizable- true if the popup window should be resizable, false if not.
-
isScrollable
public boolean isScrollable()
- Returns:
- true if the popup window is scrollable.
-
setScrollable
public void setScrollable(boolean scrollable)
Sets whether the popup window should have a scroll bar.- Parameters:
scrollable- true if the popup window should have a scroll bar, false if not.
-
getUrl
public String getUrl()
- Returns:
- the URL.
-
setUrl
public void setUrl(String url)
Sets the URL.- Parameters:
url- the URL to set.
-
getTargetWindow
public String getTargetWindow()
Retrieves the target window name.- Returns:
- the target window name.
-
setTargetWindow
public void setTargetWindow(String targetWindow)
Sets the target window name.- Parameters:
targetWindow- the target window name.
-
afterPaint
protected void afterPaint(RenderContext renderContext)
Make the popup not visible after painting.- Overrides:
afterPaintin classAbstractWComponent- Parameters:
renderContext- the renderContext to send output to.
-
toString
public String toString()
Description copied from class:AbstractWComponentCreates a String representation of this component; usually for debugging purposes.- Overrides:
toStringin classAbstractWComponent- Returns:
- a String representation of this component, for debugging purposes.
-
newComponentModel
protected WPopup.PopupModel newComponentModel()
Creates a new component model.- Overrides:
newComponentModelin classAbstractWComponent- Returns:
- a new PopupModel.
-
getComponentModel
protected WPopup.PopupModel getComponentModel()
Returns the effective component model for this component. Subclass may override this method to narrow the return type to their specific model type.- Overrides:
getComponentModelin classAbstractWComponent- Returns:
- the effective component model
-
getOrCreateComponentModel
protected WPopup.PopupModel getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified. If this method is called during request processing, and a session specific model does not yet exist, then a new model is created. Subclasses may override this method to narrow the return type to their specific model type.- Overrides:
getOrCreateComponentModelin classAbstractWComponent- Returns:
- the model for this component
-
-