Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

oracle.javatools.dialogs
Class MessageDialogPersistence

java.lang.Object
  extended by oracle.javatools.dialogs.MessageDialogPersistence

public class MessageDialogPersistence
extends java.lang.Object

Persists information used for optional alerts in MessageDialog. The default implementation stores the information in a .properties file in the user's home directory. You can use the MessageDialog.setPersistence() method to override this behavior using a subclass.

Since:
10.0.3

Constructor Summary
MessageDialogPersistence()
           
 
Method Summary
 java.lang.Boolean getConfirmed(java.lang.String messageDialogId)
          Get the confirmation status of a Yes/No message dialog given the specified dialog ID, indicating whether the dialog has previously been confirmed by the user and should not be displayed.
protected  java.io.File getUserDirectory()
          Get the user's home directory.
protected  void handleError(java.lang.Exception e)
          Handle an exception that occurred during persistence / depersistence of message dialog settings.
 boolean isHidden(java.lang.String messageDialogId)
          Get whether the specified message dialog ID is hidden.
protected  java.util.Map loadSettings()
          Load settings from disk into a new map.
protected  void saveSettings(java.util.Map settings)
          Save settings from the specified map to disk.
 void setConfirmed(java.lang.String messageDialogId, java.lang.Boolean isConfirmed)
          Set the confirmation status of a Yes/No message dialog given the specified dialog ID, indicating whether the dialog should be displayed to the user in the future.
 void setHidden(java.lang.String messageDialogId, boolean isHidden)
          Set whether the specified message dialog ID is hidden.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageDialogPersistence

public MessageDialogPersistence()
Method Detail

isHidden

public final boolean isHidden(java.lang.String messageDialogId)
Get whether the specified message dialog ID is hidden. This method should be used only for information dialogs; for Yes/No confirmation dialogs, use getConfirmed(String).

Parameters:
messageDialogId - the ID of an optional message dialog.
Returns:
true if the specified message dialog should not be displayed.

setHidden

public final void setHidden(java.lang.String messageDialogId,
                            boolean isHidden)
Set whether the specified message dialog ID is hidden. This method should be used only for information dialogs; for Yes/No confirmation dialogs, use setConfirmed(String,Boolean).

Parameters:
messageDialogId - the ID of an optional message dialog.

getConfirmed

public final java.lang.Boolean getConfirmed(java.lang.String messageDialogId)
Get the confirmation status of a Yes/No message dialog given the specified dialog ID, indicating whether the dialog has previously been confirmed by the user and should not be displayed.

The method returns Boolean.TRUE if the dialog has already been confirmed and a "Yes" answer should be assumed, and it returns Boolean.FALSE if a "No" answer should be assumed; in either case, the dialog should not be displayed. The method returns null if the status is unknown and the confirmation dialog should be displayed.

Parameters:
messageDialogId - the ID of an optional Yes/No message dialog
Returns:
either Boolean.TRUE, Boolean.FALSE, or null

setConfirmed

public final void setConfirmed(java.lang.String messageDialogId,
                               java.lang.Boolean isConfirmed)
Set the confirmation status of a Yes/No message dialog given the specified dialog ID, indicating whether the dialog should be displayed to the user in the future.

Setting the confirmation status to Boolean.TRUE indicates the dialog should no longer be displayed and a "Yes" answer should be assumed, while Boolean.FALSE indicates a "No" answer should be assumed. Setting the confirmation status to null clears any previous status and indicates the dialog should be displayed in the future.

Parameters:
messageDialogId - the ID of an optional Yes/No message dialog
isConfirmed - either Boolean.TRUE, Boolean.FALSE, or null

loadSettings

protected java.util.Map loadSettings()
                              throws java.io.IOException
Load settings from disk into a new map.

Returns:
a map containing settings
Throws:
java.io.IOException - if an error occurs

saveSettings

protected void saveSettings(java.util.Map settings)
                     throws java.io.IOException
Save settings from the specified map to disk.

Throws:
java.io.IOException - if an error occurs

getUserDirectory

protected java.io.File getUserDirectory()
Get the user's home directory.

Returns:
the user's home directory

handleError

protected void handleError(java.lang.Exception e)
Handle an exception that occurred during persistence / depersistence of message dialog settings. The default implementation shows the exception dialog.

Parameters:
e - the exception that occurred

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

Copyright © 1997, 2011, Oracle. All rights reserved.