infopanel支持多个操作系统

http://comments.gmane.org/gmane.comp.java.izpack.user/3556

>>
>> <resources>
>> <res id="InfoPanel.info.windows" src="windows_readme.txt"/>
>> <res id="InfoPanel.info.linux" src="unix_readme.txt"/>
>> </resources>
>>
>> <panels>
>> <panel classname="InfoPanel" condition="izpack.windowsinstall"
>> id="info.windows" />
>> <panel classname="InfoPanel" condition="izpack.linuxinstall"
>> id="info.linux" />
>> </panels>
>>


Re: [izpack-user] Info Panel Text Customizable Per Platform
Kjell Braden <kb.codehaus@...>
2009-11-05 18:44:56 GMT

Bruce Garrett schrieb:
> Is there a way to permit different text resources to be displayed in the
> Info Panel? I ask because I would like to provide "quick-start"
> instructions for our application in that panel and these are different
> for each platform.
>
> On a hunch I tried this in the resources section, but it doesn't work.
> I'm including it here to give you a sense of what I'm trying to do.
>
> <res id="InfoPanel.info.unix" src="unix_readme.txt"/>
> <res id="InfoPanel.info.windows" src="windows_readme.txt"/>
>
> ---
> Bruce Garrett
> Systems Software Engineer
> The Space Telescope Science Institute
> Baltimore, Maryland. USA
>

Hi,

would creating the panel itself platform-dependent be an acceptable
solution for you?

<resources>
<res id="InfoPanel.info.windows" src="windows_readme.txt"/>
<res id="InfoPanel.info.linux" src="unix_readme.txt"/>
</resources>

<panels>

(Continue reading)


Permalink | Reply |
headersBruce Garrett | 5 Nov 19:59
Re: [izpack-user] Info Panel Text Customizable Per Platform
Bruce Garrett <bgarrett@...>
2009-11-05 18:59:58 GMT


This looks good...thank you. I will try it out now.

-Bruce

Kjell Braden wrote:
Bruce Garrett schrieb:
Is there a way to permit different text resources to be displayed in the Info Panel? I ask because I would like to provide "quick-start" instructions for our application in that panel and these are different for each platform. On a hunch I tried this in the resources section, but it doesn't work. I'm including it here to give you a sense of what I'm trying to do. <res id="InfoPanel.info.unix" src="unix_readme.txt"/> <res id="InfoPanel.info.windows" src="windows_readme.txt"/> --- Bruce Garrett Systems Software Engineer The Space Telescope Science Institute Baltimore, Maryland. USA
Hi, would creating the panel itself platform-dependent be an acceptable solution for you? <resources> <res id="InfoPanel.info.windows" src="windows_readme.txt"/> <res id="InfoPanel.info.linux" src="unix_readme.txt"/> </resources> <panels> <panel classname="InfoPanel" condition="izpack.windowsinstall" id="info.windows" /> <panel classname="InfoPanel" condition="izpack.linuxinstall" id="info.linux" /> </panels> Note that the izpack.unixinstall condition is not pre-defined (but windows and linux is) and therefore would have to be created: <conditions> <condition type="java" id="izpack.unixinstall"> <java><class>com.izforge.izpack.util.OsVersion</class><field>IS_UNIX</field></java> <returnvalue type="boolean">true</returnvalue> </condition> </conditions> HTH -Kjell


Permalink | Reply |
headersBruce Garrett | 5 Nov 21:18
Re: [izpack-user] Info Panel Text Customizable Per Platform
Bruce Garrett <bgarrett@...>
2009-11-05 20:18:04 GMT


Hi,

This seems not to be working. I get an error message in the Info Panel saying that it cannot load the resource:

Error : could not load the info text !

Here's my resource section:

<resources>
<res id="Installer.image" src="hubble.png" />
<res id="Heading.image" src="stgms.png" />
<res id="CustomLangpack.xml_eng" src="CustomLangpack_eng.xml" />
<res id="InfoPanel.info.windows" src="windows_readme.txt" />
<res id="InfoPanel.info.linux" src="unix_readme.txt" />
<res id="InfoPanel.info.unix" src="unix_readme.txt" />
<res id="TargetPanel.dir.unix" src="admin_default_install_dir.txt" />
<res id="TargetPanel.dir.windows" src="admin_default_windows_install_dir.txt" />
<res id="shortcutSpec.xml" src="admin_default_shortcut_spec.xml" />
<res id="Win_shortcutSpec.xml" src="admin_windows_shortcut_specification.xml" />
</resources>

My panels section:

