English 中文(简体)
IzPack 目标板允许选择多个目录吗?
原标题:Does IzPack TargetPanel allow selection of multiple directories?

IzPack 目标板允许一个选择一个目标目录。 但我需要允许用户选择两个( 一个用于应用程序, 一个用于数据) 。 如何做到这一点?

最佳回答

您可以创建一个 UserInputPutPannel , 并从用户那里获得可变路径。 然后您可以在任何您想要的地方使用变量替换。 您需要添加一个 userInputSpec. xml 文件, 并定义您自己的面板( 任意多少次) 。 要获取目录, 请使用 < code@ lt; field type= "dir"... & gt;

示例 userInputSpec.xml 来自我的应用程序。我包括安装器的蒙戈DB, 并用它来获取某些设置 。

<userInput>
    <panel order="0">      
        <createForPack name="MongoDB" />
        <!-- Other settings like port, ip, username, password-->
        <field type="staticText" align="left" txt="Select the catalogue where data will be stored." id="staticText.registry.db.data.text" />
        <field type="dir" align="left" variable="mongo.data.dir">
            <spec txt="Data directory" size="25" set="$INSTALL_PATHdata" mustExist="false" create="true" />
        </field>
    </panel>    
    <panel order="1">
        <!-- definition of a second panel -->
    </panel>
</userInput>

您还需要将 userInputSpec.xml 作为一种资源包含在您的主要安装文件中,并为您在 userInputPec.xml 中定义的每个面板添加一个 UserInputPann 元素。

类似( 在 元素中 ) :

<resources>
    <!-- other resources -->
    <res id="userInputSpec.xml"  src="userInputSpec.xml" />             
</resources>


 <panels>
    <panel classname="HelloPanel"/>             
    <panel classname="InfoPanel"/>
    <panel classname="LicencePanel"/>
    <panel classname="TargetPanel"/>
    <panel classname="TreePacksPanel"/>
    <panel classname="UserInputPanel"/>
    <panel classname="UserInputPanel"/>
    <panel classname="InstallPanel"/>
    <panel classname="ShortcutPanel"/>
    <panel classname="FinishPanel"/>
</panels>

notice the double occurence of I have two panels defined in my userInputSpec

确保您的 UserInputPartners 出现在 InstallPannel 之前,因为您必须在复制文件前从用户处获取变量 。

这只是我应用程序中的一个例子。 请参看官方文件, 以便了解我所使用的元素和属性的含义。 与用户输入相关的功能很多 。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签