IzPack

UserPathPanel layout issue

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 4.2.1
  • Fix Version/s: 4.3.0
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    1

Description

There is a lyaout problem in this panel see:

Activity

Hide
Julien Ponge added a comment -

I have added a fix.

Show
Julien Ponge added a comment - I have added a fix.
Hide
Thomas Demande added a comment -

I'm not sure the fix you did fixed the issue.

The 4.2.1 behavior for this panel was creating a JTextField whose size just fit the length of the UserPathPanelVariable (just as shown on this screenshot).

The new behavior seems to create a fixed-size JTextField, will a quite small size.

Looking into the source code, I saw that the code was a sort of mirror of the TargetPanel, especially for this JTextField (stretch value for instance defined in UserPathSelectionPanel), but the result is not the same!

Any idea or workaround possible?

Show
Thomas Demande added a comment - I'm not sure the fix you did fixed the issue. The 4.2.1 behavior for this panel was creating a JTextField whose size just fit the length of the UserPathPanelVariable (just as shown on this screenshot). The new behavior seems to create a fixed-size JTextField, will a quite small size. Looking into the source code, I saw that the code was a sort of mirror of the TargetPanel, especially for this JTextField (stretch value for instance defined in UserPathSelectionPanel), but the result is not the same! Any idea or workaround possible?
Hide
Julien Ponge added a comment -

I realized that the code was basically the same, which makes it tricky to fix. Does 4.3.0 reproduce the same wrong layout?

Show
Julien Ponge added a comment - I realized that the code was basically the same, which makes it tricky to fix. Does 4.3.0 reproduce the same wrong layout?
Hide
Thomas Demande added a comment -

The only difference between using 4.2.1 and 4.3.0 is that the size of the JTextField is fixed in 4.3.0, which is a logical consequence of the change you made.

In 4.2.1, it is as long as the length of the UserPathPanelVariable.

Tested with a dead simple installer configuration:

<?xml version="1.0" encoding="UTF-8" ?>
<installation version="1.0">
    <info>
        <appname>user-path-panel-test</appname>
        <appversion>1</appversion>
        <javaversion>1.5</javaversion>
        <uninstaller write="no" />
    </info>

    <locale>
        <langpack iso3="eng"/>
    </locale>

    <guiprefs width="800" height="600" resizable="yes">
    </guiprefs>

	<packs>
		<pack name="My Application" required="yes">
			<description>My Super Application</description>
			<file src="./resources/brol.xml" override="true" targetdir="$INSTALL_PATH"/>
		</pack>
    </packs>

    <panels>
		<panel classname="HelloPanel" />
		<panel classname="TargetPanel" />
		<panel classname="UserPathPanel" />
		<panel classname="SummaryPanel" />
		<panel classname="InstallPanel" />
		<panel classname="SimpleFinishPanel" />
	</panels>

</installation>

Screenshots

  • No value for{{UserPathPanelVariable}}
    Used 4.2.1
    Used 4.3.0
  • Value for{{UserPathPanelVariable}} set to C:\Program Files\My Application
    Added:
    <variables>
    	<variable name="UserPathPanelVariable" value="C:\Program Files\My Application" />
    </variables>

    Used 4.2.1
    Used 4.3.0

Show
Thomas Demande added a comment - The only difference between using 4.2.1 and 4.3.0 is that the size of the JTextField is fixed in 4.3.0, which is a logical consequence of the change you made. In 4.2.1, it is as long as the length of the UserPathPanelVariable. Tested with a dead simple installer configuration:
<?xml version="1.0" encoding="UTF-8" ?>
<installation version="1.0">
    <info>
        <appname>user-path-panel-test</appname>
        <appversion>1</appversion>
        <javaversion>1.5</javaversion>
        <uninstaller write="no" />
    </info>

    <locale>
        <langpack iso3="eng"/>
    </locale>

    <guiprefs width="800" height="600" resizable="yes">
    </guiprefs>

	<packs>
		<pack name="My Application" required="yes">
			<description>My Super Application</description>
			<file src="./resources/brol.xml" override="true" targetdir="$INSTALL_PATH"/>
		</pack>
    </packs>

    <panels>
		<panel classname="HelloPanel" />
		<panel classname="TargetPanel" />
		<panel classname="UserPathPanel" />
		<panel classname="SummaryPanel" />
		<panel classname="InstallPanel" />
		<panel classname="SimpleFinishPanel" />
	</panels>

</installation>
Screenshots
  • No value for{{UserPathPanelVariable}} Used 4.2.1 Used 4.3.0
  • Value for{{UserPathPanelVariable}} set to C:\Program Files\My Application Added:
    <variables>
    	<variable name="UserPathPanelVariable" value="C:\Program Files\My Application" />
    </variables>
    Used 4.2.1 Used 4.3.0
