WizardPluginDev 

HOME INDEX SEARCH GO  

 <<O>>  Difference Topic WizardPluginDev (r1.5 - 13 Mar 2004 - AlexeyEfimov)
Added:
>
>

Variations in wizardry.xml

You can use wizardry.xml to describe only one wizard - then you must use root tag "wizard", instead of "wizardry".

If you use "wizardry" as root tag, you may define multiwizards in your wizardry package.

Localizarion of wizardry.xml

You can use same wizardry.xml for different languages. To enable localization in your wizardry package, you must clone wizardry.xml to wizardry_<language>_<country>_<variant>.xml and translate it.

To define encoding, please specify it in XML header:

<?xml version="1.0" encoding="UTF-8" ?>

Searching will be performed by looking at default system locale, and then try find the corresponding by locale file.

For example, wizardry_ru.xml will be taken if default system locale is Russian, etc.


 <<O>>  Difference Topic WizardPluginDev (r1.4 - 01 Mar 2004 - AlexeyEfimov)
Deleted:
<
<

  • New Window See Class diagram of Wizard core API.
Added:
>
>

  • update, this is event method. It fires then user see component step in Wizard expert dialog.
Deleted:
<
<

%META:FILEATTACHMENT{name="wizard-core.png" attr="h" comment="Wizard core Diagram" date="1067423304" path="I:\development\projects\JetBrains\plugins\wizard\wizard-core.png" size="24488" user="AlexeyEfimov" version="1.1"}%


 <<O>>  Difference Topic WizardPluginDev (r1.3 - 29 Jan 2004 - AlexeyEfimov)
Changed:
<
<

  • getIcon, this method return icon of Wizard tab. Return null if you wish no icon in tab.
>
>

null if you wish no icon in tab.

Changed:
<
<

  • invalidate, this is event method. It fires right after save method event. Purpose of this method - check saved parameters in WizardComponent and throw ValidationException with detailed mesage of problem, if validate fails.
>
>

  • validate, this is event method. It fires right after save method event. Purpose of this method - check saved parameters in WizardComponent and return false if something wrong, also in this method you can highlight changes.
Changed:
<
<

<wizardry>
  <wizard icon="/org/intellij/wizard/impl/project/resources/icon.png">
    <name>New Project</name>
    <description>Wizard provided only common project settings for basic IDEA project.</description>
    <vendor>Alexey Efimov</vendor>

    <wizard-components start-component="welcome">
      <component
        id="welcome"
        next="project"
        class-name="org.intellij.wizard.impl.standard.components.WelcomeComponent">
        <properties>
          <property name="welcome.title" value="Info"/>
          <property name="welcome.text"><![CDATA[
           <html>
             <p><b>Simple IDEA project Wizard</b></p>
             <p>
               This wizard help you to create simple IDEA project.
             </p>
           </html>
          ]]></property>
        </properties>
      </component>
      <component
        id="project"
        class-name="org.intellij.wizard.impl.standard.components.ProjectComponent" />
    </wizard-components>
<nop>
>
>



Changed:
<
<

>
>

<wizardry> <wizard category="project"> <name>Empty Project</name> <description> Wizard provided only common project settings for basic IDEA project. </description> <vendor>Alexey Efimov</vendor>

<wizard-components start-component="welcome"> <component id="welcome" next="project" class-name="org.intellij.wizard.impl.standard.components.WelcomeComponent"> <properties> <property name="welcome.title" value="Info"/> <property name="welcome.text"><![CDATA[ <html> <p><b>Simple IDEA project Wizard</b></p> <p> This wizard help you to create simple IDEA project with out any modules assigned. After project creation you can attach modules to it. </p> </html> ]]></property> </properties> </component> <component id="project" class-name="org.intellij.wizard.impl.standard.components.ProjectComponent"/> </wizard-components>

<wizard-listeners> <listener class-name="org.intellij.wizard.impl.project.WizardAdapter"/> </wizard-listeners> </wizard> </wizardry>

Changed:
<
<

<!ELEMENT wizardry (wizard*)>
<!ELEMENT wizard (name, description?, vendor?, wizard-components, wizard-listeners)>
<!ATTLIST wizard
    icon CDATA #IMPLIED>
