Top Description Fields Constructors Methods
com.dlsc.workbenchfx.view.controls.dialog

public Class DialogControl

extends Control
Class Inheritance
Imports
com.dlsc.workbenchfx.Workbench, com.dlsc.workbenchfx.model.WorkbenchDialog, com.dlsc.workbenchfx.view.controls.GlassPane, java.util.Map, .Objects, .Optional, .WeakHashMap, javafx.application.Platform, javafx.beans.InvalidationListener, javafx.beans.binding.Bindings, javafx.beans.property.BooleanProperty, .ObjectProperty, .ReadOnlyBooleanProperty, .SimpleBooleanProperty, .SimpleObjectProperty, javafx.collections.FXCollections, .ObservableList, javafx.event.Event, .EventHandler, javafx.scene.Node, javafx.scene.control.Button, .ButtonBar, .ButtonType, .Control, .Skin, javafx.scene.input.KeyCode, .KeyEvent, org.slf4j.Logger, .LoggerFactory

Represents the standard control used to display dialogs in the Workbench.
Authors
François Martin, Marco Sanfratello

Field Summary

Modifier and TypeField and Description
private InvalidationListener
private final Map<ButtonType, Button>
private final ObservableList<Button>
private final BooleanProperty
private Button
private ButtonType
private Button
private ButtonType
private final ObjectProperty<WorkbenchDialog>
private InvalidationListener
private EventHandler<KeyEvent>
private static final Logger
private final ObjectProperty<EventHandler<Event>>
private final ObjectProperty<EventHandler<Event>>
private final BooleanProperty
private final ObjectProperty<Workbench>

Constructor Summary

AccessConstructor and Description
public
DialogControl()

Creates a dialog control.

Method Summary

Modifier and TypeMethod and Description
public final BooleanProperty
private void
private Button
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control.

public final ObjectProperty<WorkbenchDialog>
private void
private void
public final Optional<Button>

Returns:

the button or an empty Optional, if the DialogControl hasn't been initialized before
getButton
(ButtonType
to retrieve from the DialogControl
buttonType
)

Retrieves the Button instance of the DialogControl which is of the specified ButtonType.

public final ObservableList<Button>
public ButtonType
public final WorkbenchDialog
public final EventHandler<Event>
public final EventHandler<Event>
public final Workbench
public final void
hide()

public final boolean
public final boolean

Returns:

true if dialog is showing.
isShowing
()

Returns whether or not the dialog is showing.

public final ObjectProperty<EventHandler<Event>>

Returns:

the property to represent the event, which is invoked whenever the dialog has been hidden in the scene graph.
onHiddenProperty
()

The dialog's action, which is invoked whenever the dialog has been hidden in the scene graph.

public final ObjectProperty<EventHandler<Event>>

Returns:

the property to represent the event, which is invoked whenever the dialog has been fully initialized and is being shown.
onShownProperty
()

The dialog's action, which is invoked whenever the dialog has been fully initialized and is being shown.

public final void
setButtonTextUppercase(boolean buttonTextUppercase)

public final void
public final void
public final void
private void
setShowing(boolean showing)

private void
public final void
public final ReadOnlyBooleanProperty

Returns:

the property representing whether the dialog is currently showing
showingProperty
()

Represents whether the dialog is currently showing.

private void
private void
public final ObjectProperty<Workbench>
Inherited from javafx.scene.control.Control:
computeMaxHeightcomputeMaxWidthcomputeMinHeightcomputeMinWidthcomputePrefHeightcomputePrefWidthcontextMenuPropertyexecuteAccessibleActiongetBaselineOffsetgetClassCssMetaDatagetContextMenugetControlCssMetaDatagetCssMetaDatagetInitialFocusTraversablegetSkingetTooltipisResizablelayoutChildrenqueryAccessibleAttributesetContextMenusetSkinsetTooltipskinPropertytooltipProperty

Field Detail