Hide
Julien Ponge added a comment -

The screenshots are helpful, thanks a lot.

BTW does the text field enlarges when you pad the variable value with lots of trailing spaces?

Show
Julien Ponge added a comment - The screenshots are helpful, thanks a lot. BTW does the text field enlarges when you pad the variable value with lots of trailing spaces?
Hide
Thomas Demande added a comment -

In 4.2.1 yes, not in 4.3.0

Show
Thomas Demande added a comment - In 4.2.1 yes, not in 4.3.0
Hide
Laurian Vostinar added a comment -

A patch for this issue (UserPathPanel to display the same as TargetPanel):

LayoutPatch.txt
### Eclipse Workspace Patch 1.0
#P IzPack
Index: src/lib/com/izforge/izpack/gui/IzPanelLayout.java
===================================================================
--- src/lib/com/izforge/izpack/gui/IzPanelLayout.java	(revision 2811)
+++ src/lib/com/izforge/izpack/gui/IzPanelLayout.java	(working copy)
@@ -22,6 +22,7 @@
 package com.izforge.izpack.gui;
 
 import com.izforge.izpack.panels.PathSelectionPanel;
+import com.izforge.izpack.panels.UserPathSelectionPanel;
 import com.izforge.izpack.util.Log;
 import com.izforge.izpack.util.MultiLineLabel;
 
@@ -224,7 +225,8 @@
             }
             if (PathSelectionPanel.class.isAssignableFrom(clazz)
                     || JCheckBox.class.isAssignableFrom(clazz)
-                    || JRadioButton.class.isAssignableFrom(clazz))
+                    || JRadioButton.class.isAssignableFrom(clazz)
+                    || UserPathSelectionPanel.class.isAssignableFrom(clazz))
             {
                 return (FULL_LINE_CONTROL_CONSTRAINT);
             }
@@ -1151,7 +1153,7 @@
     private boolean needsReEvaluation(Component comp)
     {
         if ((comp instanceof com.izforge.izpack.util.MultiLineLabel)
-                || (comp instanceof com.izforge.izpack.panels.PathSelectionPanel))
+                || (comp instanceof com.izforge.izpack.panels.PathSelectionPanel) || (comp instanceof com.izforge.izpack.panels.UserPathSelectionPanel))
         {
             return (true);
         }
Show
Laurian Vostinar added a comment - A patch for this issue (UserPathPanel to display the same as TargetPanel):
LayoutPatch.txt
### Eclipse Workspace Patch 1.0
#P IzPack
Index: src/lib/com/izforge/izpack/gui/IzPanelLayout.java
===================================================================
--- src/lib/com/izforge/izpack/gui/IzPanelLayout.java	(revision 2811)
+++ src/lib/com/izforge/izpack/gui/IzPanelLayout.java	(working copy)
@@ -22,6 +22,7 @@
 package com.izforge.izpack.gui;
 
 import com.izforge.izpack.panels.PathSelectionPanel;
+import com.izforge.izpack.panels.UserPathSelectionPanel;
 import com.izforge.izpack.util.Log;
 import com.izforge.izpack.util.MultiLineLabel;
 
@@ -224,7 +225,8 @@
             }
             if (PathSelectionPanel.class.isAssignableFrom(clazz)
                     || JCheckBox.class.isAssignableFrom(clazz)
-                    || JRadioButton.class.isAssignableFrom(clazz))
+                    || JRadioButton.class.isAssignableFrom(clazz)
+                    || UserPathSelectionPanel.class.isAssignableFrom(clazz))
             {
                 return (FULL_LINE_CONTROL_CONSTRAINT);
             }
@@ -1151,7 +1153,7 @@
     private boolean needsReEvaluation(Component comp)
     {
         if ((comp instanceof com.izforge.izpack.util.MultiLineLabel)
-                || (comp instanceof com.izforge.izpack.panels.PathSelectionPanel))
+                || (comp instanceof com.izforge.izpack.panels.PathSelectionPanel) || (comp instanceof com.izforge.izpack.panels.UserPathSelectionPanel))
         {
             return (true);
         }
Hide
Thomas Demande added a comment -

This patch indeed fixes the issue!

(If possible, please apply it to 4.0+ branches...).

Show
Thomas Demande added a comment - This patch indeed fixes the issue! (If possible, please apply it to 4.0+ branches...).
Hide
Laurian Vostinar added a comment -

Unfortunately I made a mistake, this patch introduces a dependency of IzPanelLayout to UserPathSelectionPanel; this breaks the installer if no UserPathSelectionPanel is present. Maybe will look for another fix if I have time later.

Show
Laurian Vostinar added a comment - Unfortunately I made a mistake, this patch introduces a dependency of IzPanelLayout to UserPathSelectionPanel; this breaks the installer if no UserPathSelectionPanel is present. Maybe will look for another fix if I have time later.
Hide
Julien Ponge added a comment -

Thanks for letting us know, and I'm looking forward to another patch.

Show
Julien Ponge added a comment - Thanks for letting us know, and I'm looking forward to another patch.
Hide
Laurian Vostinar added a comment -

I maybe another patch:

LayoutPatch.txt
### Eclipse Workspace Patch 1.0
#P IzPack
Index: src/lib/com/izforge/izpack/gui/IzPanelLayout.java
===================================================================
--- src/lib/com/izforge/izpack/gui/IzPanelLayout.java	(revision 2811)
+++ src/lib/com/izforge/izpack/gui/IzPanelLayout.java	(working copy)
@@ -38,6 +38,7 @@
 public class IzPanelLayout implements LayoutManager, LayoutManager2, LayoutConstants
 {
 
+    private static final String USER_PATH_SELECTION_PANEL_CLASS = "com.izforge.izpack.panels.UserPathSelectionPanel";
     /**
      * holds all the components and layout constraints.
      */
@@ -224,7 +225,8 @@
             }
             if (PathSelectionPanel.class.isAssignableFrom(clazz)
                     || JCheckBox.class.isAssignableFrom(clazz)
-                    || JRadioButton.class.isAssignableFrom(clazz))
+                    || JRadioButton.class.isAssignableFrom(clazz)
+                    || USER_PATH_SELECTION_PANEL_CLASS.equals(clazz.getName()))
             {
                 return (FULL_LINE_CONTROL_CONSTRAINT);
             }
@@ -1151,7 +1153,8 @@
     private boolean needsReEvaluation(Component comp)
     {
         if ((comp instanceof com.izforge.izpack.util.MultiLineLabel)
-                || (comp instanceof com.izforge.izpack.panels.PathSelectionPanel))
+                || (comp instanceof com.izforge.izpack.panels.PathSelectionPanel) 
+                || USER_PATH_SELECTION_PANEL_CLASS.equals(comp.getClass().getName()))
         {
             return (true);
         }
Show
Laurian Vostinar added a comment - I maybe another patch:
LayoutPatch.txt
### Eclipse Workspace Patch 1.0
#P IzPack
Index: src/lib/com/izforge/izpack/gui/IzPanelLayout.java
===================================================================
--- src/lib/com/izforge/izpack/gui/IzPanelLayout.java	(revision 2811)
+++ src/lib/com/izforge/izpack/gui/IzPanelLayout.java	(working copy)
@@ -38,6 +38,7 @@
 public class IzPanelLayout implements LayoutManager, LayoutManager2, LayoutConstants
 {
 
+    private static final String USER_PATH_SELECTION_PANEL_CLASS = "com.izforge.izpack.panels.UserPathSelectionPanel";
     /**
      * holds all the components and layout constraints.
      */
@@ -224,7 +225,8 @@
             }
             if (PathSelectionPanel.class.isAssignableFrom(clazz)
                     || JCheckBox.class.isAssignableFrom(clazz)
-                    || JRadioButton.class.isAssignableFrom(clazz))
+                    || JRadioButton.class.isAssignableFrom(clazz)
+                    || USER_PATH_SELECTION_PANEL_CLASS.equals(clazz.getName()))
             {
                 return (FULL_LINE_CONTROL_CONSTRAINT);
             }
@@ -1151,7 +1153,8 @@
     private boolean needsReEvaluation(Component comp)
     {
         if ((comp instanceof com.izforge.izpack.util.MultiLineLabel)
-                || (comp instanceof com.izforge.izpack.panels.PathSelectionPanel))
+                || (comp instanceof com.izforge.izpack.panels.PathSelectionPanel) 
+                || USER_PATH_SELECTION_PANEL_CLASS.equals(comp.getClass().getName()))
         {
             return (true);
         }
Hide
Paul Rosen added a comment -

Hi,

This one appears to have a good patch suggested by Laurian on 21 July 09 (it works fine for me), but it has not yet been applied to the latest version of Izpack (I have recently downloaded and am using version 4.3.3). Would it be possible for this patch to be applied to the next released version of Izpack?

Thanks
Paul

Show
Paul Rosen added a comment - Hi, This one appears to have a good patch suggested by Laurian on 21 July 09 (it works fine for me), but it has not yet been applied to the latest version of Izpack (I have recently downloaded and am using version 4.3.3). Would it be possible for this patch to be applied to the next released version of Izpack? Thanks Paul
Hide
Julien Ponge added a comment -

Could you please check against v5?

Show
Julien Ponge added a comment - Could you please check against v5?

People

Vote (0)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: