Statistics
| Revision:

root / trunk / install / IzPack / doc / izpack / html / node7.html @ 11445

History | View | Annotate | Download (7.71 KB)

1 5819 cesar
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<!--Converted with LaTeX2HTML 2002-2-1 (1.70)
4
original version by:  Nikos Drakos, CBLU, University of Leeds
5
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
6
* with significant contributions from:
7
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
8
<HTML>
9
<HEAD>
10
<TITLE>Creating Your Own Panels</TITLE>
11
<META NAME="description" CONTENT="Creating Your Own Panels">
12
<META NAME="keywords" CONTENT="izpack-doc">
13
<META NAME="resource-type" CONTENT="document">
14
<META NAME="distribution" CONTENT="global">
15
16
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
17
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
18
19
<LINK REL="STYLESHEET" HREF="izpack-doc.css">
20
21
<LINK REL="next" HREF="node8.html">
22
<LINK REL="previous" HREF="node6.html">
23
<LINK REL="up" HREF="izpack-doc.html">
24
<LINK REL="next" HREF="node8.html">
25
</HEAD>
26
27
<BODY >
28
29
<DIV CLASS="navigation"><!--Navigation Panel-->
30
<A NAME="tex2html461"
31
  HREF="node8.html">
32
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
33
<A NAME="tex2html457"
34
  HREF="izpack-doc.html">
35
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
36
<A NAME="tex2html451"
37
  HREF="node6.html">
38
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
39
<A NAME="tex2html459"
40
  HREF="node1.html">
41
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
42
<BR>
43
<B> Next:</B> <A NAME="tex2html462"
44
  HREF="node8.html">User Input</A>
45
<B> Up:</B> <A NAME="tex2html458"
46
  HREF="izpack-doc.html">izpack-doc</A>
47
<B> Previous:</B> <A NAME="tex2html452"
48
  HREF="node6.html">Desktop Shortcuts</A>
49
 &nbsp; <B>  <A NAME="tex2html460"
50
  HREF="node1.html">Contents</A></B>
51
<BR>
52
<BR></DIV>
53
<!--End of Navigation Panel-->
54
<!--Table of Child-Links-->
55
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
56
57
<UL CLASS="ChildLinks">
58
<LI><A NAME="tex2html463"
59
  HREF="node7.html#SECTION00710000000000000000">How It Works</A>
60
<UL>
61
<LI><A NAME="tex2html464"
62
  HREF="node7.html#SECTION00711000000000000000">What You Need</A>
63
<LI><A NAME="tex2html465"
64
  HREF="node7.html#SECTION00712000000000000000">What You Have To Do</A>
65
</UL>
66
<BR>
67
<LI><A NAME="tex2html466"
68
  HREF="node7.html#SECTION00720000000000000000">The <TT>IzPanel</TT> Class</A>
69
<UL>
70
<LI><A NAME="tex2html467"
71
  HREF="node7.html#SECTION00721000000000000000">UML Diagram</A>
72
<LI><A NAME="tex2html468"
73
  HREF="node7.html#SECTION00722000000000000000">Description</A>
74
</UL></UL>
75
<!--End of Table of Child-Links-->
76
<HR>
77
78
<H1><A NAME="SECTION00700000000000000000">
79
Creating Your Own Panels</A>
80
</H1>
81
82
<P>
83
84
<H1><A NAME="SECTION00710000000000000000">
85
How It Works</A>
86
</H1>
87
88
<P>
89
90
<H2><A NAME="SECTION00711000000000000000">
91
What You Need</A>
92
</H2>
93
94
<P>
95
First you have to read the NanoXML documentation if you need to use XML
96
in your panel. Secondly, it is necessary that you use the
97
Javadoc-generated class references. We will just explain here briefly
98
how to start making your panels.
99
<BR>
100
<P>
101
It is a good idea to read the source code of some IzPack panels. They
102
are usually <SPAN  CLASS="textsl">very</SPAN> small, which makes it easier to understand how
103
to write your own.
104
<BR>
105
<P>
106
107
<H2><A NAME="SECTION00712000000000000000">
108
What You Have To Do</A>
109
</H2>
110
111
<P>
112
Extending I<SMALL>Z</SMALL>P<SMALL>ACK</SMALL> with a panel is quite simple. A panel used with
113
I<SMALL>Z</SMALL>P<SMALL>ACK</SMALL> must be a subclass of <TT>IzPanel</TT>. The <TT>IzPanel</TT>
114
class is located in the <TT>com.izforge.izpack.installer</TT> package
115
but your panels need to belong to <TT>com.izforge.izpack.panels</TT>.
116
<BR>
117
<P>
118
Things will get a good deal easier if you build IzPack with Jakarta Ant.
119
Simply add your class in the source tree and add the And directives to
120
build your own panels. In this way you'll be able to focus on your code
121
:-)
122
<BR>
123
<P>
124
125
<H1><A NAME="SECTION00720000000000000000">
126
The <TT>IzPanel</TT> Class</A>
127
</H1>
128
129
<P>
130
131
<H2><A NAME="SECTION00721000000000000000">
132
UML Diagram</A>
133
</H2>
134
135
<P>
136
<DIV ALIGN="CENTER">
137
<!-- MATH
138
 $\fbox{\includegraphics[scale=0.5]{img/ch5-izpanel}}$
