Module com.googlecode.lanterna
Class AbstractDialogBuilder<B,T extends DialogWindow>
- java.lang.Object
-
- com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<B,T>
-
- Type Parameters:
B
- The real type of the builder classT
- Type of dialog this builder is building
- Direct Known Subclasses:
ActionListDialogBuilder
,DirectoryDialogBuilder
,FileDialogBuilder
,ListSelectDialogBuilder
,TextInputDialogBuilder
public abstract class AbstractDialogBuilder<B,T extends DialogWindow> extends java.lang.Object
Abstract class for dialog building, containing much shared code between different kinds of dialogs
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
description
protected java.util.Set<Window.Hint>
extraWindowHints
protected java.lang.String
title
-
Constructor Summary
Constructors Constructor Description AbstractDialogBuilder(java.lang.String title)
Default constructor for a dialog builder
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
build()
Builds a new dialog following the specifications of this builderprotected abstract T
buildDialog()
Builds the dialog according to the builder implementationjava.lang.String
getDescription()
Returns the description that the built dialog will havejava.util.Set<Window.Hint>
getExtraWindowHints()
Returns the list of extra window hints that will be assigned to the window when builtjava.lang.String
getTitle()
Returns the title that the built dialog will haveprotected abstract B
self()
Helper method for casting this totype
parameterB
B
setDescription(java.lang.String description)
Changes the description of the dialogB
setExtraWindowHints(java.util.Set<Window.Hint> extraWindowHints)
Assigns a set of extra window hints that you want the built dialog to haveB
setTitle(java.lang.String title)
Changes the title of the dialog
-
-
-
Field Detail
-
title
protected java.lang.String title
-
description
protected java.lang.String description
-
extraWindowHints
protected java.util.Set<Window.Hint> extraWindowHints
-
-
Method Detail
-
setTitle
public B setTitle(java.lang.String title)
Changes the title of the dialog- Parameters:
title
- New title- Returns:
- Itself
-
getTitle
public java.lang.String getTitle()
Returns the title that the built dialog will have- Returns:
- Title that the built dialog will have
-
setDescription
public B setDescription(java.lang.String description)
Changes the description of the dialog- Parameters:
description
- New description- Returns:
- Itself
-
getDescription
public java.lang.String getDescription()
Returns the description that the built dialog will have- Returns:
- Description that the built dialog will have
-
setExtraWindowHints
public B setExtraWindowHints(java.util.Set<Window.Hint> extraWindowHints)
Assigns a set of extra window hints that you want the built dialog to have- Parameters:
extraWindowHints
- Window hints to assign to the window in addition to the ones the builder will put- Returns:
- Itself
-
getExtraWindowHints
public java.util.Set<Window.Hint> getExtraWindowHints()
Returns the list of extra window hints that will be assigned to the window when built- Returns:
- List of extra window hints that will be assigned to the window when built
-
self
protected abstract B self()
Helper method for casting this totype
parameterB
- Returns:
this
asB
-
buildDialog
protected abstract T buildDialog()
Builds the dialog according to the builder implementation- Returns:
- New dialog object
-
build
public final T build()
Builds a new dialog following the specifications of this builder- Returns:
- New dialog built following the specifications of this builder
-
-