|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.api.wizard.WizardDisplayer
public abstract class WizardDisplayer extends java.lang.Object
Wizard
in a dialog onscreen or in an ad-hoc
container. Usage:
Wizard wizard = WizardPage.createWizard (new Class[] {WizardPageSubclass1.class, WizardPageSubclass2.class, WizardPageSubclass3.class}, new MyWizardResultProducer(); WizardDisplayer.showWizard (wizard);Alternately you can implement
WizardPanelProvider
instead of
WizardPage
to provide the panels of the wizard.
To use a Wizard
in a JInternalFrame
or similar, use
WizardDisplayer.installInContainer()
. You will need to implement
WizardResultReceiver
which will me notified when the wizard
is finished or cancelled, to close the internal frame or whatever UI is
showing the wizard.
java.awt.image.BufferedImage
into
UIManager with the key wizard.sidebar.image
, i.e.
BufferedImage img = ImageIO.read (getClass().getResource ("MySideImage.png"); UIManager.put ("wizard.sidebar.image", img);
wizard.sidebar.image
to set a path
within a JAR on the classpath to the image. The image must be visible
to the classloader which loads WizardDisplayer
, so this
may not work in environments which manage the classpath. i.e.
System.setProperty ("wizard.sidebar.image", "com/foo/myapp/MySideImage.png");
WizardDisplayer
is pluggable. While the
default implementation should be adequate for most cases, it is possible
that in some cases one might want to completely replace the UI, buttons,
etc. with custom UI code. To do that:
org.openide.util.Lookup
is on the classpath, the default implementation will be found in
the default lookup (i.e. META-INF/services, same as
JDK 6's ServiceLoader)WizardDisplayer
will check the system
property WizardDisplayer.default
for a fully qualified
class name of a subclass of WizardDisplayer
.
WizardDisplayer
is found
by the above methods, the default implementation contained in this
library will be used.
Modifier | Constructor and Description |
---|---|
protected |
WizardDisplayer()
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
install(java.awt.Container c,
java.lang.Object layoutConstraint,
Wizard awizard,
javax.swing.Action helpAction,
java.util.Map initialProperties,
WizardResultReceiver receiver)
Instance implementation of installInContainer(). |
static void |
installInContainer(java.awt.Container c,
java.lang.Object layoutConstraint,
Wizard awizard,
javax.swing.Action helpAction,
java.util.Map initialProperties,
WizardResultReceiver receiver)
Install a panel representing a Wizard in a user-supplied container with a user-supplied layout constraint. |
protected abstract java.lang.Object |
show(Wizard wizard,
java.awt.Rectangle r,
javax.swing.Action help,
java.util.Map initialProperties)
Show a wizard. |
static java.lang.Object |
showWizard(Wizard wizard)
Show a wizard with default window placement and no Help button |
static java.lang.Object |
showWizard(Wizard wizard,
javax.swing.Action help)
Show a wizard with default window placement, showing the help button, which will invoke the passed action. |
static java.lang.Object |
showWizard(Wizard wizard,
java.awt.Rectangle r)
Show a wizard in the passed location on screen with no help button |
static java.lang.Object |
showWizard(Wizard wizard,
java.awt.Rectangle rect,
javax.swing.Action help,
java.util.Map initialProperties)
Display a wizard in a dialog, using the default implementation of WizardDisplayer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected WizardDisplayer()
Method Detail |
---|
public static java.lang.Object showWizard(Wizard wizard, java.awt.Rectangle rect, javax.swing.Action help, java.util.Map initialProperties)
wizard
- The wizard to show. Must not be nullrect
- The rectangle on screen for the wizard, may be null for default sizehelp
- An action to invoke if the user presses the help buttoninitialProperties
- are the initial values for properties to be shown
and entered in the wizard. May be null.public static java.lang.Object showWizard(Wizard wizard)
public static java.lang.Object showWizard(Wizard wizard, javax.swing.Action help)
wizard
- The wizard to showhelp
- An action to invoke if the user presses the help buttonpublic static java.lang.Object showWizard(Wizard wizard, java.awt.Rectangle r)
wizard
- The wizard to showr
- The rectangle on screen for the wizardprotected abstract java.lang.Object show(Wizard wizard, java.awt.Rectangle r, javax.swing.Action help, java.util.Map initialProperties)
wizard
- the Wizard to showr
- the bounding rectangle for the wizard dialog on screen, null means "computed from first panel size"help
- An action to be called if the Help button is pressedinitialProperties
- are used to set initial values for screens within the wizard.
This may be null.finish()
method, if the Wizard was completed by the user.public static void installInContainer(java.awt.Container c, java.lang.Object layoutConstraint, Wizard awizard, javax.swing.Action helpAction, java.util.Map initialProperties, WizardResultReceiver receiver)
c
- The container the wizard panel should be added to. May not
be null.layoutConstraint
- The argument to use when adding the wizard's
ui component to the container. May be null.helpAction
- An action that should be invoked when the help button
is clicked (if null, no help button will be displayed)initialProperties
- A set of properties that should be pre-set upon
entering the wizard. May be null.receiver
- An object which will be called when the Finish or
Cancel buttons are pressed. May not be null.protected abstract void install(java.awt.Container c, java.lang.Object layoutConstraint, Wizard awizard, javax.swing.Action helpAction, java.util.Map initialProperties, WizardResultReceiver receiver)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |