Module is.codion.swing.common.ui
Package is.codion.swing.common.ui.dialog
Class AbstractDialogBuilder<B extends DialogBuilder<B>>
java.lang.Object
is.codion.swing.common.ui.dialog.AbstractDialogBuilder<B>
- Type Parameters:
B- the builder type
- All Implemented Interfaces:
DialogBuilder<B>
public abstract class AbstractDialogBuilder<B extends DialogBuilder<B>>
extends Object
implements DialogBuilder<B>
A base class for Dialog builders.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<KeyEvents.Builder> protected @Nullable Observable<String> protected booleanprotected final List<WindowFocusListener> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final <T extends DialogBuilder<?>>
Tconfigure(T builder) Configures the given builder with the options this builder holds, the ones ofDialogBuilder: the owner, the location, the title, the icon, undecorated, the key events, the window focus listeners and the on-build consumers, for a builder that has another build its dialog.final Bfinal BkeyEvent(KeyEvents.Builder keyEventBuilder) Enables the key event defined by the givenKeyEvents.Builderon the dialog root pane.final BOverridesDialogBuilder.locationRelativeTo(Component).final BlocationRelativeTo(@Nullable Component locationRelativeTo) final Bfinal BSets the dialog owner as the parent window of the given component.final BSets the dialog owner as the given window.protected final Bself()final Btitle(@Nullable Observable<String> title) final Bfinal Bundecorated(boolean undecorated) final BwindowFocusListener(WindowFocusListener windowFocusListener)
-
Field Details
-
keyEventBuilders
-
onBuildConsumers
-
windowFocusListeners
-
owner
-
locationRelativeTo
-
location
-
title
-
icon
-
undecorated
protected boolean undecorated
-
-
Constructor Details
-
AbstractDialogBuilder
public AbstractDialogBuilder()
-
-
Method Details
-
owner
Description copied from interface:DialogBuilderSets the dialog owner as the given window. Also sets theDialogBuilder.locationRelativeTo(Component)to the given window in case one has not been specified.- Specified by:
ownerin interfaceDialogBuilder<B extends DialogBuilder<B>>- Parameters:
owner- the dialog owner- Returns:
- this DialogBuilder instance
-
owner
Description copied from interface:DialogBuilderSets the dialog owner as the parent window of the given component. Also sets theDialogBuilder.locationRelativeTo(Component)using the given component in case one has not been specified.- Specified by:
ownerin interfaceDialogBuilder<B extends DialogBuilder<B>>- Parameters:
owner- the dialog parent component- Returns:
- this builder instance
-
locationRelativeTo
- Specified by:
locationRelativeToin interfaceDialogBuilder<B extends DialogBuilder<B>>- Parameters:
locationRelativeTo- the component for the relative location- Returns:
- this builder instance
-
location
Description copied from interface:DialogBuilderOverridesDialogBuilder.locationRelativeTo(Component).- Specified by:
locationin interfaceDialogBuilder<B extends DialogBuilder<B>>- Parameters:
location- the location of the dialog- Returns:
- this builder instance
-
title
- Specified by:
titlein interfaceDialogBuilder<B extends DialogBuilder<B>>- Parameters:
title- the dialog title- Returns:
- this builder instance
-
title
- Specified by:
titlein interfaceDialogBuilder<B extends DialogBuilder<B>>- Parameters:
title- an observable for a dynamic dialog title- Returns:
- this builder instance
-
icon
- Specified by:
iconin interfaceDialogBuilder<B extends DialogBuilder<B>>- Parameters:
icon- the dialog icon- Returns:
- this builder instance
-
keyEvent
Description copied from interface:DialogBuilderEnables the key event defined by the givenKeyEvents.Builderon the dialog root pane.- Specified by:
keyEventin interfaceDialogBuilder<B extends DialogBuilder<B>>- Parameters:
keyEventBuilder- a key event builder to enable on the dialog root pane- Returns:
- this builder instance
-
undecorated
- Specified by:
undecoratedin interfaceDialogBuilder<B extends DialogBuilder<B>>- Parameters:
undecorated- true if the dialog should be undecorated- Returns:
- this builder instance
-
windowFocusListener
- Specified by:
windowFocusListenerin interfaceDialogBuilder<B extends DialogBuilder<B>>- Parameters:
windowFocusListener- a window focus listener- Returns:
- this builder instance
-
onBuild
- Specified by:
onBuildin interfaceDialogBuilder<B extends DialogBuilder<B>>- Parameters:
onBuild- called when the dialog has been built, before it is shown- Returns:
- this builder instance
-
configure
Configures the given builder with the options this builder holds, the ones ofDialogBuilder: the owner, the location, the title, the icon, undecorated, the key events, the window focus listeners and the on-build consumers, for a builder that has another build its dialog. Null options are left to the builder given, whose own settings, chained after this, override.- Type Parameters:
T- the builder type- Parameters:
builder- the builder building the dialog- Returns:
- the builder given
-
self
-