[izpack-users] Simple question about PathInputPanel
Bartz, Klaus
Klaus.Bartz at coi.de
Mon Feb 11 15:33:48 CET 2008
Hi Christopher,
the messages for labels are stored in
%IZ_HOME%\bin\langpacks\installer\<iso3>.xml
or in your custom lang pack file(s).
Create entries using your class name for the keys:
<str id="DataPathPanel.intro" txt="A multi line text."/>
<str id="DataPathPanel.info" txt="The text in the label "/>
<str id="DataPathPanel.empty_target" txt="The text which will be
placed in a message box if target not exists."/>
<str id="DataPathPanel.warn" txt="The text which will be placed in a
message box if target exits."/>
For more see the entries for TargetPanel and PathInputPanel.
For summary add
<str id="DataPathPanel.summaryCaption" txt="Data path path"/>
The headline text put also in the langpack, not the java source.
<str id="DataPathPanel.headline" txt="FUBAR headline"/>
For enabling headline see docu chapter "Modifying the GUI".
.
Cheers
Klaus
-----Original Message-----
From: izpack-users-bounces at lists.berlios.de
[mailto:izpack-users-bounces at lists.berlios.de] On Behalf Of Christopher
D. Jones
Sent: Sunday, February 10, 2008 4:46 PM
To: izpack-users at lists.berlios.de
Subject: [izpack-users] Simple question about PathInputPanel
I have extended the PathInputPanel to make a custom panel to
select a directory needed for my installation.
The problem I am having is I cannot figure out how to set the
label on the panel. The panel shows up but it looks like the default
target install panel.
I am sure I am missing something simple, so any help would be
greatly appreciated.
Here is my Java code:
package com.izforge.izpack.panels;
import javax.swing.JLabel;
import com.izforge.izpack.installer.InstallData;
import com.izforge.izpack.installer.InstallerFrame;
/**
* Input panel for the data path.
*
*/
public class DataPathPanel extends PathInputPanel {
/**
* The constructor.
*
* @param parent The parent window.
* @param idata The installation data.
*/
public DataPathPanel(InstallerFrame parent, InstallData
idata) {
super(parent, idata);
headline = "FUBAR headline";
headLineLabel = new JLabel ("FUBAR headlinelabel");
}
/**
* Indicates whether the panel has been validated or not.
*
* @return Whether the panel has been validated or not.
*/
public boolean isValidated() {
if (!super.isValidated())
return (false);
System.out.println ("isValidated");
String chosenPath = pathSelectionPanel.getPath();
if (chosenPath == null || chosenPath.length() < 1)
return (false);
idata.setVariable("DATA_DIRECTORY", chosenPath);
return (true);
}
/* (non-Javadoc)
* @see com.izforge.izpack.installer.IzPanel#panelActivate()
*/
public void panelActivate() {
super.panelActivate();
// Resolve and set the default for chosenPath
String chosenPath;
// common lines for back steps...
if (idata.getVariable("DATA_DIRECTORY") != null)
chosenPath = idata.getVariable("DATA_DIRECTORY");
else
chosenPath = idata.getInstallPath();
pathSelectionPanel.setPath(chosenPath);
}
/* (non-Javadoc)
* @see
com.coi.tools.install.panels.SummaryPanelClient#getSummaryBody()
*/
public String getSummaryBody() {
return (String) (idata.getVariable("DATA_DIRECTORY"));
}
}
And here is my install file:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<!--
To compile it :
- go in the bin directory where you installed IzPack
- call "compile ../sample/install.xml -b ../sample"
-->
<installation version="1.0">
<!--
The info section.
The meaning of the tags should be natural ...
-->
<info>
<appname>Hello World</appname>
<appversion>0.1 Beta</appversion>
<authors>
<author name="Ink Inc." email="me at ink.com"/>
</authors>
<url>http://www.inkinc.com/</url>
</info>
<!--
The gui preferences indication.
Sets the installer window to 640x480. It will not be
able to change the size.
-->
<guiprefs width="640" height="480" resizable="no"/>
<!--
The locale section.
Asks here to include the English and French langpacks.
-->
<locale>
<langpack iso3="eng"/>
</locale>
<str id="DataPathPanel.intro" txt="For the application
configuration directory, another path can be selected than the project
directory. You can choose the given project directory or select another
one."/>
<str id="DataPathPanel.info" txt="Path of application
configuration directory: "/>
<!--
The panels section.
We indicate here which panels we want to use. The order
will be respected.
-->
<panels>
<panel classname="DataPathPanel"/>
<panel classname="FinishPanel"/>
</panels>
<!--
The packs section.
We specify here our packs.
-->
<packs>
<pack name="Application" required="yes"
preselected="yes">
<description>The application files.</description>
<file src="hello_world/bogus"
targetdir="$INSTALL_PATH"/>
</pack>
<pack name="Documentation" required="no"
preselected="yes">
<description>The documentation</description>
<file src="doc" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
</installation>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.berlios.de/pipermail/izpack-users/attachments/20080211/df712e0d/attachment.html
More information about the izpack-users
mailing list