TextInputDialog

scalafx.scene.control.TextInputDialog
See theTextInputDialog companion object
class TextInputDialog(val delegate: TextInputDialog) extends Dialog[String], SFXDelegate[TextInputDialog]

A dialog that shows a text input control to the user.

Wraps a JavaFX Dialog.

Attributes

Constructor

Creates a new TextInputDialog without a default value entered into the dialog.

Companion
object
Graph
Supertypes
class Dialog[String]
class EventTarget
trait SFXDelegate[TextInputDialog]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited classlikes

object FilterMagnet

Companion object implementing Magnet Pattern Magnet Pattern to avoid compilation error "ambiguous reference to overloaded definition"

Companion object implementing Magnet Pattern Magnet Pattern to avoid compilation error "ambiguous reference to overloaded definition"

Attributes

Inherited from:
EventTarget
Supertypes
class Object
trait Matchable
class Any
sealed trait FilterMagnet[J <: Event, S <: SFXDelegate[J]]

Trait implementing Magnet Pattern to avoid compilation error "ambiguous reference to overloaded definition"

Trait implementing Magnet Pattern to avoid compilation error "ambiguous reference to overloaded definition"

Attributes

Inherited from:
EventTarget
Supertypes
class Object
trait Matchable
class Any
object HandlerMagnet

Companion object implementing Magnet Pattern Magnet Pattern to avoid compilation error "ambiguous reference to overloaded definition"

Companion object implementing Magnet Pattern Magnet Pattern to avoid compilation error "ambiguous reference to overloaded definition"

Attributes

Inherited from:
EventTarget
Supertypes
class Object
trait Matchable
class Any
sealed trait HandlerMagnet[J <: Event, S <: SFXDelegate[J]]

Trait implementing Magnet Pattern to avoid compilation error "ambiguous reference to overloaded definition"

Trait implementing Magnet Pattern to avoid compilation error "ambiguous reference to overloaded definition"

Attributes

Inherited from:
EventTarget
Supertypes
class Object
trait Matchable
class Any

Value members

Constructors

def this(defaultValue: String)

Creates a new TextInputDialog with the default value entered into the dialog TextField.

Creates a new TextInputDialog with the default value entered into the dialog TextField.

Attributes

Concrete methods

The default value that was specified in the constructor.

The default value that was specified in the constructor.

Attributes

The TextField used within this dialog.

The TextField used within this dialog.

Attributes

Shows the dialog and waits for the user response (in other words, brings up a blocking dialog, with the returned value the users input).

Shows the dialog and waits for the user response (in other words, brings up a blocking dialog, with the returned value the users input).

 dialog.showAndWait()

Or when return value is required:

 val r = dialog.showAndWait()
 r match {
   case Some(v) => ...
   case None    => ...
 }

Attributes

Returns

An Option that contains the result.

Inherited methods

Construct an event dispatch chain for this target. The event dispatch chain contains event dispatchers which might be interested in processing of events targeted at this EventTarget. This event target is not automatically added to the chain, so if it wants to process events, it needs to add an EventDispatcher for itself to the chain.

Construct an event dispatch chain for this target. The event dispatch chain contains event dispatchers which might be interested in processing of events targeted at this EventTarget. This event target is not automatically added to the chain, so if it wants to process events, it needs to add an EventDispatcher for itself to the chain.

In the case the event target is part of some hierarchy, the chain for it is usually built from event dispatchers collected from the root of the hierarchy to the event target.

The event dispatch chain is constructed by modifications to the provided initial event dispatch chain. The returned chain should have the initial chain at its end so the dispatchers should be prepended to the initial chain.

The caller shouldn't assume that the initial chain remains unchanged nor that the returned value will reference a different chain.

Value parameters

tail

the initial chain to build from

Attributes

Returns

the resulting event dispatch chain for this target

See also
Inherited from:
EventTarget

A property representing the content text for the dialog pane. The content text is lower precedence than the scalafx.scene.control.DialogPane.content node, meaning that if both the content node and the contentText properties are set, the content text will not be displayed in a default DialogPane instance.

