Package org.adempiere.webui.component
Class ConfirmPanel
java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Div
org.adempiere.webui.component.ConfirmPanel
- All Implemented Interfaces:
Serializable,Cloneable,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl
public final class ConfirmPanel
extends org.zkoss.zul.Div
Common command buttons panel for window, form and dialog
- Author:
- Sendy Yagambrum
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrlNested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAction String Cancel.static final StringAction String Customize.static final StringAction String Delete.static final StringAction String Export.static final StringAction String Help.static final StringAction String History.static final StringAction String New.static final StringAction String OK.static final StringAction String PAttribute.static final StringAction String Print.static final StringAction String Process.static final StringAction String Refresh.static final StringAction String Reset.static final StringAction String Zoom.Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclassFields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEFields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE -
Constructor Summary
ConstructorsConstructorDescriptionCreate confirm panel with Ok button onlyConfirmPanel(boolean withCancel) Create confirm panel with Ok and Cancel button onlyConfirmPanel(boolean withCancelButton, boolean withRefreshButton, boolean withResetButton, boolean withCustomizeButton, boolean withHistoryButton, boolean withZoomButton) Create confirm panel with multiple optionsConfirmPanel(boolean withCancelButton, boolean withRefreshButton, boolean withResetButton, boolean withCustomizeButton, boolean withHistoryButton, boolean withZoomButton, boolean withText) Create confirm panel with multiple optionsConfirmPanel(boolean withCancelButton, boolean withRefreshButton, boolean withResetButton, boolean withCustomizeButton, boolean withHistoryButton, boolean withZoomButton, boolean withText, boolean withImage) Create confirm panel with multiple options -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionListener(String event, org.zkoss.zk.ui.event.EventListener<?> listener) Add event listener on existing buttonsvoidaddActionListener(org.zkoss.zk.ui.event.EventListener<?> listener) Add ON_CLICK listener for all buttonsAdd button to center area of panelvoidAlias for addComponentsLeft, to ease of porting swing formvoidaddButtonSclass(String cls) Add cls to sclass property of all buttons.
Keep asextraButtonSClassfor new button created.voidaddComponentsBeforeRight(Button button) Add button to the front of right area of the confirm panelvoidaddComponentsCenter(Button button) Add button to the center area of the confirm panelvoidAdd checkbox to center area of panelvoidAdd combobox to center area of panelvoidaddComponentsLeft(Button button) Add button to the left side of the confirm panelvoidaddComponentsRight(Button button) Add button to the right side of the confirm paneladdProcessButton(String btName, String imgName) Add process button to center area of panelcreateButton(String name) Creates a button of the specified idcreateButton(String name, String image, String tooltip) Creates a button of the specified idGet button of the specified idgetMap()Alias for getButton("Ok"), to ease porting of swing formbooleanIs the specified button visiblevoidremoveButtonSclass(String cls) Remove cls from sclass property of all buttonsvoidsetEnabled(String id, boolean enabled) Enable/disable specific buttonvoidsetEnabledAll(boolean enabled) Enable/disable all buttonsvoidsetVisible(String id, boolean visible) Sets the visibility of the specified buttonvoidEnable the use ofSMALL_SCREEN_BUTTON_CLASSfor all buttons.Methods inherited from class org.zkoss.zul.impl.XulElement
clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, renderProperties, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributesMethods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyMethods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
Field Details
-
A_OK
Action String OK.- See Also:
-
A_CANCEL
Action String Cancel.- See Also:
-
A_REFRESH
Action String Refresh.- See Also:
-
A_RESET
Action String Reset.- See Also:
-
A_CUSTOMIZE
Action String Customize.- See Also:
-
A_HISTORY
Action String History.- See Also:
-
A_ZOOM
Action String Zoom.- See Also:
-
A_PROCESS
Action String Process.- See Also:
-
A_PRINT
Action String Print.- See Also:
-
A_EXPORT
Action String Export.- See Also:
-
A_HELP
Action String Help.- See Also:
-
A_DELETE
Action String Delete.- See Also:
-
A_PATTRIBUTE
Action String PAttribute.- See Also:
-
A_NEW
Action String New.- See Also:
-
-
Constructor Details
-
ConfirmPanel
public ConfirmPanel(boolean withCancelButton, boolean withRefreshButton, boolean withResetButton, boolean withCustomizeButton, boolean withHistoryButton, boolean withZoomButton) Create confirm panel with multiple options- Parameters:
withCancelButton- with cancelwithRefreshButton- with refreshwithResetButton- with resetwithCustomizeButton- with customizewithHistoryButton- with historywithZoomButton- with zoom
-
ConfirmPanel
public ConfirmPanel(boolean withCancelButton, boolean withRefreshButton, boolean withResetButton, boolean withCustomizeButton, boolean withHistoryButton, boolean withZoomButton, boolean withText) Create confirm panel with multiple options- Parameters:
withCancelButton- with cancelwithRefreshButton- with refreshwithResetButton- with resetwithCustomizeButton- with customizewithHistoryButton- with historywithZoomButton- with zoomwithText-
-
ConfirmPanel
public ConfirmPanel(boolean withCancelButton, boolean withRefreshButton, boolean withResetButton, boolean withCustomizeButton, boolean withHistoryButton, boolean withZoomButton, boolean withText, boolean withImage) Create confirm panel with multiple options- Parameters:
withCancelButton- with cancelwithRefreshButton- with refreshwithResetButton- with resetwithCustomizeButton- with customizewithHistoryButton- with historywithZoomButton- with zoomwithText-withImage- Include image for button. Note that image always included if withText is false
-
ConfirmPanel
public ConfirmPanel()Create confirm panel with Ok button only -
ConfirmPanel
public ConfirmPanel(boolean withCancel) Create confirm panel with Ok and Cancel button only- Parameters:
withCancel- true to include cancel button, false otherwise
-
-
Method Details
-
createButton
Creates a button of the specified id- Parameters:
name- button id- Returns:
- button
The string can be any of the following and the corresponding button will be created:
- Ok
- Ok button
- Cancel
- Cancel button
- Refresh
- Refresh button
- Reset
- Reset button
- History
- History button
- Process
- Process button
- New
- New button
- Customize
- Customize button
- Delete
- Delete button
- Save
- Save button
- Zoom
- Zoom button
- Help
- Help button
-
createButton
Creates a button of the specified id- Parameters:
name- button idimage-tooltip-- Returns:
- Button
-
addButton
Add button to center area of panel- Parameters:
btName-imgName-- Returns:
- added button
-
addProcessButton
Add process button to center area of panel- Parameters:
btName-imgName-- Returns:
- Button
-
addComponentsLeft
Add button to the left side of the confirm panel- Parameters:
button- button
-
addComponentsRight
Add button to the right side of the confirm panel- Parameters:
button- button
-
addComponentsBeforeRight
Add button to the front of right area of the confirm panel- Parameters:
button- button
-
addComponentsCenter
Add button to the center area of the confirm panel- Parameters:
button- button
-
addComponentsCenter
Add combobox to center area of panel- Parameters:
cbb-
-
addComponentsCenter
Add checkbox to center area of panel- Parameters:
cb-
-
getButton
Get button of the specified id- Parameters:
id- button id- Returns:
- button or null if no button is found
The button id can be any of the following
- Ok
- Ok button
- Cancel
- Cancel button
- Refresh
- Refresh button
- Reset
- Reset button
- History
- History button
- Process
- Process button
- New
- New button
- Customize
- Customize button
- Delete
- Delete button
- Save
- Save button
- Zoom
- Zoom button
- Help
- Help button
-
setVisible
Sets the visibility of the specified button- Parameters:
id- button namevisible- visibilityThe button name can be any of the following
- Ok
- Ok button
- Cancel
- Cancel button
- Refresh
- Refresh button
- Reset
- Reset button
- History
- History button
- Process
- Process button
- New
- New button
- Customize
- Customize button
- Delete
- Delete button
- Save
- Save button
- Zoom
- Zoom button
- Help
- Help button
-
isVisible
Is the specified button visible- Parameters:
btnName-- Returns:
- visibility of the button
The button name can be any of the following
- Ok
- Ok button
- Cancel
- Cancel button
- Refresh
- Refresh button
- Reset
- Reset button
- History
- History button
- Process
- Process button
- New
- New button
- Customize
- Customize button
- Delete
- Delete button
- Save
- Save button
- Zoom
- Zoom button
- Help
- Help button
-
setEnabled
Enable/disable specific button- Parameters:
id- button idenabled- enabledThe button id can be any of the following
- Ok
- Ok button
- Cancel
- Cancel button
- Refresh
- Refresh button
- Reset
- Reset button
- History
- History button
- Process
- Process button
- New
- New button
- Customize
- Customize button
- Delete
- Delete button
- Save
- Save button
- Zoom
- Zoom button
- Help
- Help button
-
setEnabledAll
public void setEnabledAll(boolean enabled) Enable/disable all buttons- Parameters:
enabled- true to enable, false otherwise
-
addActionListener
Add event listener on existing buttons- Parameters:
event- event namelistener- EventListener
-
addActionListener
public void addActionListener(org.zkoss.zk.ui.event.EventListener<?> listener) Add ON_CLICK listener for all buttons- Parameters:
listener- EventListener
-
addButton
Alias for addComponentsLeft, to ease of porting swing form- Parameters:
button-
-
getOKButton
Alias for getButton("Ok"), to ease porting of swing form- Returns:
- Button
-
addButtonSclass
Add cls to sclass property of all buttons.
Keep asextraButtonSClassfor new button created.- Parameters:
cls-
-
removeButtonSclass
Remove cls from sclass property of all buttons- Parameters:
cls-
-
useSmallButtonClassForSmallScreen
public void useSmallButtonClassForSmallScreen()Enable the use ofSMALL_SCREEN_BUTTON_CLASSfor all buttons. -
getMap
- Returns:
- map containing all buttons attached to ConfirmPanel
-