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(@Nullable Observer<?> closeObserver) Sets the Observer which triggers the closing of the dialog, note thatdisposeOnEscape(boolean)has no effect if a closeObserver is specified.component(Supplier<? extends JComponent> component) Note: sets the layout toBorderLayoutand adds the component at locationBorderLayout.CENTERcomponent(JComponent component) Note: sets the layout toBorderLayoutand adds the component at locationBorderLayout.CENTERconfirmCloseListener(@Nullable 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, onBuild, owner, owner, title, title
-
Method Details
-
component
Note: sets the layout toBorderLayoutand adds the component at locationBorderLayout.CENTER- Parameters:
component- the component to display- Returns:
- this builder instance
-
component
Note: sets the layout toBorderLayoutand adds the component at locationBorderLayout.CENTER- Parameters:
component- the component to display- Returns:
- this builder instance
-
modal
- Parameters:
modal- true if the dialog should be modal, default true- Returns:
- this builder instance
-
resizable
- Parameters:
resizable- true if the dialog should be resizable, default true- Returns:
- this builder instance
-
size
- Parameters:
size- the size of the dialog- Returns:
- this builder instance
-
enterAction
- Parameters:
enterAction- the action to associate with the ENTER key- Returns:
- this builder 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 builder 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 builder instance
-
disposeOnEscape
- Parameters:
disposeOnEscape- if yes then the dialog is disposed when the ESC button is pressed, has no effect if acloseEventis specified- Returns:
- this builder 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 builder instance
-
onClosed
- Parameters:
onClosed- called when dialog is closed- Returns:
- this builder 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.
-