Java Doc for Wizard.java in  » IDE-Netbeans » nbi » org » netbeans » installer » wizard » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » nbi » org.netbeans.installer.wizard 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.installer.wizard.Wizard

Wizard
public class Wizard (Code)
This is the main class of the NBI Wizard framework. It represents the wizard as a whole.

The wizard serves a the main source of the data input by the user. It is organized as a series of pages, each either informing the user about something or displaying an input field. The input validation also happens here.

The wizard is a singleton in some sense, i.e. only one instance of Wizard can be created directly, via the Wizard.getInstance() method. All other instances that may be created during the course of wizard's workflow will be the so-called child wizards.

The wizard operates over a list of WizardComponent s. In order to add "depth", the user needs to create sub-wizards which would have their own sequences of components, but will appear as a single component to the parent wizard. This effect can be obtained via the org.netbeans.installer.wizard.components.WizardSequence component.

Context. Each wizard can have an associated context. A Context is a simple collection of objects which can be fetched by their class. The context is assigned to a wizard at runtime, thus it is possible to switch contexts basing on some conditions. The context is intended to be read-only, though it is possible to add new objects to it. The most common usecase for a context would be passing an instance of an object to all the components of a wizard.

Property container. Since the princial use case for a wizard is collecting some user input, the values entered by the user need to be stored somewhere. For this purpose a wizard has an associated PropertyContainer . It serves as a storage for the user-entered strings.

The root wizard instance will load its list of components from an URI defined in the system property Wizard.COMPONENTS_INSTANCE_URI_PROPERTY , if the property is not set, then it falls back to the Wizard.DEFAULT_COMPONENTS_INSTANCE_URI . For child wizards, created with one of the Wizard.createSubWizard(List,int) methods, expect that their lists of components will be passed in directly. The list of components can be constructed using the Wizard.loadWizardComponents(String) method.
author:
   Kirill Sorokin
since:
   1.0



Field Summary
final public static  StringATTRIBUTE_CLASS
     Name of the XML attribute which contains the classname of a component.
final public static  StringCOMPONENTS_INSTANCE_URI_PROPERTY
     Name of the system property which is expected to contain the URI which points to the XML file with the list of components for the root wizard.
final public static  StringCOMPONENTS_SCHEMA_URI_PROPERTY
     Name of the system property which is expected to contain the URI which points to the XML schema which defines the format for the serialized list of wizard components.
final public static  StringCURRENT_COMPONENT_CLASSNAME_PROPERTY
     Name of the system property which will be set when a component executes.
final public static  StringDEFAULT_COMPONENTS_INSTANCE_URI
     Default URI which points to the XML file with the list of components for the root wizard.
final public static  StringDEFAULT_COMPONENTS_SCHEMA_URI
     Default URI which points to the XML schema which defines the format for the serialized list of wizard components.
final public static  StringTAG_COMPONENT
     Name of the XML tag which describes an individual component.
final public static  StringTAG_COMPONENTS
     Name of the XML tag which describes a list of components.
final public static  StringTAG_PROPERTIES
     Name of the XMl tag which describes the properties of a component.

Constructor Summary
public  Wizard()
     Default constructor.
public  Wizard(Wizard parent)
     Constructs a new instance of Wizard with the given parent.
public  Wizard(Wizard parent, List<WizardComponent> components, int index)
     Constructs a new instance of Wizard with the given parent, list of WizardComponent and inital index of the active component.
public  Wizard(Wizard parent, List<WizardComponent> components, int index, PropertyContainer propertyContainer, ClassLoader classLoader)
     Constructs a new instance of Wizard with the given parent, list of WizardComponent , inital index of the active component, properties container and classloader.

Method Summary
public  voidclose()
     Closes the wizard.
public  WizardcreateSubWizard(List<WizardComponent> components, int index)
     Creates a new child (or sub-) wizard with the given list of WizardComponent s and the initial index of the active component.
Parameters:
  components - List of WizardComponents over which the childwizard should iterate.
Parameters:
  index - Initial index of the active component.
public  WizardcreateSubWizard(List<WizardComponent> components, int index, PropertyContainer propertyContainer, ClassLoader classLoader)
     Creates a new child (or sub-) wizard with the given list of WizardComponent s, initial index of the active component, property container and class loader.
Parameters:
  components - List of WizardComponents over which the childwizard should iterate.
Parameters:
  index - Initial index of the active component.
Parameters:
  propertyContainer - PropertyContainer which should be used bythe child wizard.
Parameters:
  classLoader - ClassLoader which should be used by the childwizard.
public  ClassLoadergetClassLoader()
     Returns the ClassLoader used by this Wizard instance.
public  WizardContainergetContainer()
     Returns the WizardContainer which is used by this Wizard instance.
public  ContextgetContext()
     Returns the Context of this Wizard instance.
public  FinishHandlergetFinishHandler()
     Returns the FinishHandler used by this Wizard instance.
public  intgetIndex()
     Returns the index of the currently active component.
