Package org.nuclos.api.context
Class InputSpecification
java.lang.Object
org.nuclos.api.context.InputSpecification
- All Implemented Interfaces:
Serializable
Specification of input dialog.
- Author:
- thomas.schiffmann
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Input type to show a ok dialog.static final int
Input type to show a ok/cancel dialog.static final int
Input type to show a yes/no dialog.static final int
Input type to show string memo input dialog (with text area and possibility to enter a line break)static final int
Input type to show a select option dialog.static final int
Input type to show string input dialog.static final int
Variable value for no.static final int
Variable value for ok.static final int
Variable value for yes. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
for deserialization onlyInputSpecification
(int type, String key, boolean translateAndRememberWithGeneratedLocalizationKey, String message, String title, Locale locale) Creates a new InputSpecification with the specified type, key, translation options, message, title, and locale.InputSpecification
(int type, String key, boolean translateAndRememberWithGeneratedLocalizationKey, String message, String title, NuclosLocale locale) Creates a new InputSpecification with the specified type, key, translation options, message, title, and Nuclos locale.InputSpecification
(int type, String key, String message) Creates a new InputSpecification with the specified type, key, and message.InputSpecification
(int type, String key, String message, String title) Creates a new InputSpecification with the specified type, key, message, and title.InputSpecification
(int type, String key, String localizationKey, String message, String title, Locale locale) Creates a new InputSpecification with the specified type, key, localization key, message, title, and locale.InputSpecification
(int type, String key, String localizationKey, String message, String title, NuclosLocale locale) Creates a new InputSpecification with the specified type, key, localization key, message, title, and Nuclos locale.InputSpecification
(int type, String key, String message, String title, Locale locale) Creates a new InputSpecification with the specified type, key, message, title, and locale.InputSpecification
(int type, String key, String message, String title, NuclosLocale locale) Creates a new InputSpecification with the specified type, key, message, title, and Nuclos locale.InputSpecification
(int type, String key, DoNotTranslate message) Creates a new InputSpecification with the specified type, key, and a message that is not translated.InputSpecification
(int type, String key, DoNotTranslate message, DoNotTranslate title) Creates a new InputSpecification with the specified type, key, and a message with title that is not translated. -
Method Summary
Modifier and TypeMethodDescriptionboolean
internal use onlyGet default option (of available options, only applicable for INPUT_OPTION)getKey()
Get the variable key/name.Get the dialog message.Object[]
Get available input options, only applicable for INPUT_OPTION.getTitle()
Get the dialog title.int
getType()
Get input type.void
setApplyForAllMultiEditObjects
(boolean applyForAllMultiEditObjects) void
setDefaultOption
(Object defaultOption) Set default option (of available options, only applicable for INPUT_OPTION)void
setOptions
(Object[] options) Set available input options, only applicable for INPUT_OPTION.withMessageArgs
(Object... messageArgs) Sets argument values to be used for formatting the message string.withTitleArgs
(Object... titleArgs) Sets argument values to be used for formatting the title string.
-
Field Details
-
CONFIRM_YES_NO
public static final int CONFIRM_YES_NOInput type to show a yes/no dialog.- See Also:
-
CONFIRM_OK_CANCEL
public static final int CONFIRM_OK_CANCELInput type to show a ok/cancel dialog. If the user choosed cancel, the request won't execute again.- See Also:
-
CONFIRM_OK
public static final int CONFIRM_OKInput type to show a ok dialog.- See Also:
-
OK
public static final int OKVariable value for ok.- See Also:
-
YES
public static final int YESVariable value for yes.- See Also:
-
NO
public static final int NOVariable value for no.- See Also:
-
INPUT_VALUE
public static final int INPUT_VALUEInput type to show string input dialog.- See Also:
-
INPUT_MEMO
public static final int INPUT_MEMOInput type to show string memo input dialog (with text area and possibility to enter a line break)- See Also:
-
INPUT_OPTION
public static final int INPUT_OPTIONInput type to show a select option dialog.- See Also:
-
-
Constructor Details
-
InputSpecification
protected InputSpecification()for deserialization only -
InputSpecification
Creates a new InputSpecification with the specified type, key, and message.- Parameters:
type
- Input type (CONFIRM_YES_NO, CONFIRM_OK_CANCEL, INPUT_VALUE or INPUT_OPTION)key
- Variable key (to obtain the value)message
- Dialog message
-
InputSpecification
Creates a new InputSpecification with the specified type, key, and a message that is not translated.- Parameters:
type
- Input type (CONFIRM_YES_NO, CONFIRM_OK_CANCEL, INPUT_VALUE or INPUT_OPTION)key
- Variable key (to obtain the value)message
- Dialog message that should not be translated
-
InputSpecification
Creates a new InputSpecification with the specified type, key, message, and title.- Parameters:
type
- Input type (CONFIRM_YES_NO, CONFIRM_OK_CANCEL, INPUT_VALUE or INPUT_OPTION)key
- Variable key (to obtain the value)message
- Dialog messagetitle
- Dialog title
-
InputSpecification
Creates a new InputSpecification with the specified type, key, and a message with title that is not translated.- Parameters:
type
- Input type (CONFIRM_YES_NO, CONFIRM_OK_CANCEL, INPUT_VALUE or INPUT_OPTION)key
- Variable key (to obtain the value)message
- Dialog message that should not be translatedtitle
- Dialog title that should not be translated
-
InputSpecification
Creates a new InputSpecification with the specified type, key, message, title, and locale.- Parameters:
type
- Input type (CONFIRM_YES_NO, CONFIRM_OK_CANCEL, INPUT_VALUE or INPUT_OPTION)key
- Variable key (to obtain the value)message
- Dialog messagetitle
- Dialog titlelocale
- The locale of the text
-
InputSpecification
Creates a new InputSpecification with the specified type, key, message, title, and Nuclos locale.- Parameters:
type
- Input type (CONFIRM_YES_NO, CONFIRM_OK_CANCEL, INPUT_VALUE or INPUT_OPTION)key
- Variable key (to obtain the value)message
- Dialog messagetitle
- Dialog titlelocale
- The NuclosLocale of the text
-
InputSpecification
public InputSpecification(int type, String key, boolean translateAndRememberWithGeneratedLocalizationKey, String message, String title, Locale locale) Creates a new InputSpecification with the specified type, key, translation options, message, title, and locale.- Parameters:
type
- Input type (CONFIRM_YES_NO, CONFIRM_OK_CANCEL, INPUT_VALUE or INPUT_OPTION)key
- Variable key (to obtain the value)translateAndRememberWithGeneratedLocalizationKey
- If true, translate and remember with a generated localization keymessage
- Dialog messagetitle
- Dialog titlelocale
- The locale of the text
-
InputSpecification
public InputSpecification(int type, String key, boolean translateAndRememberWithGeneratedLocalizationKey, String message, String title, NuclosLocale locale) Creates a new InputSpecification with the specified type, key, translation options, message, title, and Nuclos locale.- Parameters:
type
- Input type (CONFIRM_YES_NO, CONFIRM_OK_CANCEL, INPUT_VALUE or INPUT_OPTION)key
- Variable key (to obtain the value)translateAndRememberWithGeneratedLocalizationKey
- If true, translate and remember with a generated keymessage
- Dialog messagetitle
- Dialog titlelocale
- The NuclosLocale of the text
-
InputSpecification
public InputSpecification(int type, String key, String localizationKey, String message, String title, Locale locale) Creates a new InputSpecification with the specified type, key, localization key, message, title, and locale.- Parameters:
type
- Input type (CONFIRM_YES_NO, CONFIRM_OK_CANCEL, INPUT_VALUE or INPUT_OPTION)key
- Variable key (to obtain the value)localizationKey
- Key used for localizationmessage
- Dialog messagetitle
- Dialog titlelocale
- The locale of the text
-
InputSpecification
public InputSpecification(int type, String key, String localizationKey, String message, String title, NuclosLocale locale) Creates a new InputSpecification with the specified type, key, localization key, message, title, and Nuclos locale.- Parameters:
type
- Input type (CONFIRM_YES_NO, CONFIRM_OK_CANCEL, INPUT_VALUE or INPUT_OPTION)key
- Variable key (to obtain the value)localizationKey
- Key used for localizationmessage
- Dialog messagetitle
- Dialog titlelocale
- The NuclosLocale of the text
-
-
Method Details
-
withMessageArgs
Sets argument values to be used for formatting the message string. These values will replace placeholders in the message string.- Parameters:
messageArgs
- The arguments to be used for message formatting- Returns:
- This InputSpecification instance for method chaining
-
withTitleArgs
Sets argument values to be used for formatting the title string. These values will replace placeholders in the title string.- Parameters:
titleArgs
- The arguments to be used for title formatting- Returns:
- This InputSpecification instance for method chaining
-
getType
public int getType()Get input type.- Returns:
- Input type
-
getKey
Get the variable key/name.- Returns:
- Variable key/name
-
getMessage
Get the dialog message.- Returns:
- Dialog message
-
getTitle
Get the dialog title.- Returns:
- Dialog title
-
getOptions
Get available input options, only applicable for INPUT_OPTION.- Returns:
- Input options
-
setOptions
Set available input options, only applicable for INPUT_OPTION.- Parameters:
options
- Available input options
-
getDefaultOption
Get default option (of available options, only applicable for INPUT_OPTION)- Returns:
- Default option.
-
setDefaultOption
Set default option (of available options, only applicable for INPUT_OPTION)- Parameters:
defaultOption
- Default option
-
applyForAllMultiEditObjects
public boolean applyForAllMultiEditObjects()internal use only- Returns:
- applyForAllMultiEditObjects
-
setApplyForAllMultiEditObjects
public void setApplyForAllMultiEditObjects(boolean applyForAllMultiEditObjects) - Parameters:
applyForAllMultiEditObjects
- false (default): One input question for every object during a multi edit. true: The client is instructed to ask for the input only once. You have to choose a general key for your input to work as expected, no object specific data within the key.
-