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()Sets the sensor which triggers the closing of the dialog, note thatcloseOnEscape(boolean)has no effect if one is specified.closeOnEscape(boolean closeOnEscape) 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) 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, undecorated, windowFocusListener
-
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
-
close
Sets the sensor which triggers the closing of the dialog, note thatcloseOnEscape(boolean)has no effect if one is specified.- Parameters:
close- if specified the dialog will be disposed of when and only when this sensor 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
-
closeOnEscape
- Parameters:
closeOnEscape- true if the dialog should be closed when the ESC button is pressed, has no effect if aclose sensoris 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.
-