Class UserQuestionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.openide.util.UserQuestionException
- All Implemented Interfaces:
Serializable
Exception that is thrown when the process is about to perform some
action that requires user confirmation. It can be useful when there
is a call to a method which cannot open a dialog, but still would like
to ask the user a question. It can raise this exception and higher level
parts of the system can/should catch it and present a dialog to the user
and if the user agrees reinvoke the action again.
The getLocalizedMessage method should return the user question,
which will be shown to the user in a dialog with OK, Cancel options and
if the user chooses OK, method ex.confirmed () will be called.
Since version 8.29 one can just catch the exception and report it to the
infrastructure of any NetBeans Platform based application (for example
via Exceptions.printStackTrace(java.lang.Throwable)) and the
question dialog will be displayed automatically.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates new exception UserQuestionExceptionCreates new exception UserQuestionException with text specified string s. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidInvoke the action if the user confirms the action.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UserQuestionException
public UserQuestionException()Creates new exception UserQuestionException -
UserQuestionException
Creates new exception UserQuestionException with text specified string s.- Parameters:
s- the text describing the exception
-
-
Method Details
-
confirmed
Invoke the action if the user confirms the action.- Throws:
IOException- if another I/O problem exists
-