Class AbstractDialog<T extends Serializable>

java.lang.Object
org.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.html.panel.Panel
org.apache.wicket.markup.html.panel.GenericPanel<T>
com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog<T>
Type Parameters:
T - the type of the model object
All Implemented Interfaces:
com.googlecode.wicket.jquery.core.IJQueryWidget, IDialogListener, Serializable, Iterable<org.apache.wicket.Component>, org.apache.wicket.event.IEventSink, org.apache.wicket.event.IEventSource, org.apache.wicket.feedback.IFeedbackContributor, org.apache.wicket.IConverterLocator, org.apache.wicket.IGenericComponent<T,org.apache.wicket.markup.html.panel.GenericPanel<T>>, org.apache.wicket.IMetadataContext<Serializable,org.apache.wicket.Component>, org.apache.wicket.IQueueRegion, org.apache.wicket.markup.html.IHeaderContributor, org.apache.wicket.request.component.IRequestableComponent, org.apache.wicket.util.IHierarchical<org.apache.wicket.Component>, org.apache.wicket.util.io.IClusterable
Direct Known Subclasses:
AbstractFormDialog, FragmentDialog, MessageDialog

public abstract class AbstractDialog<T extends Serializable> extends org.apache.wicket.markup.html.panel.GenericPanel<T> implements com.googlecode.wicket.jquery.core.IJQueryWidget, IDialogListener
Base class for implementing jQuery dialogs
Author:
Sebastien Briquet - sebfz1
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.googlecode.wicket.jquery.core.IJQueryWidget

    com.googlecode.wicket.jquery.core.IJQueryWidget.JQueryWidget
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final org.apache.wicket.model.IModel<String>
     
    static final org.apache.wicket.model.IModel<String>
     
    static final org.apache.wicket.model.IModel<String>
     
    static final org.apache.wicket.model.IModel<String>
     
    static final org.apache.wicket.model.IModel<String>
     
    static final org.apache.wicket.model.IModel<String>
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from class org.apache.wicket.markup.html.panel.Panel

    PANEL

    Fields inherited from class org.apache.wicket.Component

    ENABLE, FLAG_INITIALIZED, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING, RFLAG_CONTAINER_HAS_REMOVALS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor
    AbstractDialog(String id, String title, boolean modal)
    Constructor
    AbstractDialog(String id, String title, org.apache.wicket.model.IModel<T> model)
    Constructor
    AbstractDialog(String id, String title, org.apache.wicket.model.IModel<T> model, boolean modal)
    Constructor
    AbstractDialog(String id, org.apache.wicket.model.IModel<String> title)
    Constructor
    AbstractDialog(String id, org.apache.wicket.model.IModel<String> title, boolean modal)
    Constructor
    AbstractDialog(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model)
    Constructor
    AbstractDialog(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model, boolean modal)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    close(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, DialogButton button)
    Closes the dialogs in ajax/websocket.
    Finds a DialogButton - identified by its name - within the list of buttons returned by getButtons()
    protected List<DialogButton>
    Gets the dialog's buttons.
    It is allowed to return a predefined list (ie: DialogButtons#OK_CANCEL#toList()) as long as the buttons state (enable and/or visible) are not modified
    Warning: It is not legal to create the buttons to be returned in this method.
    org.apache.wicket.model.IModel<String>
    Gets the dialog's title
    int
    Gets the dialog's with
    boolean
    Indicates whether the default close event (the click on the X-icon) is enabled If true, the IDialogListener.onClose(IPartialPageRequestHandler, DialogButton) event will be triggered, with a null DialogButton
    boolean
    Indicates whether the escape close event (pressing escape key) is enabled If true, the IDialogListener.onClose(IPartialPageRequestHandler, DialogButton) event will be triggered, with a null DialogButton
    boolean
    Gets the modal flag
    boolean
    Indicates whether the dialog is resizable
    newButtonAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source, DialogButton button)
    Gets a new ButtonAjaxBehavior that will be called by the corresponding DialogButton.
    This method may be overridden to provide additional behaviors
    protected final IDialogListener
    Gets a new IDialogListener that allow to redirect IDialogListener.onClick(AjaxRequestTarget, DialogButton) to internalOnClick(AjaxRequestTarget, DialogButton)
     
    void
    onBeforeRender(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)
     
    void
    onClick(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
    Triggered when a button is clicked
    This method may be overridden to handle button behaviors, but the dialog will not been closed until super.onClick(event) or close(IPartialPageRequestHandler, DialogButton) is called.
    void
    onConfigure(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)
     
    protected void
     
    protected void
     
    protected void
    onOpen(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
    Triggered when the dialog opens
    final void
    open(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
    Opens the dialogs in ajax.
    void
    setTitle(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, String title)
    Sets the dialog's title dynamically
    void
    setTitle(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, org.apache.wicket.model.IModel<String> title)
    Sets the dialog's title dynamically
    void
    setTitle(org.apache.wicket.model.IModel<String> title)
    Sets the dialog's title

    Methods inherited from class org.apache.wicket.markup.html.panel.Panel

    getRegionMarkup, newMarkupSourcingStrategy

    Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer

    getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession

    Methods inherited from class org.apache.wicket.MarkupContainer

    add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onComponentTagBody, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, stream, streamChildren, toString, toString, visitChildren, visitChildren

    Methods inherited from class org.apache.wicket.Component

    add, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMarkupTag, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrap

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface com.googlecode.wicket.jquery.ui.widget.dialog.IDialogListener

    onClose

    Methods inherited from interface org.apache.wicket.IGenericComponent

    getDefaultModel, getDefaultModelObject, getModel, getModelObject, setDefaultModel, setDefaultModelObject, setModel, setModelObject

    Methods inherited from interface org.apache.wicket.IQueueRegion

    dequeue, newDequeueContext

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Field Details

  • Constructor Details

    • AbstractDialog

      public AbstractDialog(String id, String title)
      Constructor
      Parameters:
      id - the markupId, an html div suffice to host a dialog.
      title - the title of the dialog
    • AbstractDialog

      public AbstractDialog(String id, org.apache.wicket.model.IModel<String> title)
      Constructor
      Parameters:
      id - the markupId, an html div suffice to host a dialog.
      title - the title of the dialog
    • AbstractDialog

      public AbstractDialog(String id, String title, org.apache.wicket.model.IModel<T> model)
      Constructor
      Parameters:
      id - the markupId, an html div suffice to host a dialog.
      title - the title of the dialog
      model - the model to be used in the dialog.
    • AbstractDialog

      public AbstractDialog(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model)
      Constructor
      Parameters:
      id - the markupId, an html div suffice to host a dialog.
      title - the title of the dialog
      model - the model to be used in the dialog.
    • AbstractDialog

      public AbstractDialog(String id, String title, boolean modal)
      Constructor
      Parameters:
      id - the markupId, an html div suffice to host a dialog.
      title - the title of the dialog
      modal - indicates whether the dialog is modal
    • AbstractDialog

      public AbstractDialog(String id, org.apache.wicket.model.IModel<String> title, boolean modal)
      Constructor
      Parameters:
      id - the markupId, an html div suffice to host a dialog.
      title - the title of the dialog
      modal - indicates whether the dialog is modal
    • AbstractDialog

      public AbstractDialog(String id, String title, org.apache.wicket.model.IModel<T> model, boolean modal)
      Constructor
      Parameters:
      id - markupId, an html div suffice to host a dialog.
      title - the title of the dialog
      modal - indicates whether the dialog is modal
      model - the model to be used in the dialog
    • AbstractDialog

      public AbstractDialog(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<T> model, boolean modal)
      Constructor
      Parameters:
      id - markupId, an html div suffice to host a dialog.
      title - the title of the dialog
      modal - indicates whether the dialog is modal
      model - the model to be used in the dialog
  • Method Details

    • onInitialize

      protected void onInitialize()
      Overrides:
      onInitialize in class org.apache.wicket.MarkupContainer
    • onConfigure

      public void onConfigure(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)
      Specified by:
      onConfigure in interface com.googlecode.wicket.jquery.core.IJQueryWidget
    • onBeforeRender

      public void onBeforeRender(com.googlecode.wicket.jquery.core.JQueryBehavior behavior)
      Specified by:
      onBeforeRender in interface com.googlecode.wicket.jquery.core.IJQueryWidget
    • onOpen

      protected void onOpen(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Triggered when the dialog opens
      Parameters:
      handler - the IPartialPageRequestHandler
    • onClick

      public void onClick(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)
      Triggered when a button is clicked
      This method may be overridden to handle button behaviors, but the dialog will not been closed until super.onClick(event) or close(IPartialPageRequestHandler, DialogButton) is called.
      Specified by:
      onClick in interface IDialogListener
      Parameters:
      target - the AjaxRequestTarget
      button - the button that closed the dialog
    • onDetach

      protected void onDetach()
      Overrides:
      onDetach in class org.apache.wicket.MarkupContainer
    • getButtons

      protected List<DialogButton> getButtons()
      Gets the dialog's buttons.
      It is allowed to return a predefined list (ie: DialogButtons#OK_CANCEL#toList()) as long as the buttons state (enable and/or visible) are not modified
      Warning: It is not legal to create the buttons to be returned in this method.
      Returns:
      btnOk by default
    • getWidth

      public int getWidth()
      Gets the dialog's with
      Returns:
      WIDTH by default
    • getTitle

      public org.apache.wicket.model.IModel<String> getTitle()
      Gets the dialog's title
      Returns:
      the dialog's title
    • setTitle

      public void setTitle(org.apache.wicket.model.IModel<String> title)
      Sets the dialog's title
      Parameters:
      title - the dialog's title
    • setTitle

      public void setTitle(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, String title)
      Sets the dialog's title dynamically
      Parameters:
      handler - the IPartialPageRequestHandler
      title - the dialog's title
    • setTitle

      public void setTitle(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, org.apache.wicket.model.IModel<String> title)
      Sets the dialog's title dynamically
      Parameters:
      handler - the IPartialPageRequestHandler
      title - the dialog's title
    • isModal

      public boolean isModal()
      Gets the modal flag
      Returns:
      the modal flag supplied to the constructor by default
    • isResizable

      public boolean isResizable()
      Indicates whether the dialog is resizable
      Returns:
      false by default
    • isDefaultCloseEventEnabled

      public boolean isDefaultCloseEventEnabled()
      Description copied from interface: IDialogListener
      Indicates whether the default close event (the click on the X-icon) is enabled If true, the IDialogListener.onClose(IPartialPageRequestHandler, DialogButton) event will be triggered, with a null DialogButton
      Specified by:
      isDefaultCloseEventEnabled in interface IDialogListener
      Returns:
      false by default
    • isEscapeCloseEventEnabled

      public boolean isEscapeCloseEventEnabled()
      Description copied from interface: IDialogListener
      Indicates whether the escape close event (pressing escape key) is enabled If true, the IDialogListener.onClose(IPartialPageRequestHandler, DialogButton) event will be triggered, with a null DialogButton
      Specified by:
      isEscapeCloseEventEnabled in interface IDialogListener
      Returns:
      false by default
    • findButton

      public DialogButton findButton(String name)
      Finds a DialogButton - identified by its name - within the list of buttons returned by getButtons()
      Parameters:
      name - the button's name
      Returns:
      the DialogButton if found, null otherwise
    • open

      public final void open(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Opens the dialogs in ajax.
      Parameters:
      handler - the IPartialPageRequestHandler
    • close

      public final void close(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler, DialogButton button)
      Closes the dialogs in ajax/websocket.
      Parameters:
      handler - the IPartialPageRequestHandler
      button - the button that closes the dialog
    • newWidgetBehavior

      public DialogBehavior newWidgetBehavior(String selector)
      Specified by:
      newWidgetBehavior in interface com.googlecode.wicket.jquery.core.IJQueryWidget
      See Also:
      • IJQueryWidget.newWidgetBehavior(String)
    • newDialogListenerWrapper

      protected final IDialogListener newDialogListenerWrapper()
      Gets a new IDialogListener that allow to redirect IDialogListener.onClick(AjaxRequestTarget, DialogButton) to internalOnClick(AjaxRequestTarget, DialogButton)
      Returns:
      a new DialogListenerWrapper
    • newButtonAjaxBehavior

      protected ButtonAjaxBehavior newButtonAjaxBehavior(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source, DialogButton button)
      Gets a new ButtonAjaxBehavior that will be called by the corresponding DialogButton.
      This method may be overridden to provide additional behaviors
      Parameters:
      source - the IJQueryAjaxAware source
      button - the button that is passed to the behavior so it can be retrieved via the ButtonAjaxBehavior.ClickEvent
      Returns:
      the ButtonAjaxBehavior