<panels>
<panel classname="HelloPanel" />
<panel classname="TargetPanel" />
<panel classname="SummaryPanel" />
<panel classname="InstallPanel" />
<panel classname="ShortcutPanel" />
<panel classname="InfoPanel" condition="izpack.windowsinstall" id="info.windows" />
<panel classname="InfoPanel" condition="izpack.linuxinstall" id="info.linux" />
<panel classname="InfoPanel" condition="izpack.unixinstall" id="info.unix" />
<panel classname="SimpleFinishPanel" />
</panels>

And the conditions section I added for unix support:

<conditions>
<condition type="java" id="izpack.unixinstall">
<java><class>com.izforge.izpack.util.OsVersion</class><field>IS_UNIX</field></java>
<returnvalue type="boolean">true</returnvalue>
</condition>
</conditions>

These should be, unless I made a spelling mistake I can't find, what you gave me to use. The compiler doesn't complain about any of this. The text files are there in the directory I am compiling from, and when I look inside the finished jar file I can see them and view them. However they're listed in the jar file as:

InfoPanel.info.info.windows
InfoPanel.info.info.linux
InfoPanel.info.info.unix

I've tried experimenting with naming the resources similarly and that does not help. Is there something else I am missing here?

-Bruce

Kjell Braden wrote:
Bruce Garrett schrieb:
Is there a way to permit different text resources to be displayed in the Info Panel? I ask because I would like to provide "quick-start" instructions for our application in that panel and these are different for each platform. On a hunch I tried this in the resources section, but it doesn't work. I'm including it here to give you a sense of what I'm trying to do. <res id="InfoPanel.info.unix" src="unix_readme.txt"/> <res id="InfoPanel.info.windows" src="windows_readme.txt"/> --- Bruce Garrett Systems Software Engineer The Space Telescope Science Institute Baltimore, Maryland. USA
Hi, would creating the panel itself platform-dependent be an acceptable solution for you? <resources> <res id="InfoPanel.info.windows" src="windows_readme.txt"/> <res id="InfoPanel.info.linux" src="unix_readme.txt"/> </resources> <panels> <panel classname="InfoPanel" condition="izpack.windowsinstall" id="info.windows" /> <panel classname="InfoPanel" condition="izpack.linuxinstall" id="info.linux" /> </panels> Note that the izpack.unixinstall condition is not pre-defined (but windows and linux is) and therefore would have to be created: <conditions> <condition type="java" id="izpack.unixinstall"> <java><class>com.izforge.izpack.util.OsVersion</class><field>IS_UNIX</field></java> <returnvalue type="boolean">true</returnvalue> </condition> </conditions> HTH -Kjell


Permalink | Reply |
headersBruce Garrett | 5 Nov 22:29
Re: [izpack-user] Info Panel Text Customizable Per Platform
Bruce Garrett <bgarrett@...>
2009-11-05 21:29:32 GMT

Hi,

I have it working now, but with the HTMLInfoPanel. That panel works
with your suggested code for the InfoPanel just fine. I simply changed
the references from InfoPanel to HTMLInfoPanel and it worked. So I have
my solution.

Thank you for your help.

-Bruce

> Kjell Braden wrote:
>> Bruce Garrett schrieb:
>>
>>> Is there a way to permit different text resources to be displayed in the
>>> Info Panel? I ask because I would like to provide "quick-start"
>>> instructions for our application in that panel and these are different
>>> for each platform.
>>>
>>> On a hunch I tried this in the resources section, but it doesn't work.
>>> I'm including it here to give you a sense of what I'm trying to do.
>>>
>>> <res id="InfoPanel.info.unix" src="unix_readme.txt"/>
>>> <res id="InfoPanel.info.windows" src="windows_readme.txt"/>
>>>
>>> ---
>>> Bruce Garrett
>>> Systems Software Engineer
>>> The Space Telescope Science Institute
>>> Baltimore, Maryland. USA
>>>
>>>
>>
>> Hi,
>>
>> would creating the panel itself platform-dependent be an acceptable
>> solution for you?
>>
>> <resources>
>> <res id="InfoPanel.info.windows" src="windows_readme.txt"/>
>> <res id="InfoPanel.info.linux" src="unix_readme.txt"/>
>> </resources>
>>
>> <panels>
>> <panel classname="InfoPanel" condition="izpack.windowsinstall"
>> id="info.windows" />
>> <panel classname="InfoPanel" condition="izpack.linuxinstall"
>> id="info.linux" />
>> </panels>
>>
>>
>>
>>
>> Note that the izpack.unixinstall condition is not pre-defined (but
>> windows and linux is) and therefore would have to be created:
>>
>> <conditions>
>> <condition type="java" id="izpack.unixinstall">
>>
>> <java><class>com.izforge.izpack.util.OsVersion</class><field>IS_UNIX</field></java>
>> <returnvalue type="boolean">true</returnvalue>
>> </condition>
>> </conditions>
>>
>>
>> HTH
>> -Kjell
>>
>>
>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值