IzPack

Considering conditions in resources

Details

  • Type: Wish Wish
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 5.0
  • Component/s: Installer
  • Labels:
    None
  • Number of attachments :
    4

Description

Hello

I want to built an installer for two different brands. Therefore I need different images on the panels, i.e "Heading.image" or "Installer.image"
I managed to do this on the panels by registering a GUIListener at installerFrame and adjusting the images when switching panel.
But now I have two problems:
a) The explained way is not really nice
b) This is the point: I cannot use different images on LanguageDialog!

Wouldn't it be nice to have the possibility of using conditions for resources? This would solve both of my problems.

i.e.:
...
<res id="installer.langsel.img" src="langsel_Brand1.png" condition="is.Brand1"/>
<res id="installer.langsel.img" src="langsel_Brand2.png" condition="is.Brand2"/>

<res id="Heading.image" src="heading_Brand1.png" condition="is.Brand1"/>
<res id="Heading.image" src="heading_Brand2.png" condition="is.Brand2"/>
...

Thank you in advance for your answer.

  1. IzPack_ResourceBundle_DokuPatch.txt
    09/Feb/10 7:39 AM
    2 kB
    Patrick Zbinden
  2. IzPack_ResourceBundle_Patch.txt
    18/Feb/10 12:44 AM
    200 kB
    Patrick Zbinden
  3. IzPack_ResourceBundle_Patch.txt
    01/Feb/10 1:04 AM
    199 kB
    Patrick Zbinden
  4. IZPACK-453-jponge.diff
    18/Feb/10 3:03 AM
    28 kB
    Julien Ponge

Activity

Hide
Patrick Zbinden added a comment -

Hello again

I have a different suggestion to solve my wish.
How about introducing a "resource bundle"?
We should have the possibility to define bundles of resources. BundleName should be set by SystemProperty and in defining a default in install.xml.

ResourceManager should then look for the asked resource in the following order:
/res/<bundleName>/<resourceName>_<iso3>
/res/<bundleName>/<resourceName>
/res/<resourceName>_<iso3>
/res/<resourceName>
ResourceManager should then already be used for the LanguageDialog and also for JFrameIcon in InstallerFrame.

i.e.
<resources>
<!-- bundle 1 -->
<bundle id="bundle1" default="yes">
<res id="Heading.image" src="path1/HeadingImage.png" />
<res id="installer.langsel.img" src="path1/langselImage.png" />
</bundle>
<!-- bundle 2 -->
<bundle id="bundle2">
<res id="Heading.image" src="path2/HeadingImage.png" />
<res id="installer.langsel.img" src="path2/langselImage.png" />
</bundle>
<!-- common resources -->
<res id="resource.id" src="path.to.resource" />
...
</resources>

Thank you in advance

Show
Patrick Zbinden added a comment - Hello again I have a different suggestion to solve my wish. How about introducing a "resource bundle"? We should have the possibility to define bundles of resources. BundleName should be set by SystemProperty and in defining a default in install.xml. ResourceManager should then look for the asked resource in the following order: /res/<bundleName>/<resourceName>_<iso3> /res/<bundleName>/<resourceName> /res/<resourceName>_<iso3> /res/<resourceName> ResourceManager should then already be used for the LanguageDialog and also for JFrameIcon in InstallerFrame. i.e. <resources> <!-- bundle 1 --> <bundle id="bundle1" default="yes"> <res id="Heading.image" src="path1/HeadingImage.png" /> <res id="installer.langsel.img" src="path1/langselImage.png" /> </bundle> <!-- bundle 2 --> <bundle id="bundle2"> <res id="Heading.image" src="path2/HeadingImage.png" /> <res id="installer.langsel.img" src="path2/langselImage.png" /> </bundle> <!-- common resources --> <res id="resource.id" src="path.to.resource" /> ... </resources> Thank you in advance
Hide
Patrick Zbinden added a comment -

Hello

Attached a patch to realize the "resource bundle".
Behaviour as described.

If the patch will be applied, I can also send you the patch for documentation.

Regards
Patrick

Show
Patrick Zbinden added a comment - Hello Attached a patch to realize the "resource bundle". Behaviour as described. If the patch will be applied, I can also send you the patch for documentation. Regards Patrick
Hide
Patrick Zbinden added a comment -

Patch for documentation

Show
Patrick Zbinden added a comment - Patch for documentation
Hide
Julien Ponge added a comment -

Hi Patrick;

I could not apply the patch. Could you please update it?

Thanks a lot

Show
Julien Ponge added a comment - Hi Patrick; I could not apply the patch. Could you please update it? Thanks a lot
Hide
Patrick Zbinden added a comment -

Hi Julien

Here's the patch including documentation. Replaces all patches before.
Hope it works now.

Patrick

Show
Patrick Zbinden added a comment - Hi Julien Here's the patch including documentation. Replaces all patches before. Hope it works now. Patrick
Hide
Julien Ponge added a comment -

I have adapted from your patch. Here is my proposal. Can you please confirm that it functionally matches yours?

Thanks Patrick

Show
Julien Ponge added a comment - I have adapted from your patch. Here is my proposal. Can you please confirm that it functionally matches yours? Thanks Patrick
Hide
Patrick Zbinden added a comment -

Looks ok to me.

Regards
Patrick

Show
Patrick Zbinden added a comment - Looks ok to me. Regards Patrick
Hide
Julien Ponge added a comment -

My adaptations had issues, so I went back to your patch.

Thanks!

Show
Julien Ponge added a comment - My adaptations had issues, so I went back to your patch. Thanks!
Hide
Julien Ponge added a comment -

Yes, see my last commit (this is a Java6-only method).

Show
Julien Ponge added a comment - Yes, see my last commit (this is a Java6-only method).

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: