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.DivApplication Confirm Panel Web UI port of the rich client's ConfirmPanel by Jorg Janke- Author:
- Sendy Yagambrum
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringA_CANCELAction String Cancel.static StringA_CUSTOMIZEAction String Customize.static StringA_DELETEAction String Delete.static StringA_EXPORTAction String Export.static StringA_HELPAction String Help.static StringA_HISTORYAction String History.static StringA_NEWAction String New.static StringA_OKAction String OK.static StringA_PATTRIBUTEAction String PAttribute.static StringA_PRINTAction String Print.static StringA_PROCESSAction String Process.static StringA_REFRESHAction String Refresh.static StringA_RESETAction String Reset.static StringA_ZOOMAction String Zoom.
-
Constructor Summary
Constructors Constructor Description ConfirmPanel()Create confirm panel with Ok button onlyConfirmPanel(boolean withCancel)Create confirm panel with Ok and Cancel buttonConfirmPanel(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActionListener(String event, org.zkoss.zk.ui.event.EventListener<?> listener)add action listener on the existing buttonsvoidaddActionListener(org.zkoss.zk.ui.event.EventListener<?> listener)added to ease porting of swing formButtonaddButton(String btName, String imgName)IDEMPIERE-1334 add a process button into center panelvoidaddButton(Button button)alias for addComponentsLeft for ease of porting swing formvoidaddButtonSclass(String cls)voidaddComponentsCenter(Button button)IDEMPIERE-1334 add button to the center side of the confirm panelvoidaddComponentsCenter(Checkbox cb)Add checkbox to center panelvoidaddComponentsCenter(Combobox cbb)Add combobox to center panelvoidaddComponentsLeft(Button button)add button to the left side of the confirm panelvoidaddComponentsRight(Button button)add button to the right side of the confirm panelButtonaddProcessButton(String btName, String imgName)ButtoncreateButton(String name)Creates a button of the specified idButtoncreateButton(String name, String image, String tooltip)ButtongetButton(String id)return button of the specified idButtongetOKButton()alias for getButton("Ok"), to ease porting of swing formbooleanisVisible(String btnName)returns whether the specified button is visible or notvoidremoveButtonSclass(String cls)voidsetEnabled(String id, boolean enabled)enable specific buttonvoidsetEnabledAll(boolean enabled)enable all componentsvoidsetVisible(String id, boolean visible)sets the visibility of the specified buttonvoiduseSmallButtonClassForSmallScreen()-
Methods inherited from class org.zkoss.zul.impl.XulElement
clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
-
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, 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, setZIndexDirectly
-
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, 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, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, invalidatePartial, isChildable, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, 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, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
-
-
-
Field Detail
-
A_OK
public static final String A_OK
Action String OK.- See Also:
- Constant Field Values
-
A_CANCEL
public static final String A_CANCEL
Action String Cancel.- See Also:
- Constant Field Values
-
A_REFRESH
public static final String A_REFRESH
Action String Refresh.- See Also:
- Constant Field Values
-
A_RESET
public static final String A_RESET
Action String Reset.- See Also:
- Constant Field Values
-
A_CUSTOMIZE
public static final String A_CUSTOMIZE
Action String Customize.- See Also:
- Constant Field Values
-
A_HISTORY
public static final String A_HISTORY
Action String History.- See Also:
- Constant Field Values
-
A_ZOOM
public static final String A_ZOOM
Action String Zoom.- See Also:
- Constant Field Values
-
A_PROCESS
public static final String A_PROCESS
Action String Process.- See Also:
- Constant Field Values
-
A_PRINT
public static final String A_PRINT
Action String Print.- See Also:
- Constant Field Values
-
A_EXPORT
public static final String A_EXPORT
Action String Export.- See Also:
- Constant Field Values
-
A_HELP
public static final String A_HELP
Action String Help.- See Also:
- Constant Field Values
-
A_DELETE
public static final String A_DELETE
Action String Delete.- See Also:
- Constant Field Values
-
A_PATTRIBUTE
public static final String A_PATTRIBUTE
Action String PAttribute.- See Also:
- Constant Field Values
-
A_NEW
public static final String A_NEW
Action String New.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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- Incude 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- Parameters:
withCancel- with cancel
-
-
Method Detail
-
createButton
public Button createButton(String name)
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
-
addButton
public Button addButton(String btName, String imgName)
IDEMPIERE-1334 add a process button into center panel- Parameters:
btName-imgName-- Returns:
-
addComponentsLeft
public void addComponentsLeft(Button button)
add button to the left side of the confirm panel- Parameters:
button- button
-
addComponentsRight
public void addComponentsRight(Button button)
add button to the right side of the confirm panel- Parameters:
button- button
-
addComponentsCenter
public void addComponentsCenter(Button button)
IDEMPIERE-1334 add button to the center side of the confirm panel- Parameters:
button- button
-
addComponentsCenter
public void addComponentsCenter(Combobox cbb)
Add combobox to center panel- Parameters:
cbb-
-
addComponentsCenter
public void addComponentsCenter(Checkbox cb)
Add checkbox to center panel- Parameters:
cb-
-
getButton
public Button getButton(String id)
return 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
public void setVisible(String id, boolean visible)
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
public boolean isVisible(String btnName)
returns whether the specified button is visible or not- 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
public void setEnabled(String id, boolean enabled)
enable 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 all components- Parameters:
enabled- enabled
-
addActionListener
public void addActionListener(String event, org.zkoss.zk.ui.event.EventListener<?> listener)
add action listener on the existing buttons- Parameters:
event- eventlistener- listener
-
addActionListener
public void addActionListener(org.zkoss.zk.ui.event.EventListener<?> listener)
added to ease porting of swing form- Parameters:
listener-
-
addButton
public void addButton(Button button)
alias for addComponentsLeft for ease of porting swing form- Parameters:
button-
-
getOKButton
public Button getOKButton()
alias for getButton("Ok"), to ease porting of swing form- Returns:
- Button
-
addButtonSclass
public void addButtonSclass(String cls)
-
removeButtonSclass
public void removeButtonSclass(String cls)
-
useSmallButtonClassForSmallScreen
public void useSmallButtonClassForSmallScreen()
-
-