A property representing the content text for the dialog pane. The content text is lower precedence than the scalafx.scene.control.DialogPane.content node, meaning that if both the content node and the contentText properties are set, the content text will not be displayed in a default DialogPane instance.

Attributes

See also
Inherited from:
Dialog
def contentText_=(value: String): Unit

Attributes

Inherited from:
Dialog
def dialogPane: ObjectProperty[DialogPane]

Attributes

Inherited from:
Dialog

Attributes

Inherited from:
Dialog
override def equals(ref: Any): Boolean

Verifies if a object is equals to this delegate.

Verifies if a object is equals to this delegate.

Value parameters

ref

Object to be compared.

Attributes

Returns

if the other object is equals to this delegate or not.

Definition Classes
SFXDelegate -> Any
Inherited from:
SFXDelegate
def filterEvent[J <: Event, S <: Event & SFXDelegate[J]](eventType: EventType[J])(filter: FilterMagnet[J, S]): Subscription

Registers an event filter. Registered event filters get an event before any associated event handlers.

Registers an event filter. Registered event filters get an event before any associated event handlers.

Example of filtering mouse events

pane.filterEvent(MouseEvent.Any) {
  me: MouseEvent => {
    me.eventType match {
      case MouseEvent.MousePressed => {
        ...
      }
      case MouseEvent.MouseDragged => {
        ...
      }
      case _ => {
        ...
      }
    }
  }
}

or

pane.filterEvent(MouseEvent.Any) { () => println("Some mouse event handled") }

Type parameters

J

type JavaFX delegate of the event

S

ScalaFX type for J type wrapper.

Value parameters

eventType

type of events that will be handled.

filter

code handling the event, see examples above.

Attributes

Inherited from:
EventTarget
def graphic: ObjectProperty[Node]

The dialog graphic, presented either in the header, if one is showing, or to the left of the content.

The dialog graphic, presented either in the header, if one is showing, or to the left of the content.

Attributes

See also
Inherited from:
Dialog
def graphic_=(value: Node): Unit

Attributes

Inherited from:
Dialog
def handleEvent[J <: Event, S <: Event & SFXDelegate[J]](eventType: EventType[J])(handler: HandlerMagnet[J, S]): Subscription

Registers an event handler. The handler is called when the node receives an Event of the specified type during the bubbling phase of event delivery.

Registers an event handler. The handler is called when the node receives an Event of the specified type during the bubbling phase of event delivery.

Example of handling mouse events

pane.handleEvent(MouseEvent.Any) {
  me: MouseEvent => {
    me.eventType match {
      case MouseEvent.MousePressed => ...
      case MouseEvent.MouseDragged => ...
      case _                       => {}
    }
  }
}

or

pane.handleEvent(MouseEvent.Any) { () => println("Some mouse event handled") }

Type parameters

J

type JavaFX delegate of the event

S

ScalaFX type for J type wrapper.

Value parameters

eventType

type of events that will be handled.

handler

code handling the event, see examples above.

Attributes

Returns

Returns a subscription that can be used to cancel/remove this event handler

Inherited from:
EventTarget
override def hashCode: Int

Attributes

Returns

The delegate hashcode

Definition Classes
SFXDelegate -> Any
Inherited from:
SFXDelegate

A property representing the header text for the dialog pane. The header text is lower precedence than the scalafx.scene.control.DialogPane.header node, meaning that if both the header node and the headerText properties are set, the header text will not be displayed in a default DialogPane instance.

A property representing the header text for the dialog pane. The header text is lower precedence than the scalafx.scene.control.DialogPane.header node, meaning that if both the header node and the headerText properties are set, the header text will not be displayed in a default DialogPane instance.

Attributes

See also
Inherited from:
Dialog
def headerText_=(value: Option[String]): Unit

Attributes

Inherited from:
Dialog
def headerText_=(value: String): Unit

Attributes

Inherited from:
Dialog