blockingChangedListenerback to summary
private InvalidationListener blockingChangedListener
buttonNodesback to summary
private final Map<ButtonType, Button> buttonNodes
buttonsback to summary
private final ObservableList<Button> buttons
buttonTextUppercaseback to summary
private final BooleanProperty buttonTextUppercase
cancelButtonback to summary
private Button cancelButton
cancelButtonTypeback to summary
private ButtonType cancelButtonType
defaultButtonback to summary
private Button defaultButton
defaultButtonTypeback to summary
private ButtonType defaultButtonType
dialogback to summary
private final ObjectProperty<WorkbenchDialog> dialog
dialogChangedListenerback to summary
private InvalidationListener dialogChangedListener
escapeConsumeHandlerback to summary
private EventHandler<KeyEvent> escapeConsumeHandler
LOGGERback to summary
private static final Logger LOGGER
onHiddenback to summary
private final ObjectProperty<EventHandler<Event>> onHidden
onShownback to summary
private final ObjectProperty<EventHandler<Event>> onShown
showingPropertyback to summary
private final BooleanProperty showingProperty
workbenchback to summary
private final ObjectProperty<Workbench> workbench

Constructor Detail

DialogControlback to summary
public DialogControl()

Creates a dialog control.

Method Detail

buttonTextUppercasePropertyback to summary
public final BooleanProperty buttonTextUppercaseProperty()
completeDialogback to summary
private void completeDialog(ButtonType cmd)
createButtonback to summary
private Button createButton(ButtonType buttonType)
createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Doc from javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Returns:Skin<?>

new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.

Annotations
@Override
dialogPropertyback to summary
public final ObjectProperty<WorkbenchDialog> dialogProperty()
fireOnHiddenback to summary
private void fireOnHidden()
fireOnShownback to summary
private void fireOnShown()
getButtonback to summary
public final Optional<Button> getButton(ButtonType buttonType)

Retrieves the Button instance of the DialogControl which is of the specified ButtonType.

Parameters
buttonType:ButtonType

to retrieve from the DialogControl

Returns:Optional<Button>

the button or an empty Optional, if the DialogControl hasn't been initialized before

getButtonsback to summary
public final ObservableList<Button> getButtons()
getCancelButtonTypeback to summary
public ButtonType getCancelButtonType()
getDialogback to summary
public final WorkbenchDialog getDialog()
getOnHiddenback to summary
public final EventHandler<Event> getOnHidden()
getOnShownback to summary
public final EventHandler<Event> getOnShown()
getWorkbenchback to summary
public final Workbench getWorkbench()
hideback to summary
public final void hide()
isButtonTextUppercaseback to summary
public final boolean isButtonTextUppercase()
isShowingback to summary
public final boolean isShowing()

Returns whether or not the dialog is showing.

Returns:boolean

true if dialog is showing.

onHiddenPropertyback to summary
public final ObjectProperty<EventHandler<Event>> onHiddenProperty()

The dialog's action, which is invoked whenever the dialog has been hidden in the scene graph. An event will be fired whenever hide() or Workbench#hideDialog(WorkbenchDialog) has been called or the dialog has been closed by clicking on its corresponding GlassPane.

Returns:ObjectProperty<EventHandler<Event>>

the property to represent the event, which is invoked whenever the dialog has been hidden in the scene graph.

onShownPropertyback to summary
public final ObjectProperty<EventHandler<Event>> onShownProperty()

The dialog's action, which is invoked whenever the dialog has been fully initialized and is being shown. Whenever the dialogProperty(), WorkbenchDialog#buttonTypes, buttonTextUppercaseProperty() or workbenchProperty() changes, the dialog will be rebuilt and upon completion, an event will be fired.

Returns:ObjectProperty<EventHandler<Event>>

the property to represent the event, which is invoked whenever the dialog has been fully initialized and is being shown.

setButtonTextUppercaseback to summary
public final void setButtonTextUppercase(boolean buttonTextUppercase)
setDialogback to summary
public final void setDialog(WorkbenchDialog dialog)
setOnHiddenback to summary
public final void setOnHidden(EventHandler<Event> value)
setOnShownback to summary
public final void setOnShown(EventHandler<Event> value)
setShowingback to summary
private void setShowing(boolean showing)
setupChangeListenersback to summary
private void setupChangeListeners()
setWorkbenchback to summary
public final void setWorkbench(Workbench workbench)
showingPropertyback to summary
public final ReadOnlyBooleanProperty showingProperty()

Represents whether the dialog is currently showing.

Returns:ReadOnlyBooleanProperty

the property representing whether the dialog is currently showing

updateButtonsback to summary
private void updateButtons(WorkbenchDialog dialog)
updateKeyboardBehaviorback to summary
private void updateKeyboardBehavior()
workbenchPropertyback to summary
public final ObjectProperty<Workbench> workbenchProperty()