public final class PassphraseFrameDialog extends javax.swing.JFrame implements PassphrasePrompt
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
protected boolean |
cancelAllowed_
indicates if this passphrase dialog can be canceled by the user with entering a password
|
protected boolean |
dialogClosed_
Used to emulated a modal dialog.
|
protected java.lang.Object |
dialogClosedLock_
This is a flag that is used to synchronize the threads to have a modal dialog
|
protected java.awt.GridBagLayout |
gridBagLayout1_
Layout for content pane
|
protected javax.swing.JButton |
jButtonOK_
OK button
|
protected javax.swing.JLabel |
jLPassphrase_
Label for passphrase field
|
protected javax.swing.JPasswordField |
jPFPassphrase_
Passphrase field
|
protected javax.swing.JTextArea |
jTAMsg_
Label to display message
|
static java.lang.String |
LINE_SEPARATOR
The separator used to separate lines in the message component.
|
protected java.lang.String |
message_
Message in this dialog
|
protected javax.swing.JPanel |
panel1_
Content pane
|
protected char[] |
passphrase_
The passphrase
|
protected java.lang.Object |
protectedResourceInfo_
Object specifying the protected resource; e.g.
|
protected static java.util.ResourceBundle |
res_
Used to read strings from (internationalization)
|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
PassphraseFrameDialog()
Empty constructor.
|
PassphraseFrameDialog(java.lang.String title)
Construct a new PasswordDialog with the specified dialog title.
|
PassphraseFrameDialog(java.lang.String title,
java.lang.Object promptMessageObject)
Construct a new PasswordDialog with the specified dialog title and the specified message as
label for the passphrase field.
|
Modifier and Type | Method and Description |
---|---|
protected void |
dialogInit()
Initialize all components of this dialog.
|
void |
dispose()
Overridden to catch the call to this method.
|
protected void |
fillMessage()
This method fills the
jTAMsg_ component which holds the message. |
char[] |
getPassphrase()
Gets the passphrase that was entered by the user and delete the internal copy of the password
afterwards.
|
boolean |
isCancelAllowed()
Check, if the user can cancel this dialog; e.g.
|
static void |
main(java.lang.String[] args)
For testing only.
|
void |
paint(java.awt.Graphics g)
We have overridden this method to set the input focus to the password field when the dialog is
painted the first time.
|
char[] |
promptPassphrase()
Show this dialog and return the entered password.
|
void |
setCancelAllowed(boolean allowCancel)
Set, if the user is allowed to cancel this dialog without entering a password.
|
void |
setMessage(java.lang.Object promptMessageObject)
Set the message to be displayed by this dialog.
|
void |
setProtectedResourceInfo(java.lang.Object protectedResourceInfo)
Set the object that represents the protected resources; i.e.
|
void |
show()
Show this dialog.
|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String LINE_SEPARATOR
protected static java.util.ResourceBundle res_
protected boolean cancelAllowed_
protected javax.swing.JPanel panel1_
protected java.awt.GridBagLayout gridBagLayout1_
protected javax.swing.JTextArea jTAMsg_
protected javax.swing.JLabel jLPassphrase_
protected javax.swing.JPasswordField jPFPassphrase_
protected javax.swing.JButton jButtonOK_
protected java.lang.String message_
protected java.lang.Object protectedResourceInfo_
protected char[] passphrase_
protected java.lang.Object dialogClosedLock_
protected boolean dialogClosed_
public PassphraseFrameDialog()
public PassphraseFrameDialog(java.lang.String title)
title
- The title of the dialog box.public PassphraseFrameDialog(java.lang.String title, java.lang.Object promptMessageObject)
title
- The title of the dialog box.promptMessageObject
- The label text object for the passphrase field.public void setMessage(java.lang.Object promptMessageObject)
toString()
of this object.setMessage
in interface PassphraseInterfacce
promptMessageObject
- The message object.public void setProtectedResourceInfo(java.lang.Object protectedResourceInfo)
toString()
.setProtectedResourceInfo
in interface PassphraseInterfacce
protectedResourceInfo
- The resource info object.public void show()
show
in class java.awt.Window
public void paint(java.awt.Graphics g)
paint
in class java.awt.Window
g
- see Container.paint(java.awt.Graphics)
.public char[] getPassphrase()
public boolean isCancelAllowed()
isCancelAllowed
in interface PassphraseInterfacce
public void setCancelAllowed(boolean allowCancel)
setCancelAllowed
in interface PassphraseInterfacce
allowCancel
- True, to allow the user to cancel the dialog.public char[] promptPassphrase()
getPassphrase()
method, because this method already
calls this method.promptPassphrase
in interface PassphrasePrompt
protected void fillMessage()
jTAMsg_
component which holds the message. It fills it with the
prompt message followed by information about the protected resource; e.g. the token label, if
the resource info is a TokenInfo
object. A subclass may override this method to
display different things to the user.protected void dialogInit()
public void dispose()
dispose
in class java.awt.Window
public static void main(java.lang.String[] args)
IAIK JavaSecurity Website https://jce.iaik.tugraz.at/
IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2023 IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved. Version 1.9.4