cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

NotifyDescriptor.InputLine

This class has two constructors:
  1. NotifyDescriptor.InputLine(String text,  String title) -- construct dialog with the specified title and label text.
  2. NotifyDescriptor.InputLine(String text, String title, int optionType, int messageType) -- construct dialog with the specified title, label text, option and message types.
    • messageTypes:
      • information icon -- NotifyDescriptor.INFORMATION_MESSAGE
      • warning icon -- NotifyDescriptor.WARNING_MESSAGE
      • error icon -- NotifyDescriptor.ERROR_MESSAGE
      • question icon -- NotifyDescriptor.QUESTION_MESSAGE
      • plain icon -- NotifyDescriptor.PLAIN_MESSAGE
    • optionTypes:
      • display defaults -- NotifyDescriptor.DEFAULT_OPTION
      • display yes/no buttons -- NotifyDescriptor.YES_NO_OPTION
      • display yes/no/cancel buttons -- NotifyDescriptor.YES_NO_CANCEL_OPTION
      • display ok/cancel buttons -- NotifyDescriptor.OK_CANCEL_OPTION
Methods of this class:
String getInputText() -- get the text which the user typed into the input line
void setInputText(String text) -- set the text on the input line (allows you predefine text)

An important method inherited from NotifyDescriptor:
Object getValue() -- get the value the user has selected. Allows you determine which button was pressed.

Example:

NotifyDescriptor.InputLine il = new NotifyDescriptor.InputLine(
    "Find:",
    "Inane title",
    NotifyDescriptor.INFORMATION_MESSAGE,
    NotifyDescriptor.OK_CANCEL_OPTION));

TopManager.getDefault ().notify (il);
if(il.getValue()==NotifyDescriptor.CANCEL_OPTION){

    //if Cancel was pressed do...

}
else{

    //else do...

}

         
Example of the first constructor:
TopManager.getDefault ().notify (new  NotifyDescriptor.InputLine("Find:", 
"Inane title"));

Examples of the second constructor (some combinations are strange):
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.INFORMATION_MESSAGE, NotifyDescriptor.DEFAULT_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.INFORMATION_MESSAGE, NotifyDescriptor.YES_NO_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.INFORMATION_MESSAGE, NotifyDescriptor.YES_NO_CANCEL_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.INFORMATION_MESSAGE, NotifyDescriptor.OK_CANCEL_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.WARNING_MESSAGE, 
NotifyDescriptor.DEFAULT_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.WARNING_MESSAGE, 
NotifyDescriptor.YES_NO_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.WARNING_MESSAGE, NotifyDescriptor.YES_NO_CANCEL_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.WARNING_MESSAGE, 
NotifyDescriptor.OK_CANCEL_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.ERROR_MESSAGE, 
NotifyDescriptor.DEFAULT_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.ERROR_MESSAGE, 
NotifyDescriptor.YES_NO_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.ERROR_MESSAGE, NotifyDescriptor.YES_NO_CANCEL_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.ERROR_MESSAGE, 
NotifyDescriptor.OK_CANCEL_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.QUESTION_MESSAGE, 
NotifyDescriptor.DEFAULT_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.QUESTION_MESSAGE, 
NotifyDescriptor.YES_NO_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.QUESTION_MESSAGE, NotifyDescriptor.YES_NO_CANCEL_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.QUESTION_MESSAGE, NotifyDescriptor.OK_CANCEL_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.PLAIN_MESSAGE,
NotifyDescriptor.DEFAULT_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.PLAIN_MESSAGE, 
NotifyDescriptor.YES_NO_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.PLAIN_MESSAGE, NotifyDescriptor.YES_NO_CANCEL_OPTION));
TopManager.getDefault ().notify (new NotifyDescriptor.InputLine("Find:", 
"Inane title",
NotifyDescriptor.PLAIN_MESSAGE, 
NotifyDescriptor.OK_CANCEL_OPTION));

Companion
Projects:
MySQL Database Server   GlassFish Community: an Open Source Application Server   Open Solaris  Open JDK: an Open SourceJDK   Mobile & Embedded Community     Sponsored by 
Sponsored by Sun Microsystems