Property representing the height of the dialog.

Property representing the height of the dialog.

Attributes

Inherited from:
Dialog
def height_=(h: Double): Unit

Attributes

Inherited from:
Dialog
def initModality(modality: Modality): Unit

Specifies the modality for this dialog. This must be done prior to making the dialog visible. The modality is one of: Modality.NONE, Modality.WINDOW_MODAL, or Modality.APPLICATION_MODAL.

Specifies the modality for this dialog. This must be done prior to making the dialog visible. The modality is one of: Modality.NONE, Modality.WINDOW_MODAL, or Modality.APPLICATION_MODAL.

Value parameters

modality

the modality for this dialog.

Attributes

Throws
IllegalStateException

if this property is set after the dialog has ever been made visible.

Inherited from:
Dialog
def initOwner(window: Window): Unit

Specifies the owner Window for this dialog, or null for a top-level, unowned dialog. This must be done prior to making the dialog visible.

Specifies the owner Window for this dialog, or null for a top-level, unowned dialog. This must be done prior to making the dialog visible.

Value parameters

window

the owner Window for this dialog.

Attributes

Throws
IllegalStateException

if this property is set after the dialog has ever been made visible.

Inherited from:
Dialog
def initStyle(style: StageStyle): Unit

Specifies the style for this dialog. This must be done prior to making the dialog visible. The style is one of: StageStyle.DECORATED, StageStyle.UNDECORATED, StageStyle.TRANSPARENT, StageStyle.UTILITY, or StageStyle.UNIFIED.

Specifies the style for this dialog. This must be done prior to making the dialog visible. The style is one of: StageStyle.DECORATED, StageStyle.UNDECORATED, StageStyle.TRANSPARENT, StageStyle.UTILITY, or StageStyle.UNIFIED.

Value parameters

style

the style for this dialog.

Attributes

Throws
IllegalStateException

if this property is set after the dialog has ever been made visible.

Inherited from:
Dialog

Retrieves the modality attribute for this dialog.

Retrieves the modality attribute for this dialog.

Attributes

Returns

the modality.

See also
Inherited from:
Dialog
def onCloseRequest: ObjectProperty[EventHandler[DialogEvent]]

Attributes

Inherited from:
Dialog
def onCloseRequest_=(v: EventHandler[DialogEvent]): Unit

Attributes

Inherited from:
Dialog
def onHidden: ObjectProperty[EventHandler[DialogEvent]]

Called just after the Dialog has been hidden. When the scalafx.scene.control.Dialog is hidden, this event handler is invoked allowing the developer to clean up resources or perform other tasks when the scalafx.scene.control.Dialog is closed.

Called just after the Dialog has been hidden. When the scalafx.scene.control.Dialog is hidden, this event handler is invoked allowing the developer to clean up resources or perform other tasks when the scalafx.scene.control.Dialog is closed.

Attributes

Inherited from:
Dialog
def onHidden_=(v: EventHandler[DialogEvent]): Unit

Attributes

Inherited from:
Dialog
def onHiding: ObjectProperty[EventHandler[DialogEvent]]

Called just prior to the Dialog being hidden.

Called just prior to the Dialog being hidden.

Attributes

Inherited from:
Dialog
def onHiding_=(v: EventHandler[DialogEvent]): Unit

Attributes

Inherited from:
Dialog
def onShowing: ObjectProperty[EventHandler[DialogEvent]]

Called just prior to the Dialog being shown.

Called just prior to the Dialog being shown.

Attributes

Inherited from:
Dialog
def onShowing_=(v: EventHandler[DialogEvent]): Unit

Attributes

Inherited from:
Dialog
def onShown: ObjectProperty[EventHandler[DialogEvent]]

Called just after the Dialog is shown.

Called just after the Dialog is shown.

Attributes

Inherited from:
Dialog
def onShown_=(v: EventHandler[DialogEvent]): Unit

Attributes

Inherited from:
Dialog
def owner: Window

