public class DontAskAgainDialogs
extends java.lang.Object
IDialogSettings
of your language UIPlugin.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DONT_ASK_AGAIN_DIALOG_PREFIX
A section id that holds the "don't ask me again" dialog settings.
|
Constructor and Description |
---|
DontAskAgainDialogs() |
Modifier and Type | Method and Description |
---|---|
int |
askUser(java.lang.String question,
java.lang.String dialogTitle,
java.lang.String storeKey,
org.eclipse.swt.widgets.Shell shell)
Opens a
MessageDialogWithToggle and stores the answer, if use activate the corresponding checkbox. |
void |
forgetAllUserDecisions()
Rewrites the
DONT_ASK_AGAIN_DIALOG_PREFIX section in IDialogSettings for the current language. |
java.lang.String |
getUserDecision(java.lang.String key)
Returns the stored user answer to the question identified with the passed key.
|
public static final java.lang.String DONT_ASK_AGAIN_DIALOG_PREFIX
Value is of type String
and is one of
MessageDialogWithToggle.ALWAYS
,
MessageDialogWithToggle.NEVER
or (default)
MessageDialogWithToggle.PROMPT
.
public java.lang.String getUserDecision(java.lang.String key)
key
- unique identifier . Represents the key to use when storing or reading the setting.String
and is one of
MessageDialogWithToggle.ALWAYS
,
MessageDialogWithToggle.NEVER
or (default)
MessageDialogWithToggle.PROMPT
. Never null
public int askUser(java.lang.String question, java.lang.String dialogTitle, java.lang.String storeKey, org.eclipse.swt.widgets.Shell shell)
MessageDialogWithToggle
and stores the answer, if use activate the corresponding checkbox.question
- The question to ask.dialogTitle
- TitlestoreKey
- the key used to store the decision in IDialogSettings
, also used to read them
getUserDecision(String)
shell
- the parent Shell
of the dialogIDialogConstants.YES_ID
, IDialogConstants.NO_ID
or
IDialogConstants.CANCEL_ID
public void forgetAllUserDecisions()
DONT_ASK_AGAIN_DIALOG_PREFIX
section in IDialogSettings
for the current language.