public static synchronized  WizardgetInstance()
     Returns the instance of the root Wizard .
public  StringgetProperty(String name)
     Gets the value of the property with the given name.
public  booleanhasNext()
     Checks whether there is exists a component which can be reached using the Wizard.next() method.
public  booleanhasPrevious()
     Checks whether there is exists a component which can be reached using the Wizard.previous() method.
public static  List<WizardComponent>loadWizardComponents(String componentsUri)
     Loads the list of WizardComponent from an XML file identified by its URI.
public static  List<WizardComponent>loadWizardComponents(String componentsUri, ClassLoader classLoader)
     Loads the list of WizardComponent from an XML file identified by its URI and using the specified ClassLoader to load the components' classes.
public  voidnext()
     Proceeds to the next element in the wizard.
public  voidopen()
     Opens the wizard.
public  voidopenBlocking()
     Opens the wizard in a blocking mode.
public  voidprevious()
     Moves to the previous element in the wizard.
public  voidsetFinishHandler(FinishHandler finishHandler)
     Sets the FinishHandler which should be used by this Wizard instance.
public  voidsetProperty(String name, String value)
     Sets the value of the property with the given name to the given value.

Field Detail
ATTRIBUTE_CLASS
final public static String ATTRIBUTE_CLASS(Code)
Name of the XML attribute which contains the classname of a component.



COMPONENTS_INSTANCE_URI_PROPERTY
final public static String COMPONENTS_INSTANCE_URI_PROPERTY(Code)
Name of the system property which is expected to contain the URI which points to the XML file with the list of components for the root wizard.



COMPONENTS_SCHEMA_URI_PROPERTY
final public static String COMPONENTS_SCHEMA_URI_PROPERTY(Code)
Name of the system property which is expected to contain the URI which points to the XML schema which defines the format for the serialized list of wizard components.



CURRENT_COMPONENT_CLASSNAME_PROPERTY
final public static String CURRENT_COMPONENT_CLASSNAME_PROPERTY(Code)
Name of the system property which will be set when a component executes. Its value will be the fully qualified class name of the component.



DEFAULT_COMPONENTS_INSTANCE_URI
final public static String DEFAULT_COMPONENTS_INSTANCE_URI(Code)
Default URI which points to the XML file with the list of components for the root wizard.



DEFAULT_COMPONENTS_SCHEMA_URI
final public static String DEFAULT_COMPONENTS_SCHEMA_URI(Code)
Default URI which points to the XML schema which defines the format for the serialized list of wizard components.



TAG_COMPONENT
final public static String TAG_COMPONENT(Code)
Name of the XML tag which describes an individual component.



TAG_COMPONENTS
final public static String TAG_COMPONENTS(Code)
Name of the XML tag which describes a list of components.



TAG_PROPERTIES
final public static String TAG_PROPERTIES(Code)
Name of the XMl tag which describes the properties of a component.




Constructor Detail
Wizard
public Wizard()(Code)
Default constructor. Performs initialization of the basic properties, which, however, is not enough for normal operation - the list of WizardComponent is not initialized.



Wizard
public Wizard(Wizard parent)(Code)
Constructs a new instance of Wizard with the given parent. Most of the properties of the new instance are inherited from the parent.
Parameters:
  parent - Parent Wizard.



Wizard
public Wizard(Wizard parent, List<WizardComponent> components, int index)(Code)
Constructs a new instance of Wizard with the given parent, list of WizardComponent and inital index of the active component.
Parameters:
  parent - Parent Wizard.
Parameters:
  components - List of WizardComponents over which the wizardshould iterate.
Parameters:
  index - Initial index of the active component.



Wizard
public Wizard(Wizard parent, List<WizardComponent> components, int index, PropertyContainer propertyContainer, ClassLoader classLoader)(Code)
Constructs a new instance of Wizard with the given parent, list of WizardComponent , inital index of the active component, properties container and classloader.
Parameters:
  parent - Parent Wizard.
Parameters:
  components - List of WizardComponent over which the wizardshould iterate.
Parameters:
  index - Initial index of the active component.
Parameters:
  propertyContainer - PropertyContainer which should be used bythe wizard.
Parameters:
  classLoader - ClassLoader which should be used by the wizard.




Method Detail
close
public void close()(Code)
Closes the wizard. The current WizardContainer is hidden and deinitialized. No real action is taken if the UI mode is UiMode.SILENT .

If the current wizard is not the ro ot one - the parent's Wizard.close() method is called.




createSubWizard
public Wizard createSubWizard(List<WizardComponent> components, int index)(Code)
Creates a new child (or sub-) wizard with the given list of WizardComponent s and the initial index of the active component.
Parameters:
  components - List of WizardComponents over which the childwizard should iterate.
Parameters:
  index - Initial index of the active component. New child (sub-) wizard.



