Class BasePage
- All Implemented Interfaces:
Animatable<Container>
,CanDrop<Container>
,Clickable<Container>
,Draggable<Container>
,HandleMouseEvents<Container>
,Scrollable<Container>
,Touchable<Container>
- Direct Known Subclasses:
BaseLoginPage
The base page class
Every page in the application must extend this class. This class is responsible for ensuring that the basic functions of the page(s) are working, and supplies the basic, mandatory methods.
- Since:
- 4.0
- Author:
- JBStrap
-
Field Summary
Modifier and TypeFieldDescriptionprotected Parameters
The parameters that are assigned to the pageFields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addResizeHandler
(PageResizeEventHandler handler) Adds the specified resize handler to the page.final BasePage
addUrlParameter
(String name, String value) Adds a URL parameter to the page.boolean
Determines if the specified object equals the page.final String
Gets the page IDGets every parameter that is assigned to the page.final String
getTitle()
Gets the page title.getUrlParameter
(String name) Gets the parameter value of a URL Parameterfinal BasePage
removeUrlParameter
(String name) Removes the specified parameter from the page URLfinal BasePage
Set the page titleboolean
writeHTML
(StringWriter writer) Creates the component's HTML equivalentMethods inherited from class com.jbstrap.ui.components.layout.Container
getType, setAlignItems, setType
Methods inherited from class com.jbstrap.ui.Component
_hide, _setAttribute, addAllowedRole, addComponent, addComponent, addComponents, addDeniedRole, addHandler, addStyle, addStyleClass, addStyleClasses, afterDraw, clearfix, closeTag, combinateAccess, containsStyle, containsStyleClass, draw, drawSubComponents, error, flattendComponentTree, getAccess, getAccessMode, getAllowedRoles, getAttribute, getAttributes, getBackgroundColor, getBorderColor, getClient, getComponentById, getComponents, getComponents, getComponentsByClass, getData, getDeniedRoles, getHandlers, getId, getLanguageCode, getName, getParent, getParent, getRegisteredEvents, getStyle, getStyleClasses, getTextAlign, getTextColor, getToolTip, getToolTipPosition, getTypeName, getUI, init, insertComponentAfter, insertComponentBefore, isAccess, isDrawn, isEnabled, isEventBubbling, isVisible, onHide, onHotKeyEventHandler, onShow, openTag, redraw, removeAllComponents, removeAllowedRole, removeAllStyleClasses, removeAttribute, removeComponent, removeComponent, removeComponents, removeDeniedRole, removeHandler, removeStyle, removeStyle, removeStyleClass, removeStyleClasses, replaceComponent, replaceStyleClass, runAfterDraw, runJavaScript, runJavaScript, runJavaScript, runOnHide, runOnShow, say, setAttribute, setBackgroundColor, setBorder, setBorderColor, setData, setDisplayType, setEnabled, setEventBubbling, setFlex, setFloating, setHeight100, setHeight25, setHeight50, setHeight75, setHeightAuto, setLanguage, setMargin, setName, setOverflow, setPadding, setParent, setScrollable, setSelectionType, setShadow, setStyle, setTextAlign, setTextColor, setToolTip, setToolTipPosition, setVisible, setWidth100, setWidth25, setWidth50, setWidth75, setWidthAuto, showNotification, showNotification, showProcessIndicator, toggleStyleClass
Methods inherited from class com.jbstrap.core.messagebus.MessageBus
closeMessageBus, messageBusOpened, openMessageBus, renewSubscription, sendMessageToMessageBus, subscribeMessageBus, unsubscribeAllListeners, unsubscribeMessageBus
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jbstrap.ui.Animatable
addAnimationEndHandler, addAnimationStartHandler, getAnimation, removeAnimation, setAnimation
Methods inherited from interface com.jbstrap.ui.CanDrop
addDropEventHandler
Methods inherited from interface com.jbstrap.ui.Clickable
addClickHandler, addDoubleClickHandler
Methods inherited from interface com.jbstrap.ui.Draggable
addDragEndEventHandler, addDragStartEventHandler, setDraggable
Methods inherited from interface com.jbstrap.ui.HandleMouseEvents
addMouseDownHandler, addMouseEnterHandler, addMouseLeaveHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler
Methods inherited from interface com.jbstrap.ui.Scrollable
addScrollHandler
Methods inherited from interface com.jbstrap.ui.Touchable
addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler
-
Field Details
-
params
The parameters that are assigned to the page
-
-
Constructor Details
-
BasePage
Creates a page. The constructor must be called upon instantiating a page.- Parameters:
ui
- The UI object instance, where the page will appear.params
- TheParameters
class, containing the parameters assigned to the page.- Throws:
IllegalStateException
- If the page is set to be both Private and Public.- See Also:
-
-
Method Details
-
writeHTML
Description copied from class:Component
Creates the component's HTML equivalentThis method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (
StringWriter
class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return withfalse
. Otherwise, it must return withtrue
. -
addResizeHandler
Adds the specified resize handler to the page. This handler will run when the user resizes the page.- Parameters:
handler
- ThePageResizeEventHandler
implementation- See Also:
-
getPageId
Gets the page ID- Returns:
- The page ID
-
getTitle
Gets the page title. If there is a parameter that is named "title", the method will return its value. If not found, returns withnull
- Returns:
- The page title or
null
, if no title was specified - See Also:
-
setTitle
Set the page title- Parameters:
pageTitle
- The page title. If setnull
or empty string, page title is not used
-
getParameters
Gets every parameter that is assigned to the page.- Returns:
- The
Parameters
object containing every parameter assigned to the page - See Also:
-
equals
Determines if the specified object equals the page. The specified object is considered equal if the following are true:- The name of the specified object is
null
- The specified object is a BasePage, or extends from it
- The name of the specified object has the same page ID as the page.
- The parameters of the specified object is equal to the parameters of the page. (
Parameters.equals()
)
- The name of the specified object is
-
addUrlParameter
Adds a URL parameter to the page. If a URL parameter is added to the page, it will be in the URL that appears in the browser. If a user saves the URL to their bookmarks, or sends it in an e-mail, the parameter will be saved/sent as well. If the user uses the URL to open the page, the parameter in the URL will also be placed among the page parameters.- Parameters:
name
- The name of the parametervalue
- The value of the parameter. The parameter can only contain a value that can be placed in the URL (text, number, etc.).- Returns:
- The page
- Throws:
NullPointerException
- If the specified parameter name or value isnull
-
removeUrlParameter
Removes the specified parameter from the page URL- Parameters:
name
- The name of the parameter that will be removed- Returns:
- The page
- Throws:
NullPointerException
- If the specified parameter name isnull
-
getUrlParameter
Gets the parameter value of a URL Parameter- Parameters:
name
- The name of the parameter- Returns:
- The parameter value or
null
, if the specified parameter was not found in the page url parameters
-