Klasse PromptData

java.lang.Object
com.inet.viewer.PromptData
Alle implementierten Schnittstellen:
Serializable

@JsonData public class PromptData extends Object implements Serializable
This class is the holder of the information needed for a prompt. Objects of this class represent a prompt with its name, its description, its default value(s), and other various settings (can be edited, can have multiple values, etc).
After the prompts are requested from the user, the prompt values set by the user are also stored here. A typical use of this object would be:

...
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 TypeJava Type
Number/Currency Double
Boolean Boolean
Date/DateTime java.util.Date
Time Time
String String
Binary byte[]
Range Range
Multiple Vector
Seit:
7.0
Siehe auch:
  • Feldübersicht

    Felder
    Modifikator und Typ
    Feld
    Beschreibung
    static final int
    Data type bit mask - Array
    static final int
    Data type constant - binary
    static final int
    Data type constant - boolean
    static final int
    Data type constant - number
    static final int
    Data type constant - date
    static final int
    Data type constant - datetime
    static final int
    Data type constant - number
    static final int
    Data type bit mask - Range
    static final int
    Data type constant - string
    static final int
    Data type constant - time
    static final int
    Data type constant - unknown
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    PromptData(boolean skipThis)
    Creates a PromptData object which is to be ignored - this is useful for prompts which are not used in the report.
    Clones a PromptData object and initializes a new one with all values equal to that of the old PromptData object.
    PromptData(String name, String subreportName, String description, String[] defaultValues, String[] defaultDescs, int type, boolean discrete, boolean range, boolean multi, boolean changeable, boolean descOnly, boolean informixSP, String editMask, String minValue, String maxValue)
    Creates a PromptData object with the parameters chosen.
    PromptData(String name, String displayName, String subreportName, String description, String[] defaultValues, String[] defaultDescs, int type, boolean discrete, boolean range, boolean multi, boolean changeable, boolean descOnly, boolean informixSP, String editMask, String minValue, String maxValue)
    Creates a PromptData object with the parameters chosen.
  • Methodenübersicht

    Modifikator und Typ
    Methode
    Beschreibung
    boolean
    Checks equality with another object - a PromptData object is equal to another if all settings are the same in both objects.
    Returns the parent to this prompt if this is a cascading prompt.
    Returns the set value of this prompt.
    Returns the default values of this prompt.
    Note that Date are given as Calendar object, and DateTime as Timestamp.
    Returns the description of this prompt.
    Returns name to use for displaying the prompt name
    Returns the icon of this PromptData.
    Returns the name of this prompt.
    int
    Returns the type of this prompt (without any included bit flags) - that is, NUMBER, CURRENCY, BOOLEAN, DATE, TIME, DATETIME, STRING, or BINARY
    int
    boolean
    Returns whether or not this prompt allows discrete values.
    boolean
    Returns whether or not this prompt allows multiple values
    boolean
    Returns whether or not this prompt allows range values.
    void
    setCascadingParent(String cascadingParent)
    If not null, causes this prompt to be viewed as a cascading prompt and sets its parent.
    void
    Sets the value(s) actually chosen for this prompt.
    void
    setDisplayName(String displayName)
    Sets the name to be used in the display of the prompt name.
    Simply returns the display name of this prompt.

    Von Klasse geerbte Methoden Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Felddetails

    • UNKNOWN

      public static final int UNKNOWN
      Data type constant - unknown
      Seit:
      7.0
      Siehe auch:
    • NUMBER

      public static final int NUMBER
      Data type constant - number
      Seit:
      7.0
      Siehe auch:
    • CURRENCY

      public static final int CURRENCY
      Data type constant - number
      Seit:
      7.0
      Siehe auch:
    • BOOLEAN

      public static final int BOOLEAN
      Data type constant - boolean
      Seit:
      7.0
      Siehe auch:
    • DATE

      public static final int DATE
      Data type constant - date
      Seit:
      7.0
      Siehe auch:
    • TIME

      public static final int TIME
      Data type constant - time
      Seit:
      7.0
      Siehe auch:
    • STRING

      public static final int STRING
      Data type constant - string
      Seit:
      7.0
      Siehe auch:
    • DATETIME

      public static final int DATETIME
      Data type constant - datetime
      Seit:
      7.0
      Siehe auch:
    • BINARY

      public static final int BINARY
      Data type constant - binary
      Seit:
      7.0
      Siehe auch:
    • RANGE

      public static final int RANGE
      Data type bit mask - Range
      Seit:
      7.0
      Siehe auch:
    • ARRAY

      public static final int ARRAY
      Data type bit mask - Array
      Seit:
      7.0
      Siehe auch:
  • Konstruktordetails

    • PromptData

      public PromptData(boolean skipThis)
      Creates a PromptData object which is to be ignored - this is useful for prompts which are not used in the report.
      Parameter:
      skipThis - boolean value whether prompt data object must be ignored
      Seit:
      7.0
    • PromptData

      public PromptData(String name, String subreportName, String description, String[] defaultValues, String[] defaultDescs, int type, boolean discrete, boolean range, boolean multi, boolean changeable, boolean descOnly, boolean informixSP, String editMask, String minValue, String maxValue)
      Creates a PromptData object with the parameters chosen.
      Parameter:
      name - Name of the prompt to use as the property name of the prompt
      subreportName - Name of the sub report this prompt belongs to (or "" if it is from the main report)
      description - Description of the prompt
      defaultValues - 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)
      descOnly - Are only the descriptions of the default values to be shown?
      informixSP - Is this an Informix Stored Procedure prompt? (default should be false)
      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).
      Seit:
      7.0
    • PromptData

      public PromptData(String name, String displayName, String subreportName, String description, String[] defaultValues, String[] defaultDescs, int type, boolean discrete, boolean range, boolean multi, boolean changeable, boolean descOnly, boolean informixSP, String editMask, String minValue, String maxValue)
      Creates a PromptData object with the parameters chosen.
      Parameter:
      name - Name of the prompt to use as the property name of the prompt
      displayName - 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 prompt
      defaultValues - 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)
      descOnly - Are only the descriptions of the default values to be shown?
      informixSP - Is this an Informix Stored Procedure prompt? (default should be false)
      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).
      Seit:
      7.0
    • PromptData

      public PromptData(PromptData data)
      Clones a PromptData object and initializes a new one with all values equal to that of the old PromptData object.
      Parameter:
      data - Prompt to "clone"
      Seit:
      7.0
  • Methodendetails

    • getDescription

      public String getDescription()
      Returns the description of this prompt. May be null if no description is set.
      Gibt zurück:
      The description of this prompt. May be null if no description is set.
      Seit:
      7.0
    • isRange

      public boolean isRange()
      Returns whether or not this prompt allows range values.
      Gibt zurück:
      Does this prompt allow range values?
      Seit:
      7.0
    • isDiscrete

      public boolean isDiscrete()
      Returns whether or not this prompt allows discrete values.
      Gibt zurück:
      Does this prompt allow discrete values?
      Seit:
      7.0
    • isMultipleAllowed

      public boolean isMultipleAllowed()
      Returns whether or not this prompt allows multiple values
      Gibt zurück:
      Does this prompt allow multiple values?
      Seit:
      7.0
    • getName

      public String getName()
      Returns the name of this prompt. Note that this name is unique for the report. This name can be null for hidden prompts.
      Gibt zurück:
      The name of this prompt. Note that this name is unique for the report. This name can be null for hidden prompts.
      Seit:
      7.0
    • getType

      public int getType()
      Returns the type of this prompt (without any included bit flags) - that is, NUMBER, CURRENCY, BOOLEAN, DATE, TIME, DATETIME, STRING, or BINARY
      Gibt zurück:
      The type of this prompt.
      Seit:
      7.0
    • setChosenValues

      public void setChosenValues(Object values)
      Sets the value(s) actually chosen for this prompt. If more than one value was chosen, use a vector. If values are ranges, use a Range. For the values themselves, use:
      • String for STRING
      • Double for NUMBER and CURRENCY
      • Boolean for BOOLEAN
      • Date for DATE and DATETIME
      • Time for TIME
      • byte[] for BINARY
      Parameter:
      values - Value(s) to be set as chosen - should be a vector if more than one.
      Seit:
      7.0
    • toString

      public String toString()
      Simply returns the display name of this prompt.
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      String Display name of this prompt
      Seit:
      7.0
      Siehe auch:
    • getIcon

      public Icon getIcon()
      Returns the icon of this PromptData.
      Gibt zurück:
      Returns the icon of this PromptData.
    • getChosenValue

      public Object getChosenValue()
      Returns the set value of this prompt. Depending on the value type, this object can be one of various things:

      • If a multiple prompt, this is a vector containing one or more single values.
      • If one of the values is a range, it is a RangePromptValue.

        The single values are:

        • String for STRING
        • Double for NUMBER and CURRENCY
        • Boolean for BOOLEAN
        • Date for DATE and DATETIME
        • Time for TIME
        • byte[] for BINARY
      Gibt zurück:
      The set value of this prompt.
      Seit:
      7.0
    • getDefaultValues

      public Vector getDefaultValues()
      Returns the default values of this prompt.
      Note that Date are given as Calendar object, and DateTime as Timestamp.
      Gibt zurück:
      Default values of this prompt.
      Seit:
      7.0
    • equals

      public boolean equals(Object obj)
      Checks equality with another object - a PromptData object is equal to another if all settings are the same in both objects.
      Setzt außer Kraft:
      equals in Klasse Object
      Parameter:
      obj - Object
      Gibt zurück:
      boolean
      Seit:
      7.0
      Siehe auch:
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • getCascadingParent

      public String getCascadingParent()
      Returns the parent to this prompt if this is a cascading prompt. If not, this returns null.
      Gibt zurück:
      parent to this prompt, or null if there is none
    • setCascadingParent

      public void setCascadingParent(String cascadingParent)
      If not null, causes this prompt to be viewed as a cascading prompt and sets its parent. Otherwise, deactivates cascading for this prompt.
      Parameter:
      cascadingParent - parent to this prompt, or null if there is none
    • setDisplayName

      public void setDisplayName(String displayName)
      Sets the name to be used in the display of the prompt name.
      Parameter:
      displayName - name to use for prompt name display
      Seit:
      7.8
    • getDisplayName

      public String getDisplayName()
      Returns name to use for displaying the prompt name
      Gibt zurück:
      display name of the prompt
      Seit:
      7.8