|
TrueZIP 6.8.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.schlichtherle.key.passwd.swing.PromptingKeyProviderUI
public class PromptingKeyProviderUI
A Swing based user interface to prompt for passwords or key files. This class is thread safe.
| Field Summary | |
|---|---|
static int |
KEY_FILE_LEN
This is the number of bytes to load from the beginning of a key file. |
| Constructor Summary | |
|---|---|
PromptingKeyProviderUI()
|
|
| Method Summary | |
|---|---|
protected CreateKeyPanel |
createCreateKeyPanel()
A factory method to create the Create Protected Resource Key Panel. |
protected OpenKeyPanel |
createOpenKeyPanel()
A factory method to create the Open Protected Resource Key Panel. |
protected CreateKeyPanel |
getCreateKeyPanel()
Deprecated. This method is not used anymore and will be removed for the next major release number. It's use may dead lock the GUI. Use createCreateKeyPanel() instead. |
protected Feedback |
getInvalidCreateKeyFeedback()
|
protected Feedback |
getInvalidOpenKeyFeedback()
|
protected OpenKeyPanel |
getOpenKeyPanel()
Deprecated. This method is not used anymore and will be removed for the next major release number. It's use may dead lock the GUI. Use createOpenKeyPanel() instead. |
protected Feedback |
getUnknownCreateKeyFeedback()
|
protected Feedback |
getUnknownOpenKeyFeedback()
|
void |
promptCreateKey(PromptingKeyProvider provider)
Prompts the user for the key which may be used to create a new protected resource or entirely replace the contents of an already existing protected resource. |
protected void |
promptCreateKey(PromptingKeyProvider provider,
JComponent extraDataUI)
This method is only called by the AWT Event Dispatch Thread, so it doesn't need to be thread safe. |
boolean |
promptInvalidOpenKey(PromptingKeyProvider provider)
Prompts the user for the key which may be used to open an existing protected resource in order to access its contents. |
protected boolean |
promptOpenKey(PromptingKeyProvider provider,
boolean invalid,
JComponent extraDataUI)
This method is only called by the AWT Event Dispatch Thread, so it doesn't need to be thread safe. |
boolean |
promptUnknownOpenKey(PromptingKeyProvider provider)
Prompts the user for the key which may be used to open an existing protected resource in order to access its contents. |
protected void |
setInvalidCreateKeyFeedback(Feedback ickf)
|
protected void |
setInvalidOpenKeyFeedback(Feedback iokf)
|
protected void |
setUnknownOpenKeyFeedback(Feedback uokf)
|
protected void |
setUnkownCreateKeyFeedback(Feedback uckf)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int KEY_FILE_LEN
| Constructor Detail |
|---|
public PromptingKeyProviderUI()
| Method Detail |
|---|
protected CreateKeyPanel getCreateKeyPanel()
createCreateKeyPanel() instead.
protected CreateKeyPanel createCreateKeyPanel()
protected OpenKeyPanel getOpenKeyPanel()
createOpenKeyPanel() instead.
protected OpenKeyPanel createOpenKeyPanel()
protected Feedback getUnknownCreateKeyFeedback()
protected void setUnkownCreateKeyFeedback(Feedback uckf)
protected Feedback getInvalidCreateKeyFeedback()
protected void setInvalidCreateKeyFeedback(Feedback ickf)
protected Feedback getUnknownOpenKeyFeedback()
protected void setUnknownOpenKeyFeedback(Feedback uokf)
protected Feedback getInvalidOpenKeyFeedback()
protected void setInvalidOpenKeyFeedback(Feedback iokf)
public final void promptCreateKey(PromptingKeyProvider provider)
PromptingKeyProviderUI
Upon return, the implementation is expected to update the common key
in provider.
Upon return, if provider.getKey() returns null,
prompting for the key is assumed to have been cancelled by the user.
In this case, the current and each subsequent call to
KeyProvider.getOpenKey() or KeyProvider.getCreateKey()
by the client results in an UnknownKeyException and the user
is not prompted anymore until the provider is reset by the
KeyManager.
Otherwise, the key is used as the common key, a clone of which is
provided to the client upon request.
Hint: If the user cancels the dialog, it is recommended to
leave the provider's key property simply unmodified.
This causes the old key to be reused and allows the client to
continue its operation as if the user would not have requested to
change the key.
Since TrueZIP 6.4, an implementation may also throw a
RuntimeException with any kind of UnknownKeyException
as its cause.
This will trigger the calling method in the
PromptingKeyProvider class to unwrap and pass on the
cause without changing its state.
This may be useful if prompting was interrupted by a call to
Thread.interrupt() while waiting on the Event Dispatch Thread.
In this case, another try to prompt the user should have the chance to
succeed instead of being cancelled without actually prompting the user
again.
To trigger this behaviour, the implementation should simply throw any
kind of RuntimeException with a
KeyPromptingInterruptedException as its cause.
promptCreateKey in interface PromptingKeyProviderUIprovider - The default key provider to store the result in.public final boolean promptUnknownOpenKey(PromptingKeyProvider provider)
PromptingKeyProviderUI
Upon return, the implementation is expected to update the common key
in provider.
Upon return, if provider.getKey() returns null,
prompting for the key is assumed to have been cancelled by the user.
In this case, the current and each subsequent call to
KeyProvider.getOpenKey() or KeyProvider.getCreateKey()
by the client results in an UnknownKeyException and the user
is not prompted anymore until the provider is reset by the
KeyManager.
Otherwise, the key is used as the common key, a clone of which is
provided to the client upon request.
Since TrueZIP 6.4, an implementation may also throw a
RuntimeException with any kind of UnknownKeyException
as its cause.
This will trigger the calling method in the
PromptingKeyProvider class to unwrap and pass on the
cause without changing its state.
This may be useful if prompting was interrupted by a call to
Thread.interrupt() while waiting on the Event Dispatch Thread.
In this case, another try to prompt the user should have the chance to
succeed instead of being cancelled without actually prompting the user
again.
To trigger this behaviour, the implementation should simply throw any
kind of RuntimeException with a
KeyPromptingInterruptedException as its cause.
promptUnknownOpenKey in interface PromptingKeyProviderUIprovider - The key provider to store the result in.
true if the user has requested to change the
provided key.public final boolean promptInvalidOpenKey(PromptingKeyProvider provider)
PromptingKeyProviderUIPromptingKeyProviderUI.promptUnknownOpenKey(de.schlichtherle.key.PromptingKeyProvider) is invalid.
Upon return, the implementation is expected to update the common key
in provider.
Upon return, if provider.getKey() returns null,
prompting for the key is assumed to have been cancelled by the user.
In this case, the current and each subsequent call to
KeyProvider.getOpenKey() or KeyProvider.getCreateKey()
by the client results in an UnknownKeyException and the user
is not prompted anymore until the provider is reset by the
KeyManager.
Otherwise, the key is used as the common key, a clone of which is
provided to the client upon request.
Since TrueZIP 6.4, an implementation may also throw a
RuntimeException with any kind of UnknownKeyException
as its cause.
This will trigger the calling method in the
PromptingKeyProvider class to unwrap and pass on the
cause without changing its state.
This may be useful if prompting was interrupted by a call to
Thread.interrupt() while waiting on the Event Dispatch Thread.
In this case, another try to prompt the user should have the chance to
succeed instead of being cancelled without actually prompting the user
again.
To trigger this behaviour, the implementation should simply throw any
kind of RuntimeException with a
KeyPromptingInterruptedException as its cause.
promptInvalidOpenKey in interface PromptingKeyProviderUIprovider - The key provider to store the result in.
true if the user has requested to change the
provided key.
protected void promptCreateKey(PromptingKeyProvider provider,
JComponent extraDataUI)
protected boolean promptOpenKey(PromptingKeyProvider provider,
boolean invalid,
JComponent extraDataUI)
|
TrueZIP 6.8.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||