An important method inherited from NotifyDescriptor: Object getValue() -- get the value the user has selected.
Allows you determine which button was pressed.
Example:
NotifyDescriptor.Confirmation cf = new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.",NotifyDescriptor.YES_NO_OPTION); TopManager.getDefault ().notify (cf); if(cf.getValue()==NotifyDescriptor.CANCEL_OPTION){
//if Cancel was pressed do...
} else{
//else do...
}
Example of the first constructor:
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green."));
Example of the second constructor:
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", NotifyDescriptor.DEFAULT_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", NotifyDescriptor.YES_NO_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", NotifyDescriptor.YES_NO_CANCEL_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", NotifyDescriptor.PLAIN_MESSAGE));
Example of the third constructor: Same as sixth constructor, only title depends on argument
messageType (similary with second constructor of NotifyDescriptor.Message)
Example of the fourth constructor:
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs aren't supposed to be green.",
"Inane title"));
Example of the fifth constructor:
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.DEFAULT_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.YES_NO_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.YES_NO_CANCEL_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.NotifyDescriptor.OK_CANCEL_OPTION));
Example of the sixth constructor (some combinations are strange):
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.INFORMATION_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.INFORMATION_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.YES_NO_CANCEL_OPTION, NotifyDescriptor.INFORMATION_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.INFORMATION_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.OK_OPTION, NotifyDescriptor.WARNING_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.WARNING_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.YES_NO_CANCEL_OPTION, NotifyDescriptor.WARNING_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.WARNING_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.ERROR_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.ERROR_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.YES_NO_CANCEL_OPTION, NotifyDescriptor.ERROR_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.ERROR_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.QUESTION_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.YES_NO_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.PLAIN_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.PLAIN_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.YES_NO_CANCEL_OPTION, NotifyDescriptor.PLAIN_MESSAGE));
TopManager.getDefault ().notify (new NotifyDescriptor.Confirmation("Eggs
aren't supposed to be green.", "Inane title", NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.PLAIN_MESSAGE));