|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--com.denova.ui.WizardPanel
Any time consuming work in either a WizardPanel constructor or the methods enter() and leave() must be spun off into another thread. If the new thread does Swing work with methods that are not thread safe, the code must use invokeLater() or invokeAndWait(). It can use invokeLater() directly or through Swinger, SwingWorker, etc.
| Field Summary | |
static java.lang.Integer |
CancelButton
|
static java.lang.Integer |
NextButton
|
static java.lang.Integer |
NoDefault
|
static java.lang.Integer |
PreviousButton
|
| 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 java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
WizardPanel()
WizardPanel constructor. |
|
WizardPanel(javax.swing.JPanel panel,
com.denova.util.PropertyList properties)
WizardPanel constructor. |
|
WizardPanel(javax.swing.JPanel panel,
com.denova.util.PropertyList properties,
com.denova.io.Log errorLog)
Deprecated. |
|
WizardPanel(com.denova.util.PropertyList properties)
To fully integrate a custom extension, create a class that extends WizardPanel. |
|
WizardPanel(com.denova.util.PropertyList properties,
com.denova.io.Log errorLog)
Deprecated. |
|
| Method Summary | |
void |
abort()
Abort the wizard. |
boolean |
ask(java.lang.String question)
Pops up a dialog and asks the user a yes/no question. |
boolean |
ask(java.lang.String question,
java.lang.String title,
java.lang.String yesOption,
java.lang.String noOption)
Pops up a dialog and asks the user a yes/no question. |
void |
cancel()
Cancel the wizard, if user confirms they want to do so. |
void |
enter()
Called when the user enters this wizard panel. |
java.lang.String |
getCancelButtonIconName()
Get custom icon name for the Cancel button. |
java.lang.String |
getCancelButtonLabel()
Get custom text for the Cancel button. |
java.lang.Integer |
getDefaultButton()
Sets default wizard button for this panel. |
java.lang.String |
getDefaultCancelButtonIconName()
Get default icon name for the Cancel button. |
java.lang.String |
getDefaultFinishedButtonIconName()
Get default icon name for the Finished button. |
java.lang.String |
getDefaultInstallButtonIconName()
Get default icon name for the Install button. |
java.lang.String |
getDefaultNextButtonIconName()
Get default icon name for the Next button. |
java.lang.String |
getDefaultPreviousButtonIconName()
Get default icon name for the Back button. |
int |
getMostRecentPanelIndex()
Returns the index of the panel that was active before the current panel. |
java.lang.String |
getMostRecentPanelName()
Returns the name of the panel that was active before the current panel. |
java.lang.String |
getName()
Called by the Wizard to get the name of this panel, used by showPanel(String). |
javax.swing.JButton |
getNextButton()
Deprecated. See updateWizardButtons(). |
boolean |
getNextButtonExists()
Returns whether Next button exists on this panel. |
java.lang.String |
getNextButtonIconName()
Get custom icon name for the Next button. |
java.lang.String |
getNextButtonLabel()
Get custom text for the Next button. |
int |
getPanelIndex()
Returns the index of the active panel. |
javax.swing.JButton |
getPreviousButton()
Deprecated. See updateWizardButtons(). |
boolean |
getPreviousButtonExists()
Returns whether Back button exists on this panel. |
java.lang.String |
getPreviousButtonIconName()
Get custom icon name for the Back button. |
java.lang.String |
getPreviousButtonLabel()
Get custom text for the Back button. |
com.denova.util.PropertyList |
getPropertyList()
Returns the list of properties available during the installation. |
void |
gotMessage(java.lang.Object source,
java.lang.Object message)
This is just a placeholder so subclasses can override it, instead of trying to add a listener before the wizard has been set. |
boolean |
isAix()
Returns true if operating on AIX |
boolean |
isCancelButtonEnabled()
Returns whether the Cancel button is enabled. |
boolean |
isCurrentPanel()
Returns if this is the current panel showing in the wizard. |
boolean |
isEnabled()
Returns whether this panel is enabled. |
boolean |
isHpUnix()
Returns true if operating on HP's Unix |
boolean |
isLinux()
Returns true if operating on Linux |
boolean |
isMac()
Returns true if operating on Mac OS |
boolean |
isMacOsX()
Returns true if operating on Mac OS X |
boolean |
isMpeUnix()
Returns true if operating on MPE/iX |
boolean |
isNetware()
Returns true if operating on Netware |
boolean |
isNextButtonEnabled()
Returns whether the Next button is enabled. |
boolean |
isOk()
Called by the Wizard to check whether this panel is ok, when the user click on Next. |
boolean |
isOs2()
Returns true if operating on OS/2 |
boolean |
isPreviousButtonEnabled()
Returns whether the Back button is enabled. |
boolean |
isSolaris()
Returns true if operating on Solaris |
boolean |
isUnix()
Returns true if operating on Unix |
boolean |
isWindows()
Returns true if operating on any variant of Windows |
boolean |
isWindows2000()
Returns true if operating on Windows 2000 |
boolean |
isWindows95()
Returns true if operating on Windows 95 |
boolean |
isWindows98()
Returns true if operating on Windows 98 |
boolean |
isWindowsNT()
Returns true if operating on Windows NT |
boolean |
isWindowsXP()
Returns true if operating on Windows XP |
void |
leave()
Called when the user leaves this wizard panel. |
void |
note(java.lang.String message)
Display a message in a dialog box until the user clicks Ok button. |
void |
note(java.lang.String[] message)
Display a multiline message in a dialog box until the user clicks Ok. |
void |
note(java.lang.String message,
java.lang.String okMessage)
Display a message in a dialog box until the user clicks OkMessage button. |
void |
reset()
reset is called whenever a panel calls resetPanel ( panelName );. |
boolean |
resetPanel(java.lang.String name)
Resets the named panel to its original settings. |
void |
setActive(boolean active)
Deprecated. Use enter() and leave() instead. |
void |
setCancelButtonEnabled(boolean enabled)
Sets whether the Cancel button is enabled. |
void |
setDefaultButton(java.lang.Integer button)
Sets default wizard button for this panel. |
void |
setDefaultFinishedButtonIconName(java.lang.String newIconName)
Set default icon name for the Finished button. |
void |
setEnabled(boolean e)
Sets whether this panel is enabled. |
void |
setEnabledNamedPanel(java.lang.String name,
boolean b)
Enable/Disable the panel with the matching name. |
void |
setNextButtonEnabled(boolean enabled)
Sets whether the Next button is enabled. |
void |
setPreviousButtonEnabled(boolean enabled)
Sets whether the Previous button is enabled. |
void |
setPropertyList(com.denova.util.PropertyList properties)
Sets properties used during the installation. |
void |
setWizard(com.denova.ui.Wizard wiz)
Called by the Wizard class when a panel is added. |
void |
showNextPanel()
Displays the next panel without the user clicking the Next button. |
void |
showPanel(int i)
Displays a particular panel. |
void |
showPanel(java.lang.String name)
Moves to a named panel. |
void |
showPreviousPanel()
Displays the previous panel without the user clicking the Back button. |
void |
userCanceled()
Called by the Wizard to notify this panel when the user cancels the wizard. |
javax.swing.JButton |
wizardGetDefaultButton()
Returns default button for this panel, or null if none. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.Integer NoDefault
public static final java.lang.Integer PreviousButton
public static final java.lang.Integer NextButton
public static final java.lang.Integer CancelButton
| Constructor Detail |
public WizardPanel(com.denova.util.PropertyList properties)
WizardPanel is a JPanel, so you add components in the constructor, as is the norm with Swing, not in addnotify. Store your custom class in the JExpressInstaller subdirectory so it will be available during the installation.
Your constructor must pass a couple of parameters to the WizardPanel's constructor. It can do more if you like, but this is the minimum. Treat the "PropertyList" parameter to the constructor as an instance of Properties.
WizardPanel is a class which is never instantiated directly, but is extended by all wizard panels. The constructor of all WizardPanels is called at the beginning of the application so constructors should do screen layouts and little else. All other code should be called from inside the enter leave methods.
properties - program's properties
public WizardPanel(com.denova.util.PropertyList properties,
com.denova.io.Log errorLog)
properties - program's propertieserrorLog - (ignored)
public WizardPanel(javax.swing.JPanel panel,
com.denova.util.PropertyList properties)
panel - jpanel to be added to this wizard panel.properties - program's properties
public WizardPanel(javax.swing.JPanel panel,
com.denova.util.PropertyList properties,
com.denova.io.Log errorLog)
panel - jpanel to be added to this wizard panel.properties - program's propertieserrorLog - (ignored)public WizardPanel()
| Method Detail |
public void setActive(boolean active)
This method is called whenever your WizardPanel becomes active or inactive.
When the parameter "active" is true your panel has control. You can then interact with the user or take almost any other action you like. Before setActive is called and whenever the parameter "active" is false your panel is not visible and should not take any action in the current thread. You can always start another thread if you like, but be certain it's not dependent on any of your components being visible.
Active is set to true when your panel is called from showPanel(), showNextPanel(), or showPreviousPanel(). When your panel calls showPanel(), showNextPanel(), or showPreviousPanel(), then active is set to false. Be sure to start another thread if you want your panel to do something when active is set to false.
Important: You should not call setActive() from your custom panel and you should not change the state of active.
See the RegisterPanel.java for an example of this method. See the ExampleCommand.java for an example of starting another thread from a custom panel.
active - new activepublic void enter()
public void leave()
public void setPropertyList(com.denova.util.PropertyList properties)
To set a particular property in the list, then use setPropertyList (). setProperty ( "propertyName", "property" ); where "propertyName" is replaced with the name of the property and "property" is replaced with the value of the property
See DeleteMenuItemsPanel.java for an example of this method.
properties - new property listpublic void setEnabled(boolean e)
If this panel is not enabled, the Wizard will skip it
setEnabled in class javax.swing.JComponente - new enabled
public void setEnabledNamedPanel(java.lang.String name,
boolean b)
If the boolean value is true, then enable the panel. Otherwise, disable it.
A full list of the standard panels is here.
name - new enabled named panelb - new enabled named panelpublic void setWizard(com.denova.ui.Wizard wiz)
wiz - new wizardpublic com.denova.util.PropertyList getPropertyList()
To get a particular property from the list, then use getPropertyList (). getProperty ( "propertyName" [, ""] ); where "propertyName" is replaced with the name of the property. The second parameter to getProperty is the default if the property doesn't exist.
See VersionPanel.java for an example of this method.
public javax.swing.JButton wizardGetDefaultButton()
public java.lang.Integer getDefaultButton()
public void setDefaultButton(java.lang.Integer button)
public boolean getPreviousButtonExists()
public boolean getNextButtonExists()
public java.lang.String getPreviousButtonLabel()
public java.lang.String getNextButtonLabel()
See ExampleWizardPanel.java for an example of this method.
public java.lang.String getCancelButtonLabel()
public java.lang.String getPreviousButtonIconName()
public java.lang.String getNextButtonIconName()
public java.lang.String getCancelButtonIconName()
public java.lang.String getDefaultPreviousButtonIconName()
public java.lang.String getDefaultNextButtonIconName()
public java.lang.String getDefaultCancelButtonIconName()
public java.lang.String getDefaultFinishedButtonIconName()
public void setDefaultFinishedButtonIconName(java.lang.String newIconName)
public java.lang.String getDefaultInstallButtonIconName()
public boolean isOk()
The Wizard will not move to the next or previous panel until this method returns true.
Important: Do *not* call any method that will change the panel being displayed (e.g., showPanel(), showNextPanel(), etc.) from within isOk().
public java.lang.String getName()
To show this panel from other panels by name instead of index, you must return this panel's name from this method.
getName in class java.awt.Componentpublic final javax.swing.JButton getNextButton()
Example:
getNextButton().setEnabled(false).
public final javax.swing.JButton getPreviousButton()
Example:
getPreviousButton().setEnabled(false).
public boolean isNextButtonEnabled()
public void setNextButtonEnabled(boolean enabled)
enabled - next button enabledpublic boolean isPreviousButtonEnabled()
public void setPreviousButtonEnabled(boolean enabled)
enabled - previous button enabledpublic boolean isCancelButtonEnabled()
public void setCancelButtonEnabled(boolean enabled)
enabled - cancel button enabledpublic final boolean isCurrentPanel()
public final int getMostRecentPanelIndex()
public final java.lang.String getMostRecentPanelName()
public final int getPanelIndex()
public boolean isEnabled()
isEnabled in class java.awt.Componentpublic boolean isWindows()
public boolean isWindows2000()
public boolean isWindowsNT()
public boolean isWindows98()
public boolean isWindows95()
public boolean isWindowsXP()
public boolean isUnix()
public boolean isLinux()
public boolean isAix()
public boolean isHpUnix()
public boolean isSolaris()
public boolean isMac()
public boolean isMacOsX()
public boolean isOs2()
public boolean isNetware()
public boolean isMpeUnix()
public void reset()
If your panel can normally only be activated one time during the operation of the wizard, but there are circumstances when you want to activate it a 2nd time, then define this function in your custom panel so it reconfigures the panel to allow it to be activated again.
public void userCanceled()
public void cancel()
Stops the wizard after notifying all panels that we're cancelling.
public void abort()
Stops the wizard without notifying the user or other panels.
public void showPanel(int i)
showPanel() is the equivilant of executing a "goto" which is generally a more troublesome design to support. You might see if enabling and disabling specific panels with the setEnabledNamedPanel() method will meet your needs and allow you to let the wizard manage the forward and backward flow automatically.
You should only call showPanel() from enter(). Invoking showPanel() does not end execution of your code. However remember that after successfully calling showPanel(), another panel is now active, so you probably don't want to do anything else until enter() is called again.
i is the index for the panel. The first index is 0 and corresponds to the order the panels display during the installation. Because this order may change, showPanel(panelName) is better.
For example, if you had the following panels to display in your installer:
Before install: Custom1 Custom2
After license: Custom3
After readme: Custom4 Custom5
After uninstaller: Custom6
and you have a license and readme file specified, then here's the order of the panels:
0: Custom1
1: Custom2
2: Welcome message
3: License
4: Custom3
5: Readme
6: Custom4
7: Custom5
8: Installation directory
9: Custom6
10: Finished
So you could move to Custom5 by calling showPanel(7) or Custom2 by calling showPanel(8).
i - panel numberpublic void showPanel(java.lang.String name)
The panel name must be returned by getName() in the target panel's class. Each of the panels automatically created by the installer have names so you can move to them using this version of showPanel(). Here are the names assigned to each of the standard panels in the installer.
See the showPanel(int) method for more details.
name - panel namepublic boolean resetPanel(java.lang.String name)
You only need to call this method if the named panel normally should only be called one time during the normal wizard's operation.
The name must be returned by getName() in the target panel.
For example, the standard InstallFilesPanel can only be called one time during an installation, unless you call resetPanel ( "InstallFilesPanel") before calling showPanel ( "InstallFilesPanel" )
name - panel name
public void showPreviousPanel()
You should only call showPreviousPanel() if your custom panel does not interact with the user. If your panel waits for the user to click the Next or Back buttons, then you probably do not need, nor want, to call this method.
public void showNextPanel()
You should only call showNextPanel() if your custom panel does not interact with the user. If your panel waits for the user to click the Next or Back buttons, then you probably do not need, nor want, to call this method.
See the VersionPanel.java for an example of this method.
public boolean ask(java.lang.String question)
question - a question that has a yes/no answer.
public boolean ask(java.lang.String question,
java.lang.String title,
java.lang.String yesOption,
java.lang.String noOption)
question - displayed in the dialog boxtitle - displayed in the title baryesOption - label for the "yes" answernoOption - label for the "no" answer
public void note(java.lang.String message)
message - message in a dialog box.
public void note(java.lang.String message,
java.lang.String okMessage)
message - message in the dialog boxokMessage - label for the "ok" buttonpublic void note(java.lang.String[] message)
message - multiline message in a dialog box
public void gotMessage(java.lang.Object source,
java.lang.Object message)
gotMessage in interface com.denova.util.MessageListener
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||