Retrieves the owner Window for this dialog, or null for an unowned dialog.

Retrieves the owner Window for this dialog, or null for an unowned dialog.

Attributes

Returns

the owner Window.

See also
Inherited from:
Dialog

Represents whether the dialog is resizable.

Represents whether the dialog is resizable.

Attributes

Inherited from:
Dialog

Attributes

Inherited from:
Dialog

A property representing what has been returned from the dialog. A result is generated through the resultConverter, which is intended to convert from the ButtonType that the user clicked on into a value of type R.

A property representing what has been returned from the dialog. A result is generated through the resultConverter, which is intended to convert from the ButtonType that the user clicked on into a value of type R.

Attributes

See also
Inherited from:
Dialog

API to convert the scalafx.scene.control.ButtonType that the user clicked on into a result that can be returned via the scalafx.scene.control.Dialog.result property. This is necessary as scalafx.scene.control.ButtonType represents the visual button within the dialog, and do not know how to map themselves to a valid result - that is a requirement of the dialog implementation by making use of the result converter. In some cases, the result type of a Dialog subclass is ButtonType (which means that the result converter can be null), but in some cases (where the result type, R, is not ButtonType or Void), this callback must be specified.

API to convert the scalafx.scene.control.ButtonType that the user clicked on into a result that can be returned via the scalafx.scene.control.Dialog.result property. This is necessary as scalafx.scene.control.ButtonType represents the visual button within the dialog, and do not know how to map themselves to a valid result - that is a requirement of the dialog implementation by making use of the result converter. In some cases, the result type of a Dialog subclass is ButtonType (which means that the result converter can be null), but in some cases (where the result type, R, is not ButtonType or Void), this callback must be specified.

Attributes

Inherited from:
Dialog

Attributes

Inherited from:
Dialog
def result_=(value: String): Unit

Attributes

Inherited from:
Dialog
def showAndWait[F](j2s: F)(implicit convert: DConvert[String, F]): Option[S]

Shows the dialog and waits for the user response (in other words, brings up a blocking dialog, with the returned value the users input).

Shows the dialog and waits for the user response (in other words, brings up a blocking dialog, with the returned value the users input).

The intended use when return value is ignored:

 dialog.showAndWait()

Or when return value is required:

 val r = dialog.showAndWait()
 r match {
   case Some(v) => ...
   case None => ...
 }

Attributes

Returns

An Option that contains the result.

See also
Inherited from:
Dialog

Represents whether the dialog is currently showing.

Represents whether the dialog is currently showing.

Attributes

Inherited from:
Dialog

Return the title of the dialog.

Return the title of the dialog.

Attributes

Inherited from:
Dialog
def title_=(v: String): Unit

Attributes

Inherited from:
Dialog
override def toString: String

Attributes

Returns

Returns the original delegate's toString() adding a [SFX] prefix.

Definition Classes
SFXDelegate -> Any
Inherited from:
SFXDelegate

Property representing the width of the dialog.

Property representing the width of the dialog.

Attributes

Inherited from:
Dialog
def width_=(w: Double): Unit

Attributes

Inherited from:
Dialog

The horizontal location of this scalafx.scene.control.Dialog. Changing this attribute will move the scalafx.scene.control.Dialog horizontally.

The horizontal location of this scalafx.scene.control.Dialog. Changing this attribute will move the scalafx.scene.control.Dialog horizontally.

Attributes

Inherited from:
Dialog
def x_=(v: Double): Unit

Attributes

Inherited from:
Dialog

The vertical location of this scalafx.scene.control.Dialog. Changing this attribute will move the scalafx.scene.control.Dialog vertically.

The vertical location of this scalafx.scene.control.Dialog. Changing this attribute will move the scalafx.scene.control.Dialog vertically.

Attributes

Inherited from:
Dialog
def y_=(v: Double): Unit

Attributes

Inherited from:
Dialog

Concrete fields

override val delegate: TextInputDialog

JavaFX object to be wrapped.

JavaFX object to be wrapped.

Attributes