public class WizardIndex
extends java.lang.Object
By default, no wizard index is set. You can set a wizard index by calling
WizardContext.setWizardIndex(WizardIndex)
in a script.
If you install the wizard context in the "Pre-activation script" property, it will be used for the current screen.
When installed in any other scripts, set the wizard screen will become active once the next screen is shown.
The current wizard index is persistent, meaning that it will remain in place for all subsequent screens until the index
key of the wizard is changed or the wizard index is set to null
again. A simple usage scenario is given below:
context.getWizardContext().setWizardIndex(new WizardIndex(new String[]
{"Gather Requirements", "Installation", "Service Setup"}));
in the "Pre-activation" script of that screen.
When the wizard context is set that way, the keys for the index steps are auto-generated and set to "1", "2" and "3".
If they should be mnemonic, use the 2-arg constructor where you can specify an array with keys as the second argument.
When you install the wizard index, the first step is highlighted automatically.
context.getWizardContext().setWizardIndexKey("2");
to highlight step 2 ("Installation") and
context.getWizardContext().setWizardIndexKey("3");
to highlight step 3 ("Service setup").
Advanced tasks:
context.getWizardContext().setWizardIndex(null);
minWidth
and maxWidth
methods:
new WizardIndex(new String[] {...}
.maxWidth(400).minWidth(50)
}
context.getWizardContext().setWizardIndex(new WizardIndex(
new String[] {"Installation type"})).partiallyDefined(true);
In the "Validation expression" of the screen, you then skip to to two different sequences of screens, depending on the selected
installation type. In the first screens of each sequence, install new wizard indices with their full respective contents, but
repeat the "Installation type" entry and set the selected wizard index key to the second element immediately. In this way, #
the partially defined wizard index expands to the full content on the second screen.
foreground(Color)
background(Color)
backgroundImage(File)
backgroundImageAnchor(anchor)
Constructor and Description |
---|
WizardIndex(java.lang.String[] stepNames)
Construct a wizard index with the specified step names and auto-generate the index keys to the strings "1", "2", "3", and so on.
|
WizardIndex(java.lang.String[] stepNames,
java.lang.String[] keys)
Construct a wizard index with the specified step names and index keys.
|
Modifier and Type | Method and Description |
---|---|
WizardIndex |
background(java.awt.Color background)
Sets the background color of the index panel.
|
WizardIndex |
backgroundImage(java.io.File backgroundImage)
Sets the background image file.
|
WizardIndex |
backgroundImageAnchor(Anchor anchor)
Sets the anchor for the background image file.
|
WizardIndex |
foreground(java.awt.Color foreground)
Sets the foreground color of the index panel.
|
java.awt.Color |
getBackground()
Returns the background color of the index panel
|
java.io.File |
getBackgroundImage()
Returns the background image file.
|
Anchor |
getBackgroundImageAnchor()
Returns the anchor for the background image file.
|
java.awt.Color |
getForeground()
Returns the foreground color of the index panel used for the text color
|
java.lang.String |
getInitialKey()
Returns the key of the step name that should be initially selected
|
java.lang.String[] |
getKeys()
Returns the index keys
|
int |
getMaxWidth()
Returns the maximum width of the index panel
|
int |
getMinWidth()
Returns the minimum width of the index panel.
|
java.lang.String[] |
getStepNames()
Returns the step names
|
WizardIndex |
initialKey(java.lang.String initialKey)
Sets the key of the step name that should be initially selected.
|
boolean |
isNumbered()
Returns if numbers should be added in front of each index step.
|
boolean |
isPartiallyDefined()
Returns of the wizard index is partially defined.
|
WizardIndex |
maxWidth(int maxWidth)
Sets the maximum width of the index panel.
|
WizardIndex |
minWidth(int minWidth)
Sets the minimum width of the index panel.
|
WizardIndex |
numbered(boolean numbered)
Sets if numbers should be added in front of each index step.
|
WizardIndex |
partiallyDefined(boolean partiallyDefined)
Sets if the wizard index should be partially defined.
|
public WizardIndex(java.lang.String[] stepNames)
stepNames
- the displayed step namespublic WizardIndex(java.lang.String[] stepNames, java.lang.String[] keys)
stepNames
- the displayed step nameskeys
- the keys for the step names, to be used in WizardContext.setWizardIndexKey(String)
public java.lang.String[] getStepNames()
public java.lang.String[] getKeys()
public boolean isPartiallyDefined()
public WizardIndex partiallyDefined(boolean partiallyDefined)
false
.partiallyDefined
- if partially definedpublic int getMaxWidth()
public WizardIndex maxWidth(int maxWidth)
maxWidth
- the maximum width in pixelspublic int getMinWidth()
public WizardIndex minWidth(int minWidth)
minWidth
- the minimum widthpublic boolean isNumbered()
true
or false
public WizardIndex numbered(boolean numbered)
true
.numbered
- true
or false
public java.awt.Color getBackground()
null
if no background color has been setpublic WizardIndex background(java.awt.Color background)
background
- the background colorpublic java.awt.Color getForeground()
null
if no foreground color has been setpublic WizardIndex foreground(java.awt.Color foreground)
foreground
- the foreground colorpublic java.io.File getBackgroundImage()
null
if no background image file has been set.public WizardIndex backgroundImage(java.io.File backgroundImage)
new File("image.png")
is resolved to the resource directory. You can add image files on the Installer->Custom Code &Resources tab
and use them that way.backgroundImage
- the image filepublic Anchor getBackgroundImageAnchor()
public WizardIndex backgroundImageAnchor(Anchor anchor)
anchor
- the anchorpublic java.lang.String getInitialKey()
public WizardIndex initialKey(java.lang.String initialKey)
initialKey
- the key