139
 -->
140
<SPAN CLASS="MATH"><IMG
141
 WIDTH="573" HEIGHT="555" ALIGN="MIDDLE" BORDER="0"
142
 SRC="img6.png"
143
 ALT="\fbox{\includegraphics[scale=0.5]{img/ch5-izpanel}}"></SPAN>
144
</DIV>
145
<P>
146
147
<H2><A NAME="SECTION00722000000000000000">
148
Description</A>
149
</H2>
150
151
<P>
152
The data members are : the install data (refer to the <TT>InstallData</TT>
153
Javadoc reference) and a reference to the parent installer frame.
154
Additional there are the initialFocus Component and some members for
155
handling the grid bag constraint.
156
<BR>
157
<P>
158
The methods have the following functionality :
159
<BR>
160
<UL>
161
<LI><SPAN  CLASS="textit">(constructor)</SPAN> : called just after the language
162
  selection dialog. All the panels are constructed at this time and then
163
  the installer is shown. So be aware of the fact that the installer
164
  window is <SPAN  CLASS="textbf">not</SPAN> yet visible when the panel is created. If you
165
  need to do some work when the window is created, it is in most cases
166
  better do it in <TT>panelActivate</TT>.
167
<BR>
168
<P>
169
</LI>
170
<LI><TT>isValidated</TT> returns <TT>true</TT> if the user is
171
  allowed to go a step further in the installation process. Returning
172
  <TT>false</TT> will lock it. For instance the LicencePanel returns
173
  <TT>true</TT> only if the user has agreed with the license agreement.
174
  The default is to return <TT>true</TT>.
175
<BR>
176
<P>
177
</LI>
178
<LI><TT>panelActivate</TT> is called when the panel becomes active.
179
  This is the best place for most initialization tasks. The default is
180
  to do nothing.
181
<BR>
182
<P>
183
</LI>
184
<LI><TT>makeXMLData</TT> is called to build the automated installer
185
  data. The default is to do nothing. <TT>panelRoot</TT> refers to the
186
  node in the XML tree where you can save your data. Each panel is given
187
  a node. You can organize it as you want with the markups you want
188
  starting from <TT>panelRoot</TT>. It's that simple.
189
<BR>
190
<P>
191
</LI>
192
<LI><TT>runAutomated</TT> is called by an automated-mode
193
  installation. Each panel is called and can do its job by picking the
194
  data collected during a previous installation as saved in
195
  <TT>panelRoot</TT> by <TT>makeXMLData</TT>.
196
<BR>
197
<P>
198
</LI>
199
<LI><TT>setInitialFocus</TT> with this method it is possible to set
200
  a hint which component should be get the focus at activation of the
201
  panel. It is only a hint. Not all components are supported. For more
202
  information see java.awt.Component.requestFocusInWindow or
203
  java.awt.Component.requestFocus if the VM version is less than 1.4.
204
<BR>
205
<P>
206
</LI>
207
<LI><TT>getInitialFocus</TT> returns the component which should be get the
208
  focos at activation of the panel. If no component was set, null returns.
209
<BR>
210
<P>
211
</LI>
212
</UL> Additional there are some helper methods to simplify grid bag layout handling
213
and creation of some common used components.
214
215
<P>
216
217
<DIV CLASS="navigation"><HR>
218
<!--Navigation Panel-->
219
<A NAME="tex2html461"
220
  HREF="node8.html">
221
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
222
<A NAME="tex2html457"
223
  HREF="izpack-doc.html">
224
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
225
<A NAME="tex2html451"
226
  HREF="node6.html">
227
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
228
<A NAME="tex2html459"
229
  HREF="node1.html">
230
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
231
<BR>
232
<B> Next:</B> <A NAME="tex2html462"
233
  HREF="node8.html">User Input</A>
234
<B> Up:</B> <A NAME="tex2html458"
235
  HREF="izpack-doc.html">izpack-doc</A>
236
<B> Previous:</B> <A NAME="tex2html452"
237
  HREF="node6.html">Desktop Shortcuts</A>
238
 &nbsp; <B>  <A NAME="tex2html460"
239
  HREF="node1.html">Contents</A></B> </DIV>
240
<!--End of Navigation Panel-->
241
<ADDRESS>
242
Julien Ponge
243
2005-04-22
244
</ADDRESS>
245
</BODY>
246
</HTML>