createSubWizard
public Wizard createSubWizard(List<WizardComponent> components, int index, PropertyContainer propertyContainer, ClassLoader classLoader)(Code)
Creates a new child (or sub-) wizard with the given list of WizardComponent s, initial index of the active component, property container and class loader.
Parameters:
  components - List of WizardComponents over which the childwizard should iterate.
Parameters:
  index - Initial index of the active component.
Parameters:
  propertyContainer - PropertyContainer which should be used bythe child wizard.
Parameters:
  classLoader - ClassLoader which should be used by the childwizard. New child (sub-) wizard.



getClassLoader
public ClassLoader getClassLoader()(Code)
Returns the ClassLoader used by this Wizard instance. ClassLoader used by this Wizard instance.



getContainer
public WizardContainer getContainer()(Code)
Returns the WizardContainer which is used by this Wizard instance. WizardContainer which is used by this Wizardinstance.



getContext
public Context getContext()(Code)
Returns the Context of this Wizard instance. Context of this Wizard instance.



getFinishHandler
public FinishHandler getFinishHandler()(Code)
Returns the FinishHandler used by this Wizard instance. FinishHandler used by this Wizard instance.



getIndex
public int getIndex()(Code)
Returns the index of the currently active component. Index of the currently active component.



getInstance
public static synchronized Wizard getInstance()(Code)
Returns the instance of the root Wizard . If the instance does not exist - it is created and all system properties that make sense for the Wizard are parsed: Wizard.COMPONENTS_INSTANCE_URI_PROPERTY and Wizard.COMPONENTS_SCHEMA_URI_PROPERTY . The instance of the root Wizard.



getProperty
public String getProperty(String name)(Code)
Gets the value of the property with the given name. This method in turn calls the PropertyContainer.getProperty(String) method on the property container used by this wizard instance.
Parameters:
  name - Name of the property whose value should be obtained. Value of the specified property, or null is the propertywith the given name does not exist.



hasNext
public boolean hasNext()(Code)
Checks whether there is exists a component which can be reached using the Wizard.next() method. This method checks both the components of the current wizard and the parent one. true is there is a next element, falseotherwise.



hasPrevious
public boolean hasPrevious()(Code)
Checks whether there is exists a component which can be reached using the Wizard.previous() method. This method checks both the components of the current wizard and the parent one. true is there is a previous element, falseotherwise.



loadWizardComponents
public static List<WizardComponent> loadWizardComponents(String componentsUri) throws InitializationException(Code)
Loads the list of WizardComponent from an XML file identified by its URI. The URI can be of any scheme supported by the org.netbeans.installer.downloader.DownloadManager .
Parameters:
  componentsUri - URI of the XML file which contains the list ofWizardComponents. The list of WizardComponent defined in the XML file.
throws:
  org.netbeans.installer.utils.exceptions.InitializationException - If anerror occurs during loading of the list.



loadWizardComponents
public static List<WizardComponent> loadWizardComponents(String componentsUri, ClassLoader classLoader) throws InitializationException(Code)
Loads the list of WizardComponent from an XML file identified by its URI and using the specified ClassLoader to load the components' classes. The URI can be of any scheme supported by the org.netbeans.installer.downloader.DownloadManager .
Parameters:
  componentsUri - URI of the XML file which contains the list ofWizardComponent.
Parameters:
  classLoader - Instance of ClassLoader which should be used forloading the components' classes. The list of WizardComponent defined in the XML file.
throws:
  org.netbeans.installer.utils.exceptions.InitializationException - If anerror occurs during loading of the list.



next
public void next()(Code)
Proceeds to the next element in the wizard. If the next element is not available and the current wizard instance is the root one, then the wizard is considered to be at the last element and the wizard's FinishHandler.finish is called.

If the current wizard is not the root instance and there is no next component, then the parent wizard's Wizard.next() method is called.




open
public void open()(Code)
Opens the wizard. Depending on the current UI mode, an appropriate WizardContainer is chosen, initialized and set to be visible. No wizard container is created if the UI Mode is UiMode.SILENT .

If the current wizard is not the root one - the parent's Wizard.open() method is called.




openBlocking
public void openBlocking()(Code)
Opens the wizard in a blocking mode. As opposed to Wizard.open() , this method will not return the wizard is closed from another thread.
See Also:   Wizard.open()



previous
public void previous()(Code)
Moves to the previous element in the wizard. If the previous component is not available and the current wizard instance is the root one a critical error is shown and the application terminates.

If the current wizard is not the root one and there is no previous component in the current sequence, the parent's Wizard.previous() method is called.




setFinishHandler
public void setFinishHandler(FinishHandler finishHandler)(Code)
Sets the FinishHandler which should be used by this Wizard instance.
Parameters:
  finishHandler - FinishHandler which should be used by thisWizard instance.



setProperty
public void setProperty(String name, String value)(Code)
Sets the value of the property with the given name to the given value. This method in turn calls the PropertyContainer.setProperty(StringString) method on the property container used by this wizard instance.
Parameters:
  name - Name of the property whose value should be set.
Parameters:
  value - New value for the property.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.