@JsonData
public class PromptData
extends java.lang.Object
implements java.io.Serializable
...
PromptData[] myPrompts = new PromptData[3];
for (int i=0; i<3; i++) {
myPrompts[i] = new PromptData(name[i], description[i], defaultValues[i], defaultDescs[i],
type[i], discrete[i], range[i], multi[i], changeable[i], descOnly[i], editMask[i],
minLength[i], maxLength[i]);
}
MyPromptDialog.execute(myPrompts); //show the prompts, request values from user, etc.
Object[] obj = new Object[3];
for (int i=0; i<3; i++) {
obj[i] = myPrompts[i].getChosenValue();
}
sendPromptsToServer(obj);
...
As can be seen - first the PromptData objects are initialized, then used to request
data from the user (its settings can be retrieved with methods such as getName(), getDescription(), getType(), etc.
The chosen values are of the following type, depending on the type of the prompt:
Prompt Type | Java Type |
Number/Currency | Double |
Boolean | Boolean |
Date/DateTime | java.util.Date |
Time | Time |
String | String |
Binary | byte[] |
Range | Range |
Multiple | Vector |
Modifier and Type | Field and Description |
---|---|
static int |
ARRAY
Data type bit mask - Array
|
static int |
BINARY
Data type constant - binary
|
static int |
BOOLEAN
Data type constant - boolean
|
static int |
CURRENCY
Data type constant - number
|
static int |
DATE
Data type constant - date
|
static int |
DATETIME
Data type constant - datetime
|
static int |
NUMBER
Data type constant - number
|
static int |
RANGE
Data type bit mask - Range
|
static int |
STRING
Data type constant - string
|
static int |
TIME
Data type constant - time
|
static int |
UNKNOWN
Data type constant - unknown
|
Constructor and Description |
---|
PromptData(boolean skipThis)
Creates a
PromptData object which is to be ignored - this is useful for prompts which
are not used in the report. |
PromptData(java.lang.String name,
java.lang.String subreportName,
java.lang.String description,
java.lang.String[] defaultValues,
java.lang.String[] defaultDescs,
int type,
boolean discrete,
boolean range,
boolean multi,
boolean changeable,
boolean descOnly,
boolean informixSP,
java.lang.String editMask,
java.lang.String minValue,
java.lang.String maxValue)
Creates a
PromptData object with the parameters chosen. |
PromptData(java.lang.String name,
java.lang.String displayName,
java.lang.String subreportName,
java.lang.String description,
java.lang.String[] defaultValues,
java.lang.String[] defaultDescs,
int type,
boolean discrete,
boolean range,
boolean multi,
boolean changeable,
boolean descOnly,
boolean informixSP,
java.lang.String editMask,
java.lang.String minValue,
java.lang.String maxValue)
Creates a
PromptData object with the parameters chosen. |
PromptData(PromptData data)
Clones a
PromptData object and initializes a new one with all values equal to that of the old PromptData object. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Checks equality with another object - a
PromptData object is equal to another
if all settings are the same in both objects. |
java.lang.String |
getCascadingParent()
Returns the parent to this prompt if this is a cascading prompt.
|
java.lang.Object |
getChosenValue()
Returns the set value of this prompt.
|
java.util.Vector |
getDefaultValues()
Returns the default values of this prompt.
|
java.lang.String |
getDescription()
Returns the description of this prompt.
|
java.lang.String |
getDisplayName()
Returns name to use for displaying the prompt name
|
javax.swing.Icon |
getIcon()
Returns the icon of this
PromptData . |
java.lang.String |
getName()
Returns the name of this prompt.
|
int |
getType()
Returns the type of this prompt (without any included bit flags) - that is,
NUMBER, CURRENCY, BOOLEAN, DATE, TIME, DATETIME, STRING, or BINARY
|
boolean |
isDiscrete()
Returns whether or not this prompt allows discrete values.
|
boolean |
isMultipleAllowed()
Returns whether or not this prompt allows multiple values
|
boolean |
isRange()
Returns whether or not this prompt allows range values.
|
void |
setCascadingParent(java.lang.String cascadingParent)
If not null, causes this prompt to be viewed as a cascading prompt and sets its parent.
|
void |
setChosenValues(java.lang.Object values)
Sets the value(s) actually chosen for this prompt.
|
void |
setDisplayName(java.lang.String displayName)
Sets the name to be used in the display of the prompt name.
|
java.lang.String |
toString()
Simply returns the display name of this prompt.
|
public static final int UNKNOWN
public static final int NUMBER
public static final int CURRENCY
public static final int BOOLEAN
public static final int DATE
public static final int TIME
public static final int STRING
public static final int DATETIME
public static final int BINARY
public static final int RANGE
public static final int ARRAY
public PromptData(boolean skipThis)
PromptData
object which is to be ignored - this is useful for prompts which
are not used in the report.skipThis
- boolean value whether prompt data object must be ignoredpublic PromptData(java.lang.String name, java.lang.String subreportName, java.lang.String description, java.lang.String[] defaultValues, java.lang.String[] defaultDescs, int type, boolean discrete, boolean range, boolean multi, boolean changeable, boolean descOnly, boolean informixSP, java.lang.String editMask, java.lang.String minValue, java.lang.String maxValue)
PromptData
object with the parameters chosen.name
- Name of the prompt to use as the property name of the promptsubreportName
- Name of the sub report this prompt belongs to (or ""
if it is from the main report)description
- Description of the promptdefaultValues
- DefaultValues if any, that is, list of values to be able to
choose from. If not a multiple value prompt, the first value is taken
as the value set by default.defaultDescs
- Default value descriptions, if any - indexes must correspond
to the default value string array.type
- Type of the prompt, using the bit flags. For example, a currency range
array would have the type ARRAY|RANGE|CURRENCY.discrete
- Can discrete values be chosen for this prompt?range
- Can range values be chosen for this prompt?multi
- Can multiple values be chosen for this prompt?changeable
- Is it possible enter own values (if not - only default values)informixSP
- Is this an Informix Stored Procedure prompt? (default should be false)descOnly
- Are only the descriptions of the default values to be shown?editMask
- Edit mask - as of yet unimplemented.minValue
- Minimum value, or length of value allowed to be entered (if String).maxValue
- Maximum value, or length of value allowed to be entered (if String).public PromptData(java.lang.String name, java.lang.String displayName, java.lang.String subreportName, java.lang.String description, java.lang.String[] defaultValues, java.lang.String[] defaultDescs, int type, boolean discrete, boolean range, boolean multi, boolean changeable, boolean descOnly, boolean informixSP, java.lang.String editMask, java.lang.String minValue, java.lang.String maxValue)
PromptData
object with the parameters chosen.name
- Name of the prompt to use as the property name of the promptdisplayName
- Display name of the prompt to use for display only.subreportName
- Name of the sub report this prompt belongs to (or ""
if it is from the main report)description
- Description of the promptdefaultValues
- DefaultValues if any, that is, list of values to be able to
choose from. If not a multiple value prompt, the first value is taken
as the value set by default.defaultDescs
- Default value descriptions, if any - indexes must correspond
to the default value string array.type
- Type of the prompt, using the bit flags. For example, a currency range
array would have the type ARRAY|RANGE|CURRENCY.discrete
- Can discrete values be chosen for this prompt?range
- Can range values be chosen for this prompt?multi
- Can multiple values be chosen for this prompt?changeable
- Is it possible enter own values (if not - only default values)informixSP
- Is this an Informix Stored Procedure prompt? (default should be false)descOnly
- Are only the descriptions of the default values to be shown?editMask
- Edit mask - as of yet unimplemented.minValue
- Minimum value, or length of value allowed to be entered (if String).maxValue
- Maximum value, or length of value allowed to be entered (if String).public PromptData(PromptData data)
PromptData
object and initializes a new one with all values equal to that of the old PromptData
object.data
- Prompt to "clone"public java.lang.String getDescription()
null
if no description is set.null
if no description is set.public boolean isRange()
public boolean isDiscrete()
public boolean isMultipleAllowed()
public java.lang.String getName()
public int getType()
public void setChosenValues(java.lang.Object values)
Range
.
For the values themselves, use:
values
- Value(s) to be set as chosen - should be a vector if more than one.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public javax.swing.Icon getIcon()
PromptData
.PromptData
.public java.lang.Object getChosenValue()
The single values are:
public java.util.Vector getDefaultValues()
public boolean equals(java.lang.Object obj)
PromptData
object is equal to another
if all settings are the same in both objects.equals
in class java.lang.Object
obj
- ObjectObject.equals(java.lang.Object)
public java.lang.String getCascadingParent()
null
.public void setCascadingParent(java.lang.String cascadingParent)
cascadingParent
- parent to this prompt, or null if there is nonepublic void setDisplayName(java.lang.String displayName)
displayName
- name to use for prompt name displaypublic java.lang.String getDisplayName()
Copyright © 1999-2020 by i-net software GmbH