Interface OkCancelDialogBuilder

  • All Superinterfaces:
    DialogBuilder<OkCancelDialogBuilder>

    public interface OkCancelDialogBuilder
    extends DialogBuilder<OkCancelDialogBuilder>
    Builds a modal dialog for displaying the given component, with OK and Cancel buttons based on the given actions. An OK action must be provided and the default Cancel action simply disposes the dialog.
    • Method Detail

      • modal

        OkCancelDialogBuilder modal​(boolean modal)
        Parameters:
        modal - true if the dialog should be modal
        Returns:
        this OkCancelDialogBuilder instance
      • resizable

        OkCancelDialogBuilder resizable​(boolean resizable)
        Parameters:
        resizable - true if the dialog should be resizable
        Returns:
        this OkCancelDialogBuilder instance
      • buttonPanelConstraints

        OkCancelDialogBuilder buttonPanelConstraints​(int buttonPanelConstraints)
        Parameters:
        buttonPanelConstraints - the FlowLayout panel constraints for the button panel
        Returns:
        this OkCancelDialogBuilder
      • buttonPanelBorder

        OkCancelDialogBuilder buttonPanelBorder​(Border buttonPanelBorder)
        Parameters:
        buttonPanelBorder - the button panel border
        Returns:
        this OkCancelDialogBuilder
      • onOk

        OkCancelDialogBuilder onOk​(Runnable onOk)
        Parameters:
        onOk - called on ok pressed, before the dialog has been disposed
        Returns:
        this builder instance
      • onCancel

        OkCancelDialogBuilder onCancel​(Runnable onCancel)
        Parameters:
        onCancel - called on cancel pressed, before the dialog has been disposed
        Returns:
        this builder instance
      • okAction

        OkCancelDialogBuilder okAction​(Action okAction)
        Parameters:
        okAction - the action for the OK button, this action must dispose the dialog
        Returns:
        this builder instance
      • cancelAction

        OkCancelDialogBuilder cancelAction​(Action cancelAction)
        Parameters:
        cancelAction - the action for the Cancel button
        Returns:
        this builder instance
      • show

        JDialog show()
        Builds and shows the dialog.
        Returns:
        a new JDialog instance based on this builder.
        Throws:
        IllegalStateException - in case no component has been specified
      • build

        JDialog build()
        Returns:
        a new JDialog instance based on this builder.
        Throws:
        IllegalStateException - in case no component has been specified