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
Confirm 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.ExtraCtrl

    Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent

    org.zkoss.zk.ui.AbstractComponent.Children
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Action String Cancel.
    static final String
    Action String Customize.
    static final String
    Action String Delete.
    static final String
    Action String Export.
    static final String
    Action String Help.
    static final String
    Action String History.
    static final String
    Action String New.
    static final String
    Action String OK.
    static final String
    Action String PAttribute.
    static final String
    Action String Print.
    static final String
    Action String Process.
    static final String
    Action String Refresh.
    static final String
    Action String Reset.
    static final String
    Action String Zoom.

    Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent

    _zclass

    Fields inherited from interface org.zkoss.zk.ui.Component

    APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE

    Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl

    AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create confirm panel with Ok button only
    ConfirmPanel(boolean withCancel)
    Create confirm panel with Ok and Cancel button
    ConfirmPanel(boolean withCancelButton, boolean withRefreshButton, boolean withResetButton, boolean withCustomizeButton, boolean withHistoryButton, boolean withZoomButton)
    create confirm panel with multiple options
    ConfirmPanel(boolean withCancelButton, boolean withRefreshButton, boolean withResetButton, boolean withCustomizeButton, boolean withHistoryButton, boolean withZoomButton, boolean withText)
    create confirm panel with multiple options
    ConfirmPanel(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 Type
    Method
    Description
    void
    addActionListener(String event, org.zkoss.zk.ui.event.EventListener<?> listener)
    add event listener on existing buttons
    void
    addActionListener(org.zkoss.zk.ui.event.EventListener<?> listener)
    add ON_CLICK listener for all buttons
    addButton(String btName, String imgName)
    add button to center area of panel
    void
    addButton(Button button)
    alias for addComponentsLeft for ease of porting swing form
    void
    Add cls to sclass property of all buttons.
    void
    add button to the front of right area of the confirm panel
    void
    add button to the center area of the confirm panel
    void
    Add checkbox to center area of panel
    void
    Add combobox to center area of panel
    void
    add button to the left side of the confirm panel
    void
    add button to the right side of the confirm panel
    addProcessButton(String btName, String imgName)
    add process button to center area of panel
    Creates a button of the specified id
    createButton(String name, String image, String tooltip)
     
    return button of the specified id
     
    alias for getButton("Ok"), to ease porting of swing form
    boolean
    isVisible(String btnName)
    returns whether the specified button is visible or not
    void
    Remove cls from sclass property of all buttons
    void
    setEnabled(String id, boolean enabled)
    enable specific button
    void
    setEnabledAll(boolean enabled)
    enable/disable all buttons
    void
    setVisible(String id, boolean visible)
    sets the visibility of the specified button
    void
    Enable the use of SMALL_SCREEN_BUTTON_CLASS for all buttons.

    Methods inherited from class org.zkoss.zul.Div

    getAlign, renderProperties, setAlign

    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

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl

    invalidatePartial
  • Field Details

  • 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 cancel
      withRefreshButton - with refresh
      withResetButton - with reset
      withCustomizeButton - with customize
      withHistoryButton - with history
      withZoomButton - 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 cancel
      withRefreshButton - with refresh
      withResetButton - with reset
      withCustomizeButton - with customize
      withHistoryButton - with history
      withZoomButton - with zoom
      withText -
    • 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 cancel
      withRefreshButton - with refresh
      withResetButton - with reset
      withCustomizeButton - with customize
      withHistoryButton - with history
      withZoomButton - with zoom
      withText -
      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
      Parameters:
      withCancel - true to include cancel button, false otherwise
  • Method Details

    • 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
    • createButton

      public Button createButton(String name, String image, String tooltip)
      Parameters:
      name -
      image -
      tooltip -
      Returns:
      Button
    • addButton

      public Button addButton(String btName, String imgName)
      add button to center area of panel
      Parameters:
      btName -
      imgName -
      Returns:
    • addProcessButton

      public Button addProcessButton(String btName, String imgName)
      add process button to center area of panel
      Parameters:
      btName -
      imgName -
      Returns:
      Button
    • 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
    • addComponentsBeforeRight

      public void addComponentsBeforeRight(Button button)
      add button to the front of right area of the confirm panel
      Parameters:
      button - button
    • addComponentsCenter

      public void addComponentsCenter(Button button)
      add button to the center area of the confirm panel
      Parameters:
      button - button
    • addComponentsCenter

      public void addComponentsCenter(Combobox cbb)
      Add combobox to center area of panel
      Parameters:
      cbb -
    • addComponentsCenter

      public void addComponentsCenter(Checkbox cb)
      Add checkbox to center area of 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 name
      visible - visibility

      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
    • 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 id
      enabled - enabled

      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
    • setEnabledAll

      public void setEnabledAll(boolean enabled)
      enable/disable all buttons
      Parameters:
      enabled - true to enable, false otherwise
    • addActionListener

      public void addActionListener(String event, org.zkoss.zk.ui.event.EventListener<?> listener)
      add event listener on existing buttons
      Parameters:
      event - event name
      listener - EventListener
    • addActionListener

      public void addActionListener(org.zkoss.zk.ui.event.EventListener<?> listener)
      add ON_CLICK listener for all buttons
      Parameters:
      listener - EventListener
    • 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)
      Add cls to sclass property of all buttons. Keep as extraButtonSClass for new button created.
      Parameters:
      cls -
    • removeButtonSclass

      public void removeButtonSclass(String cls)
      Remove cls from sclass property of all buttons
      Parameters:
      cls -
    • useSmallButtonClassForSmallScreen

      public void useSmallButtonClassForSmallScreen()
      Enable the use of SMALL_SCREEN_BUTTON_CLASS for all buttons.
    • getMap

      public Map<String,Button> getMap()
      Returns:
      map containing all buttons attached to ConfirmPanel