Module is.codion.swing.common.ui
Package is.codion.swing.common.ui.dialog
Interface ComponentDialogBuilder
- All Superinterfaces:
DialogBuilder<ComponentDialogBuilder>
A builder for JDialog containing a single component.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
closeObserver
(Observer<?> closeObserver) Sets the Observer which triggers the closing of the dialog, note thatdisposeOnEscape(boolean)
has no effect if a closeObserver is specified.confirmCloseListener
(Consumer<State> confirmCloseListener) disposeOnEscape
(boolean disposeOnEscape) enterAction
(Action enterAction) modal
(boolean modal) onClosed
(Consumer<WindowEvent> onClosed) onOpened
(Consumer<WindowEvent> onOpened) resizable
(boolean resizable) show()
Builds and shows the dialog.Methods inherited from interface is.codion.swing.common.ui.dialog.DialogBuilder
icon, keyEvent, location, locationRelativeTo, owner, owner, title, title
-
Method Details
-
modal
- Parameters:
modal
- true if the dialog should be modal- Returns:
- this DialogBuilder instance
-
resizable
- Parameters:
resizable
- true if the dialog should be resizable- Returns:
- this DialogBuilder instance
-
size
- Parameters:
size
- the size of the dialog- Returns:
- this DialogBuilder instance
-
enterAction
- Parameters:
enterAction
- the action to associate with the ENTER key- Returns:
- this DialogBuilder instance
-
closeObserver
Sets the Observer which triggers the closing of the dialog, note thatdisposeOnEscape(boolean)
has no effect if a closeObserver is specified.- Parameters:
closeObserver
- if specified the dialog will be disposed of when and only when this observer is notified- Returns:
- this DialogBuilder instance
-
confirmCloseListener
- Parameters:
confirmCloseListener
- this listener, if specified, will be queried for confirmation before the dialog is closed, using the State instance to signal confirmation, the dialog will only be closed if that state is active after a call toConsumer.accept(Object)
- Returns:
- this DialogBuilder instance
-
disposeOnEscape
- Parameters:
disposeOnEscape
- if yes then the dialog is disposed when the ESC button is pressed, has no effect if acloseEvent
is specified- Returns:
- this DialogBuilder instance
-
onShown
- Parameters:
onShown
- called each time the dialog is shown- Returns:
- this builder instance
-
onOpened
- Parameters:
onOpened
- called when dialog is opened- Returns:
- this DialogBuilder instance
-
onClosed
- Parameters:
onClosed
- called when dialog is closed- Returns:
- this DialogBuilder instance
-
build
JDialog build()- Returns:
- a new JDialog instance based on this builder.
-
show
JDialog show()Builds and shows the dialog.- Returns:
- a new JDialog instance based on this builder.
-