|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.izforge.izpack.installer.IzPanel
com.izforge.izpack.panels.ValidatePackSelections
Nested Class Summary | |
protected class |
ValidatePackSelections.SearchField
This class encapsulates a lot of search field functionality. |
protected static class |
ValidatePackSelections.TextValuePair
This class can be used to associate a text string and a (text) value. |
Nested classes inherited from class com.izforge.izpack.installer.IzPanel |
com.izforge.izpack.installer.IzPanel.Filler |
Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
protected static String |
ALIGNMENT
|
protected static String |
AUTO_INSTALL
|
protected static String |
BOLD
|
protected Vector |
buttonGroups
Holds the references to all radio button groups |
protected static String |
CENTER
|
protected static String |
CHECK_FIELD
|
protected static String |
CLASS
|
protected static String |
COMBO_CHOICE
|
protected static String |
COMBO_FIELD
|
protected static String |
COMBO_VALUE
|
protected static String |
DEPENDS
|
protected static String |
DESCRIPTION
|
protected static String |
DIVIDER_FIELD
|
protected static String |
EXCLUSIVE
|
protected static boolean |
fAdvancedMode
|
protected static String |
FALSE
|
protected static String |
FAMILY
|
protected static boolean |
fHasSetAdvancedMode
Constructs a UserInputPanel . |
protected static String |
FIELD_LABEL
|
protected static String |
FIELD_NODE_ID
|
protected boolean |
fInitComplete
|
protected static boolean |
fStaticInitComplete
|
protected GeronimoConfigProcessor |
gcp
|
protected boolean |
haveSpec
|
protected static String |
INSTANCE_IDENTIFIER
|
protected static int |
instanceCount
|
protected int |
instanceNumber
|
protected static String |
ITALICS
|
protected static String |
KEY
|
protected static String |
LANG_FILE_NAME
|
protected com.izforge.izpack.LocaleDatabase |
langpack
|
protected com.izforge.izpack.gui.TwoColumnLayout |
layout
Holds all user inputs for use in automated installation |
protected static String |
LEFT
|
protected static String |
NAME
|
protected static String |
NODE_ID
how the spec node for a specific panel is identified |
protected static String |
OS
|
protected static String |
PACKS_PANEL
|
protected boolean |
packsDefined
If there is a possibility that some UI elements will not get added we can not allow to go back to the PacksPanel, because the process of building the UI is not reversable. |
protected static String |
PANEL_PKG
|
protected com.izforge.izpack.installer.InstallerFrame |
parentFrame
|
protected Vector |
passwordGroups
Holds the references to all password field groups |
protected Vector |
passwordGroupsRead
used for temporary storage of references to password groups that have already been read in a given read cycle. |
protected static int |
POS_CONSTRAINTS
|
protected static int |
POS_DISPLAYED
|
protected static int |
POS_FALSE
|
protected static int |
POS_FIELD
|
protected static int |
POS_GROUP
|
protected static int |
POS_MESSAGE
|
protected static int |
POS_OS
|
protected static int |
POS_PACKS
|
protected static int |
POS_SUPPRESS
|
protected static int |
POS_TRUE
|
protected static int |
POS_TYPE
|
protected static int |
POS_VARIABLE
|
protected static String |
PROCESSOR
|
protected static String |
PWD_FIELD
|
protected static String |
PWD_INPUT
|
protected static String |
PWD_SIZE
|
protected static String |
RADIO_CHOICE
|
protected static String |
RADIO_FIELD
|
protected static String |
RADIO_VALUE
|
protected static String |
RIGHT
|
protected static String |
RULE_DISPLAY_FORMAT
|
protected static String |
RULE_ENCRYPTED
|
protected static String |
RULE_FIELD
|
protected static String |
RULE_LAYOUT
|
protected static String |
RULE_PARAM
|
protected static String |
RULE_PARAM_NAME
|
protected static String |
RULE_PARAM_VALUE
|
protected static String |
RULE_PLAIN_STRING
|
protected static String |
RULE_RESULT_FORMAT
|
protected static String |
RULE_SEPARATOR
|
protected static String |
RULE_SPECIAL_SEPARATOR
|
protected static String |
SEARCH_BUTTON_FIELD
|
protected static String |
SEARCH_CHECKFILENAME
|
protected static String |
SEARCH_CHOICE
|
protected static String |
SEARCH_DIRECTORY
|
protected static String |
SEARCH_FIELD
|
protected static String |
SEARCH_FILE
|
protected static String |
SEARCH_FILENAME
|
protected static String |
SEARCH_PARENTDIR
|
protected static String |
SEARCH_RESULT
|
protected static String |
SEARCH_TYPE
|
protected static String |
SEARCH_VALUE
|
protected Vector |
searchFields
Used to track search fields. |
protected static String |
SELECTED_PACKS
|
protected static String |
SELECTEDPACKS
|
protected static String |
SET
|
protected static String |
SIZE
|
protected static String |
SPACE_FIELD
|
protected net.n3.nanoxml.XMLElement |
spec
The parsed result from reading the XML specification from the file |
protected static String |
SPEC
|
protected static String |
SPEC_FILE_NAME
The name of the XML file that specifies the panel layout |
protected static String |
STATIC_TEXT
|
protected String |
sTitle
|
protected static String |
SUPPRESS
|
protected static String |
TEXT
|
protected static String |
TEXT_FIELD
|
protected static String |
TEXT_SIZE
|
protected static String |
TITLE_FIELD
|
protected static String |
TOP
|
protected static String |
TRUE
|
protected static String |
TYPE
|
protected Vector |
uiElements
Holds the references to all of the UI elements |
protected static String |
UNSELECTEDPACKS
|
protected static String |
VALIDATOR
|
protected static String |
VALUE
|
protected static String |
VARIABLE
|
protected static HashMap |
varMap
|
protected static String |
WHEN
|
Fields inherited from class com.izforge.izpack.installer.IzPanel |
COLS_1, d, D, defaultGridBagConstraints, gridBagLayoutStarted, gridxCounter, gridyCounter, headline, HEADLINE, headLineLabel, idata, initialFocus, izPanelLayout, myClassname, myFullClassname, myPrefix, parent, ROWS_1, X_ORIGIN, Y_ORIGIN |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface com.izforge.izpack.util.AbstractUIHandler |
ANSWER_CANCEL, ANSWER_NO, ANSWER_YES, CHOICES_YES_NO, CHOICES_YES_NO_CANCEL |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
ValidatePackSelections(com.izforge.izpack.installer.InstallerFrame parent,
com.izforge.izpack.installer.InstallData installData)
|
Method Summary | |
protected void |
addCheckBox(net.n3.nanoxml.XMLElement spec)
Adds a chackbox to the list of UI elements. |
protected void |
addComboBox(net.n3.nanoxml.XMLElement spec)
Adds a combo box to the list of UI elements. |
protected void |
addDescription(net.n3.nanoxml.XMLElement spec,
Vector forPacks,
Vector forOs,
Vector suppress)
Adds a description to the list of UI elements. |
protected void |
addDivider(net.n3.nanoxml.XMLElement spec)
Adds a dividing line to the list of UI elements act as separator. |
protected void |
addPasswordField(net.n3.nanoxml.XMLElement spec)
Adds one or more password fields to the list of UI elements. |
protected void |
addRadioButton(net.n3.nanoxml.XMLElement spec)
Adds a radio button set to the list of UI elements. |
protected void |
addRuleField(net.n3.nanoxml.XMLElement spec)
Adds a rule field to the list of UI elements. |
protected void |
addSearch(net.n3.nanoxml.XMLElement spec)
Adds a search field to the list of UI elements. |
protected void |
addSpace(net.n3.nanoxml.XMLElement spec)
Adds a dummy field to the list of UI elements to act as spacer. |
protected void |
addText(net.n3.nanoxml.XMLElement spec)
Adds text to the list of UI elements |
protected void |
addTextField(net.n3.nanoxml.XMLElement spec)
Adds a text field to the list of UI elements |
protected void |
addTitle(net.n3.nanoxml.XMLElement spec)
Adds the title to the panel. |
protected void |
buildUI()
Builds the UI and makes it ready for display |
protected int |
getAlignment(net.n3.nanoxml.XMLElement element)
Retreives the alignment setting for the XMLElement . |
protected boolean |
getBoolean(net.n3.nanoxml.XMLElement element,
String attribute,
boolean defaultValue)
Retrieves the value of a boolean attribute. |
protected Vector |
getFieldSuppressionList(net.n3.nanoxml.XMLElement spec)
|
protected float |
getFloat(net.n3.nanoxml.XMLElement element,
String attribute,
float defaultValue)
Retrieves the value of a floating point attribute. |
protected String |
getText(net.n3.nanoxml.XMLElement element)
Extracts the text from an XMLElement . |
protected String |
getTitle()
|
protected Vector |
getUiElements()
Returns the uiElements. |
protected boolean |
isFieldSuppressed(Vector suppressions)
|
boolean |
isValidated()
Indicates wether the panel has been validated or not. |
protected boolean |
itemRequiredFor(Vector packs)
Verifies if an item is required for any of the packs listed. |
boolean |
itemRequiredForOs(Vector os)
Verifies if an item is required for the operating system the installer executed. |
protected boolean |
itemRequiredForUnselected(Vector packs)
Verifies if an item is required for any of the packs listed. |
void |
makeXMLData(net.n3.nanoxml.XMLElement panelRoot)
Asks the panel to set its own XML data that can be brought back for an automated installation process. |
void |
panelActivate()
This method is called when the panel becomes active. |
void |
panelDeactivate()
|
protected boolean |
readCheckBox(Object[] field)
Reads the content of the checkbox field and substitutes the associated variable. |
protected boolean |
readComboBox(Object[] field)
Reads the content of the combobox field and substitutes the associated variable. |
protected boolean |
readInput()
Reads the input data from all UI elements and sets the associated variables. |
protected boolean |
readPasswordField(Object[] field)
Reads the content of the password field and substitutes the associated variable. |
protected boolean |
readRadioButton(Object[] field)
Reads the content of the radio button field and substitutes the associated variable. |
protected boolean |
readRuleField(Object[] field)
Reads the data from the rule input field and sets the associated variable. |
protected boolean |
readSearch(Object[] field)
Reads the content of the search field and substitutes the associated variable. |
protected void |
readSpec()
Reads the XML specification for the panel layout. |
protected boolean |
readTextField(Object[] field)
Reads data from the text field and sets the associated variable. |
protected void |
setTitle(String title)
|
Methods inherited from class com.izforge.izpack.installer.IzPanel |
askQuestion, askQuestion, buildHeadline, completeGridBagLayout, createLabel, createLabel, createMultiLineLabel, createMultiLineLabel, createMultiLineLabelLang, emitError, emitNotification, emitWarning, getClassName, getControlTextFont, getDefaultGridBagConstraints, getI18nStringForClass, getImageIcon, getInitialFocus, getInstallerFrame, getLAF, getNewGridBagConstraints, getNewGridBagConstraints, getNextXGridBagConstraints, getNextYGridBagConstraints, getNextYGridBagConstraints, getString, getSummaryBody, getSummaryCaption, init, resetGridCounter, setDefaultGridBagConstraints, setInitialFocus, setLayout, startGridBagLayout |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected String sTitle
protected GeronimoConfigProcessor gcp
protected static boolean fAdvancedMode
protected static final int POS_SUPPRESS
protected static final int POS_DISPLAYED
protected static final int POS_TYPE
protected static final int POS_VARIABLE
protected static final int POS_CONSTRAINTS
protected static final int POS_FIELD
protected static final int POS_PACKS
protected static final int POS_OS
protected static final int POS_TRUE
protected static final int POS_FALSE
protected static final int POS_MESSAGE
protected static final int POS_GROUP
protected static final String SPEC_FILE_NAME
protected static final String LANG_FILE_NAME
protected static final String NODE_ID
protected static final String FIELD_NODE_ID
protected static final String INSTANCE_IDENTIFIER
protected static final String TYPE
protected static final String DESCRIPTION
protected static final String VARIABLE
protected static final String TEXT
protected static final String KEY
protected static final String SPEC
protected static final String SET
protected static final String TRUE
protected static final String FALSE
protected static final String ALIGNMENT
protected static final String LEFT
protected static final String CENTER
protected static final String RIGHT
protected static final String TOP
protected static final String ITALICS
protected static final String BOLD
protected static final String SIZE
protected static final String VALIDATOR
protected static final String PROCESSOR
protected static final String CLASS
protected static final String FIELD_LABEL
protected static final String TITLE_FIELD
protected static final String TEXT_FIELD
protected static final String TEXT_SIZE
protected static final String STATIC_TEXT
protected static final String COMBO_FIELD
protected static final String COMBO_CHOICE
protected static final String COMBO_VALUE
protected static final String RADIO_FIELD
protected static final String RADIO_CHOICE
protected static final String RADIO_VALUE
protected static final String SPACE_FIELD
protected static final String DIVIDER_FIELD
protected static final String CHECK_FIELD
protected static final String RULE_FIELD
protected static final String RULE_LAYOUT
protected static final String RULE_SEPARATOR
protected static final String RULE_RESULT_FORMAT
protected static final String RULE_PLAIN_STRING
protected static final String RULE_DISPLAY_FORMAT
protected static final String RULE_SPECIAL_SEPARATOR
protected static final String RULE_ENCRYPTED
protected static final String RULE_PARAM_NAME
protected static final String RULE_PARAM_VALUE
protected static final String RULE_PARAM
protected static final String PWD_FIELD
protected static final String PWD_INPUT
protected static final String PWD_SIZE
protected static final String SEARCH_FIELD
protected static final String SEARCH_BUTTON_FIELD
protected static final String SEARCH_CHOICE
protected static final String SEARCH_FILENAME
protected static final String SEARCH_RESULT
protected static final String SEARCH_VALUE
protected static final String SEARCH_TYPE
protected static final String SEARCH_FILE
protected static final String SEARCH_DIRECTORY
protected static final String SEARCH_PARENTDIR
protected static final String SEARCH_CHECKFILENAME
protected static final String SELECTEDPACKS
protected static final String UNSELECTEDPACKS
protected static final String NAME
protected static final String OS
protected static final String FAMILY
protected static final String VALUE
protected static final String DEPENDS
protected static final String SUPPRESS
protected static final String WHEN
protected static final String EXCLUSIVE
protected static final String AUTO_INSTALL
protected static final String SELECTED_PACKS
protected static final String PANEL_PKG
protected static final String PACKS_PANEL
protected static HashMap varMap
protected static boolean fStaticInitComplete
protected static int instanceCount
protected int instanceNumber
protected boolean fInitComplete
protected boolean packsDefined
protected com.izforge.izpack.installer.InstallerFrame parentFrame
protected net.n3.nanoxml.XMLElement spec
protected boolean haveSpec
protected Vector uiElements
protected Vector buttonGroups
protected Vector passwordGroups
protected Vector passwordGroupsRead
protected Vector searchFields
protected com.izforge.izpack.gui.TwoColumnLayout layout
protected com.izforge.izpack.LocaleDatabase langpack
protected static boolean fHasSetAdvancedMode
UserInputPanel
.
Constructor Detail |
public ValidatePackSelections(com.izforge.izpack.installer.InstallerFrame parent, com.izforge.izpack.installer.InstallData installData)
Method Detail |
protected void setTitle(String title)
protected String getTitle()
public boolean isValidated()
public void panelActivate()
public void panelDeactivate()
public void makeXMLData(net.n3.nanoxml.XMLElement panelRoot)
panelRoot
- The XML root element of the panels blackbox tree.protected void buildUI()
protected boolean readInput()
true
if the operation is successdul, otherwise false
.protected void readSpec() throws Exception
Exception
- for any problems in reading the specificationprotected void addTitle(net.n3.nanoxml.XMLElement spec)
spec
- a XMLElement
containing the specification for the title.protected void addRuleField(net.n3.nanoxml.XMLElement spec)
spec
- a XMLElement
containing the specification for the rule field.protected boolean readRuleField(Object[] field)
field
- the object array that holds the details of the field.
true
if there was no problem reading the data or if there was an
irrecovarable problem. If there was a problem that can be corrected by the operator, an error
dialog is popped up and false
is returned.protected void addTextField(net.n3.nanoxml.XMLElement spec)
spec
- a XMLElement
containing the specification for the text field.protected boolean readTextField(Object[] field)
field
- the object array that holds the details of the field.
true
if there was no problem reading the data or if there was an
irrecovarable problem. If there was a problem that can be corrected by the operator, an error
dialog is popped up and false
is returned.protected void addComboBox(net.n3.nanoxml.XMLElement spec)
<field type="combo" variable="testVariable"> <description text="Description for the combo box" id="a key for translated text"/> <spec text="label" id="key for the label"/> <choice text="choice 1" id="" value="combo box 1"/> <choice text="choice 2" id="" value="combo box 2" set="true"/> <choice text="choice 3" id="" value="combo box 3"/> <choice text="choice 4" id="" value="combo box 4"/> </spec> </field>
spec
- a XMLElement
containing the specification for the combo box.protected boolean readComboBox(Object[] field)
field
- the object array that holds the details of the field.
true
if there was no problem reading the data or if there was an
irrecovarable problem. If there was a problem that can be corrected by the operator, an error
dialog is popped up and false
is returned.protected void addRadioButton(net.n3.nanoxml.XMLElement spec)
<field type="radio" variable="testVariable"> <description text="Description for the radio buttons" id="a key for translated text"/> <spec text="label" id="key for the label"/> <choice text="radio 1" id="" value=""/> <choice text="radio 2" id="" value="" set="true"/> <choice text="radio 3" id="" value=""/> <choice text="radio 4" id="" value=""/> <choice text="radio 5" id="" value=""/> </spec> </field>
spec
- a XMLElement
containing the specification for the radio button
set.protected boolean readRadioButton(Object[] field)
field
- the object array that holds the details of the field.
true
if there was no problem reading the data or if there was an
irrecovarable problem. If there was a problem that can be corrected by the operator, an error
dialog is popped up and false
is returned.protected void addPasswordField(net.n3.nanoxml.XMLElement spec)
<field type="password" variable="testVariable"> <description align="left" txt="Please enter your password" id="a key for translated text"/> <spec> <pwd txt="Password" id="key for the label" size="10" set=""/> <pwd txt="Retype password" id="another key for the label" size="10" set=""/> </spec> <validator class="com.izforge.sample.PWDValidator" txt="Both versions of the password must match" id="key for the error text"/> <processor class="com.izforge.sample.PWDEncryptor"/> </field>
spec
- a XMLElement
containing the specification for the set of password
fields.protected boolean readPasswordField(Object[] field)
field
- a password group that manages one or more passord fields.
true
if there was no problem reading the data or if there was an
irrecovarable problem. If there was a problem that can be corrected by the operator, an error
dialog is popped up and false
is returned.protected boolean isFieldSuppressed(Vector suppressions)
protected Vector getFieldSuppressionList(net.n3.nanoxml.XMLElement spec)
protected void addCheckBox(net.n3.nanoxml.XMLElement spec)
spec
- a XMLElement
containing the specification for the checkbox.protected boolean readCheckBox(Object[] field)
field
- the object array that holds the details of the field.
true
if there was no problem reading the data or if there was an
irrecovarable problem. If there was a problem that can be corrected by the operator, an error
dialog is popped up and false
is returned.protected void addSearch(net.n3.nanoxml.XMLElement spec)
This is a complete example of a valid XML specification
<field type="search" variable="testVariable"> <description text="Description for the search field" id="a key for translated text"/> <spec text="label" id="key for the label" filename="the_file_to_search" result="directory" /> <!-- values for result: directory, file --> <choice dir="directory1" set="true" /> <!-- default value --> <choice dir="dir2" /> </spec> </field>
spec
- a XMLElement
containing the specification for the search fieldprotected boolean readSearch(Object[] field)
field
- the object array that holds the details of the field.
true
if there was no problem reading the data or if there was an
irrecovarable problem. If there was a problem that can be corrected by the operator, an error
dialog is popped up and false
is returned.protected void addText(net.n3.nanoxml.XMLElement spec)
spec
- a XMLElement
containing the specification for the text.protected void addSpace(net.n3.nanoxml.XMLElement spec)
spec
- a XMLElement
containing other specifications. At present this
information is not used but might be in future versions.protected void addDivider(net.n3.nanoxml.XMLElement spec)
spec
- a XMLElement
containing additional specifications.protected void addDescription(net.n3.nanoxml.XMLElement spec, Vector forPacks, Vector forOs, Vector suppress)
spec
- a XMLElement
containing the specification for the description.protected boolean getBoolean(net.n3.nanoxml.XMLElement element, String attribute, boolean defaultValue)
TRUE
then true is returned. If it equals
FALSE
the false is returned. In all other cases, including when the attribute
is not found, the default value is returned.
element
- the XMLElement
to search for the attribute.attribute
- the attribute to search fordefaultValue
- the default value to use if the attribute does not exist or a illegal
value was discovered.
true
if the attribute is found and the value equals the the constant
TRUE
. < if the
attribute is FALSE
. In all other cases the
default value is returned.
protected float getFloat(net.n3.nanoxml.XMLElement element, String attribute, float defaultValue)
element
- the XMLElement
to search for the attribute.attribute
- the attribute to search fordefaultValue
- the default value to use in case the attribute does not exist.
protected String getText(net.n3.nanoxml.XMLElement element)
XMLElement
. The text must be defined in the
resource file under the key defined in the id
attribute or as value of the
attribute text
.
element
- the XMLElement
from which to extract the text.
XMLElement
. If no text can be located,
null
is returned.protected int getAlignment(net.n3.nanoxml.XMLElement element)
XMLElement
. The default value in case
the ALIGNMENT
attribute is not found or the value is illegal is
TwoColumnConstraints.LEFT
.
element
- the XMLElement
from which to extract the alignment setting.
XMLElement
. The value is either
TwoColumnConstraints.LEFT
, TwoColumnConstraints.CENTER
or
TwoColumnConstraints.RIGHT
.TwoColumnConstraints
public boolean itemRequiredForOs(Vector os)
true
is always returnd.
os
- The Vector
of String
s. containing the os names
true
if the item is required for the os, otherwise returns
false
.protected boolean itemRequiredFor(Vector packs)
true
is always returnd. The same
is true if the packs
list is empty.
packs
- a Vector
of String
s. Each of the strings denotes
a pack for which an item should be created if the pack is actually installed.
true
if the item is required for at least one pack in the list,
otherwise returns false
.protected boolean itemRequiredForUnselected(Vector packs)
true
is always returnd. The same
is true if the packs
list is empty.
packs
- a Vector
of String
s. Each of the strings denotes
a pack for which an item should be created if the pack is actually installed.
true
if the item is required for at least one pack in the list,
otherwise returns false
.protected Vector getUiElements()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |