Package com.jgcomptech.tools.dialogs
Class LoginDialog
- java.lang.Object
-
- com.jgcomptech.tools.dialogs.LoginDialog
-
public final class LoginDialog extends java.lang.Object
Creates a Login Dialog for use to authenticate passwords.Use setTitle to set the title of the window
Use setHeaderText to set the header of the window
Use setIconPath to set the icon of the window, path must be in the resource folder- Since:
- 1.3.0, 1.5.0 changed to wrapper class removing Platform.runLater() requirement.
-
-
Constructor Summary
Constructors Constructor Description LoginDialog(java.lang.String warningText, boolean redText)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the dialog.com.jgcomptech.tools.dialogs.LoginDialogImpl
getDialog()
Returns the LoginDialog Dialog implementation object.java.lang.String
getHeaderText()
Returns the string to show in the dialog header area.java.lang.String
getIconPath()
Returns the path in the resource folder of the window icon.java.lang.String
getTitle()
Return the title of the dialog.void
hide()
Hides the dialog.boolean
isShowing()
Returns whether or not the dialog is showing.void
setHeaderText(java.lang.String headerText)
Sets the string to show in the dialog header area.void
setIconPath(java.lang.String iconPath)
Sets the path in the resource folder of the window icon.void
setTitle(java.lang.String title)
Change the title of the dialog.java.util.Optional<javafx.util.Pair<java.lang.String,java.lang.String>>
showAndWait()
Shows the dialog and waits for the user response (in other words, brings up a blocking dialog, with the returned value the users input).
-
-
-
Method Detail
-
showAndWait
public java.util.Optional<javafx.util.Pair<java.lang.String,java.lang.String>> showAndWait()
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 first string value is the username and the second is the password.- Returns:
- An
Optional
that contains the result. Refer to theDialog
class documentation for more detail. - Throws:
java.lang.IllegalStateException
- if this method is called during animation or layout processing.
-
getIconPath
public java.lang.String getIconPath()
Returns the path in the resource folder of the window icon.- Returns:
- the icon path
-
setIconPath
public void setIconPath(java.lang.String iconPath)
Sets the path in the resource folder of the window icon.- Parameters:
iconPath
- the icon path
-
close
public void close()
Closes the dialog.
-
hide
public void hide()
Hides the dialog.
-
getTitle
public java.lang.String getTitle()
Return the title of the dialog.- Returns:
- the title of the dialog
-
setTitle
public void setTitle(java.lang.String title)
Change the title of the dialog.- Parameters:
title
- the title to set
-
getHeaderText
public java.lang.String getHeaderText()
Returns the string to show in the dialog header area.- Returns:
- the string to show in the dialog header area
-
setHeaderText
public void setHeaderText(java.lang.String headerText)
Sets the string to show in the dialog header area.- Parameters:
headerText
- the header text to set
-
isShowing
public boolean isShowing()
Returns whether or not the dialog is showing.- Returns:
- true if dialog is showing
-
getDialog
public com.jgcomptech.tools.dialogs.LoginDialogImpl getDialog()
Returns the LoginDialog Dialog implementation object.- Returns:
- the LoginDialog Dialog implementation object
-
-