<!ELEMENT name (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT vendor (#PCDATA)>
<!ELEMENT wizard-components (component+)>
<!ATTLIST wizard-components
    start-component CDATA #REQUIRED>
<!ELEMENT component (properties?)>
<!ATTLIST component
<nop>
>
>


<!ELEMENT wizardry (wizard)*> 
<!ELEMENT wizard (name, description?, vendor?, wizard-components, wizard-listeners)> 
<!-- 
Category may be one of follow values: project, module, code 
--> 
<!ATTLIST wizard 
    category CDATA #IMPLIED 
    icon CDATA #IMPLIED> 
<!ELEMENT name (#PCDATA)> 
<!ELEMENT description (#PCDATA)> 
<!ELEMENT vendor (#PCDATA)> 
 
<!ELEMENT wizard-components (component+)> 
<!ATTLIST wizard-components 
    start-component CDATA #REQUIRED> 
<!ELEMENT component (properties?)> 
<!ATTLIST component 
Changed:
<
<

next CDATA #IMPLIED> <!ATTLIST property

>
>

next CDATA #IMPLIED> <!ELEMENT properties (property+)> <!ELEMENT property (#PCDATA)> <!ATTLIST property

Changed:
<
<

value CDATA #IMPLIED> <!ATTLIST listener class-name CDATA #REQUIRED>

>
>

value CDATA #IMPLIED>

<!ELEMENT wizard-listeners (listener+)> <!ELEMENT listener (#PCDATA)> <!ATTLIST listener class-name CDATA #REQUIRED>


 <<O>>  Difference Topic WizardPluginDev (r1.2 - 29 Oct 2003 - AlexeyEfimov)
Added:
>
>

To control init and finish events you must also assign WizardListener to your Wizard.

  • New Window See Class diagram of Wizard core API.
Changed:
<
<

  • finish(Map dataContext), this is event method. It fires sequincely for all WizardComponents in Wizard then user press "Finish" button. Purpose of this method - perform creation task associated with WizardComponent, for example, generate part of project XML file. For enabling routing of WizardComponents, e.q. if more that one WizardComponent work on finish event with one target object, for example with one project IPR file, you can use dataContext parameter.
>
>

WizardListener interface desription

This listener need for performing initializing task of wizard, and also for finish task (then user press button "Finish").

  • init(WizardEvent e), method invoked then Wizard is runned, but before showing Wizard dialog.
  • finish(WizardEvent e),method invoked, then user closed Wizard dialog by pressing on "Finish" button. In this method Wizard must perform all wizardry logic of Wizard, for example generate IPR file and open it.
Changed:
<
<

You can use already created Wizardcomponent in your Wizards

>
>

You can use already created WizardComponent in your Wizards

Changed:
<
<

org.intellij.wizard.components.WelcomeComponent

>
>

org.intellij.wizard.impl.standard.components.WelcomeComponent

Changed:
<
<

next="mainmodule" class-name="org.intellij.wizard.components.WelcomeComponent">

>
>

next="project" class-name="org.intellij.wizard.impl.standard.components.WelcomeComponent">

Changed:
<
<

>
>

Changed:
<
<

Welcome to Sample Wizard!

>
>

Simple IDEA project Wizard

This wizard help you to create simple IDEA project.

Changed:
<
<

org.intellij.wizard.components.MainModuleSettingsComponent

>
>

org.intellij.wizard.impl.standard.components.ProjectComponent

Changed:
<
<

id="mainmodule" class-name="org.intellij.wizard.components.MainModuleSettingsComponent" />

>
>

id="project" class-name="org.intellij.wizard.impl.standard.components.ProjectComponent" />

Changed:
<
<

Welcome Wizard <![CDATA[ Wizards for demonstration ]]>

>
>

New Project Wizard provided only common project settings for basic IDEA project.

Changed:
<
<

next="mainmodule" class-name="org.intellij.wizard.components.WelcomeComponent">

>
>

next="project" class-name="org.intellij.wizard.impl.standard.components.WelcomeComponent">

Changed:
<
<

>
>

Changed:
<
<

Welcome to Sample Wizard!

>
>

Simple IDEA project Wizard

This wizard help you to create simple IDEA project.

Changed:
<
<

id="mainmodule" class-name="org.intellij.wizard.components.MainModuleSettingsComponent" />

>
>

id="project" class-name="org.intellij.wizard.impl.standard.components.ProjectComponent" />

Added:
>
>

Changed:
<
<

>
>

Changed:
<
<

>
>

Added:
>
>

<!ATTLIST listener class-name CDATA #REQUIRED>

Changed:
<
<

-- AlexeyEfimov - 23 Oct 2003

>
>

%META:FILEATTACHMENT{name="wizard-core.png" attr="h" comment="Wizard core Diagram" date="1067423304" path="I:\development\projects\JetBrains\plugins\wizard\wizard-core.png" size="24488" user="AlexeyEfimov" version="1.1"}%


 <<O>>  Difference Topic WizardPluginDev (r1.1 - 23 Oct 2003 - AlexeyEfimov)
Added:
>
>

%META:TOPICINFO{author="AlexeyEfimov" date="1066900140" format="1.0" version="1.1"}% %META:TOPICPARENT{name="WizardPlugin"}%


Development of WizardPlugin

OpenAPI documentation

You can create your own WizardComponents. The Wizard - is set of WizardComponents. In your extension for WizardPlugin you may define one or more Wizards.

WizardComponent interface desription

If you look from Wizard visual side, then implementation of WizardComponent - is one tab (or screen) of Wizard.

You must have implemented follow method:

  • getName, this method return text to be show in Wizard tab title.
  • getIcon, this method return icon of Wizard tab. Return null if you wish no icon in tab.
  • getComponent, this is main root pane of Wizard tab. The visual presentation of WizardComponent.
  • init(Map properties), this is event method. It fires then wizard is runned. Purpose of this method initialize WizardComponent. Additionaly, to this method passed properties from wizardry.xml descriptor, associated with it WizardComponent.
  • save, this is event method. It fires then user change tab (clicking on other tab or using navigation buttons "Back" and "Next") and wizard must perform saving parameters from UI.
  • invalidate, this is event method. It fires right after save method event. Purpose of this method - check saved parameters in WizardComponent and throw ValidationException with detailed mesage of problem, if validate fails.
  • finish(Map dataContext), this is event method. It fires sequincely for all WizardComponents in Wizard then user press "Finish" button. Purpose of this method - perform creation task associated with WizardComponent, for example, generate part of project XML file. For enabling routing of WizardComponents, e.q. if more that one WizardComponent work on finish event with one target object, for example with one project IPR file, you can use dataContext parameter.

Shared standard WizardComponents

You can use already created Wizardcomponent in your Wizards

org.intellij.wizard.components.WelcomeComponent

This is "Welcome" screen component. It have properties:

  • welcome.title, the title of 'welcome' tab
  • wecome.text, the Welcome Message text
Example:
...
<component
 id="welcome"
 next="mainmodule"
 class-name="org.intellij.wizard.components.WelcomeComponent">
 <properties>
   <property name="welcome.title" value="Welcome Title"/>
   <property name="welcome.text"><![CDATA[
     Welcome to Sample Wizard!
   ]]></property>
 </properties>
</component>
...

org.intellij.wizard.components.MainModuleSettingsComponent

tip.gif This component is under development.

This is component of setting properties from "Project Settings->Main Module".

Example:

...
<component
  id="mainmodule"
  class-name="org.intellij.wizard.components.MainModuleSettingsComponent" />
...

Wizardry documenation

To create wizard you must link your components into wizard. For this must used file META-INF/wizardry.xml in one of jar files of your extension, or in classes directory of your extension. This wizard structure look like IDEA plugins structure organization.

Structure of wizardry directories

The plugin have follow folders:

[%PLUGINS_HOME%]
+ [wizard], this is home folder of WizardPlugin
  + [wizardry], this is Wizardry Home folder

The Wizardry Home may have follow structure:

[wizardry]
+ YourWizard-01.jar, Single jar file of your Wizards with META-INF/wizardry.xml within it.
+ *.jar
+ [YourWizard-02], Directory of your Wizards
  + [classes], Classes directory - added to Wizards classpath
  + [lib], Wizards jars directory
    + *.jar, All jars added to class path. In one of them, or in "classes" directory must be META-INF/wizardry.xml file.

Sample of wizardry.xml

<wizardry>
  <wizard>
    <!-- Wizard name -->
    <name>Welcome Wizard</name>
    <!-- Description -->
    <description><![CDATA[
  Wizards for demonstration
    ]]></description>
    <!-- Wizard version -->
    <vendor>Alexey Efimov</vendor>

    <wizard-components start-component="welcome">
      <component
        id="welcome"
        next="mainmodule"
        class-name="org.intellij.wizard.components.WelcomeComponent">
        <properties>
          <property name="welcome.title" value="Welcome Title"/>
          <property name="welcome.text"><![CDATA[
           Welcome to Sample Wizard!
          ]]></property>
        </properties>
      </component>
      <component
        id="mainmodule"
        class-name="org.intellij.wizard.components.MainModuleSettingsComponent" />
    </wizard-components>

  </wizard>
</wizardry>

Document Type Definition

<!ELEMENT wizardry (wizard*)>
<!ELEMENT wizard (name, description?, vendor?, wizard-components)>
<!ATTLIST wizard
    icon CDATA #IMPLIED>
<!ELEMENT name (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT vendor (#PCDATA)>
<!ELEMENT wizard-components (component*)>
<!ATTLIST wizard-components
    start-component CDATA #REQUIRED>
<!ELEMENT component (properties?)>
<!ATTLIST component
    class-name CDATA #REQUIRED
    id ID #REQUIRED
    next CDATA #IMPLIED>
<!ELEMENT properties (property+)>
<!ELEMENT property (#PCDATA)>
<!ATTLIST property
    name CDATA #REQUIRED
    value CDATA #IMPLIED>

-- AlexeyEfimov - 23 Oct 2003


View | Diffs | r1.5 | > | r1.4 | > | r1.3 | More

e d i t a t t a c h r e f - b y d i f f s
Ideas,requests,problems regarding this site? Send feedback.
Copyright @ 2000-2003 by the contribution authors. All material on this collaboration tool is the property of the contributing authors.

Revision r1.1 - 23 Oct 2003 - 09:09 GMT - AlexeyEfimov
Revision r1.5 - 13 Mar 2004 - 17:32 GMT - AlexeyEfimov
Copyright © 2001 by the contributing authors. All material on this collaboration tool is the property of the contributing authors.
Ideas, requests, problems regarding this site? Send feedback.