When I debug, I just see that these non-visible skipPanel() Panels are
just added to the stack via the skipPanel() -> switchPanel() methods,
whereas visible Panels go through the navigateNext() flow.
Thanks,
Grant
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
You should use the debugger (http://blog.reil-online.de/2007/12/how-to-debug-variables-and-conditions.html) to determine if your variable is set correctly and if the condition is evaluated to true if the variable changes.
Regards,
Dennis
-----Ursprüngliche Nachricht-----
Von: Grant Ingersoll [mailto:gsin...@apache.org]
Gesendet: Montag, 21. April 2008 23:58
An: us...@izpack.codehaus.org
Betreff: [izpack-user] skipPanel() and conditions
When the code hits the logging debug (Line 827 of InstallerFrame)
statements in the code, the conditions are evaluated and they show the
condition as false, yet the panels are still being executed. I don't
see that canShow() is in the skipPanel execution path (all skipPanel()
really does is call showPanel()) in the code, only in the
navigateNext() and navigatePrevious().
I am calling skipPanel() per the instructions in the user guide at the
end of my panelActivate() method.
I also don't see a debugger window like your blog suggests. I am on
3.11 using the standalone compiler on a Mac and have -DTRACE=true set
(I do see logging info on the console).
Thanks,
Grant
--------------------------
Grant Ingersoll
Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ
-----Ursprüngliche Nachricht-----
Von: Grant Ingersoll [mailto:gsin...@apache.org]
Gesendet: Dienstag, 22. April 2008 13:31
An: us...@izpack.codehaus.org
Betreff: Re: AW: [izpack-user] skipPanel() and conditions
If skipPanel is called, it will call navigatePrevious or navigateNext which will then call hasNavigateNext or hasNavigatePrevious.
These functions will call canShow..
So it definitely is in the execution path.
Regards,
Dennis
-----Ursprüngliche Nachricht-----
Von: Grant Ingersoll [mailto:gsin...@apache.org]
Gesendet: Dienstag, 22. April 2008 13:31
An: us...@izpack.codehaus.org
Betreff: Re: AW: [izpack-user] skipPanel() and conditions
Thanks for the response, Dennis.
In InstallerFrame, my skipPanel() looks like:
public void skipPanel()
{
if (installdata.curPanelNumber < installdata.panels.size() - 1)
{
if (isBack)
{
installdata.curPanelNumber--;
switchPanel(installdata.curPanelNumber + 1);
}
else
{
installdata.curPanelNumber++;
switchPanel(installdata.curPanelNumber - 1);
}
}
}
Is there somewhere else I should be looking?
and switchPanel() looks like:
protected void switchPanel(int last)
{
// refresh dynamic variables every time, a panel switch is done
refreshDynamicVariables();
try
{
if (installdata.curPanelNumber < last)
{
isBack = true;
}
panelsContainer.setVisible(false);
IzPanel panel = (IzPanel)
installdata.panels.get(installdata.curPanelNumber);
IzPanel l_panel = (IzPanel) installdata.panels.get(last);
if (Debug.isTRACE()) {
debugger.switchPanel(panel.getMetadata(),l_panel.getMetadata());
}
Log.getInstance().addDebugMessage(
"InstallerFrame.switchPanel: try switching panel
from {0} to {1} ({2} to {3})",
new String[] { l_panel.getClass().getName(),
panel.getClass().getName(),
Integer.toString(last),
Integer.toString(installdata.curPanelNumber)},
DebugConstants.PANEL_TRACE, null);
// instead of writing data here which leads to duplicated
entries in
// auto-installation script (bug # 4551), let's make data
only immediately before
// writing out that script.
//
l_panel.makeXMLData(installdata.xmlData.getChildAtIndex(last));
// No previos button in the first visible panel
if (((Integer)
visiblePanelMapping.get(installdata.curPanelNumber)).intValue() == 0)
{
prevButton.setVisible(false);
lockPrevButton();
unlockNextButton(); // if we push the button back at
the license
// panel
}
// Only the exit button in the last panel.
else if (((Integer)
visiblePanelMapping.get(installdata.panels.size())).intValue() ==
installdata.curPanelNumber)
{
prevButton.setVisible(false);
nextButton.setVisible(false);
lockNextButton();
}
else
{
prevButton.setVisible(true);
nextButton.setVisible(true);
unlockPrevButton();
unlockNextButton();
}
// With VM version >= 1.5 setting default button one time
will not work.
// Therefore we set it every panel switch and that also
later. But in
// the moment it seems so that the quit button will not
used as default button.
// No idea why... (Klaus Bartz, 06.09.25)
SwingUtilities.invokeLater(new Runnable() {
public void run()
{
JButton cdb = null;
String buttonName = "next";
if (nextButton.isEnabled()) {
cdb = nextButton;
quitButton.setDefaultCapable(false);
prevButton.setDefaultCapable(false);
nextButton.setDefaultCapable(true);
} else if (quitButton.isEnabled()) {
cdb = quitButton;
buttonName = "quit";
quitButton.setDefaultCapable(true);
prevButton.setDefaultCapable(false);
nextButton.setDefaultCapable(false);
}
getRootPane().setDefaultButton(cdb);
Log.getInstance().addDebugMessage("InstallerFrame.switchPanel: setting
{0} as default button",
new String[] { buttonName },
DebugConstants.PANEL_TRACE,
null);
}
});
// Change panels container to the current one.
panelsContainer.remove(l_panel);
l_panel.panelDeactivate();
panelsContainer.add(panel);
if (panel.getInitialFocus() != null)
{ // Initial focus hint should be performed after current
panel
// was added to the panels container, else the focus
hint will
// be ignored.
// Give a hint for the initial focus to the system.
final Component inFoc = panel.getInitialFocus();
if (JAVA_SPECIFICATION_VERSION < 1.35)
{
inFoc.requestFocus();
}
else
{ // On java VM version >= 1.5 it works only if
// invoke later will be used.
SwingUtilities.invokeLater(new Runnable() {
public void run()
{
inFoc.requestFocusInWindow();
}
});
}
/*
* On editable text components position the caret to
the end of the cust existent
* text.
*/
if (inFoc instanceof JTextComponent)
{
JTextComponent inText = (JTextComponent) inFoc;
if (inText.isEditable() && inText.getDocument() !
= null)
{
inText.setCaretPosition(inText.getDocument().getLength());
}
}
}
performHeading(panel);
performHeadingCounter(panel);
panel.panelActivate();
panelsContainer.setVisible(true);
Panel metadata = panel.getMetadata();
if ((metadata != null) &&
(!"UNKNOWN".equals(metadata.getPanelid())))
{
loadAndShowImage(((Integer)
visiblePanelMapping.get(installdata.curPanelNumber))
.intValue(), metadata.getPanelid());
}
else
{
loadAndShowImage(((Integer)
visiblePanelMapping.get(installdata.curPanelNumber))
.intValue());
}
isBack = false;
callGUIListener(GUIListener.PANEL_SWITCHED);
Log.getInstance().addDebugMessage("InstallerFrame.switchPanel:
switched", null,
DebugConstants.PANEL_TRACE, null);
}
catch (Exception err)
{
err.printStackTrace();
public void skipPanel()
{
if (installdata.curPanelNumber < installdata.panels.size() - 1)
{
if (isBack)
{
navigatePrevious(installdata.curPanelNumber);
}
else
{
navigateNext(installdata.curPanelNumber, false);
}
}
}
This was integrated by IzPack-16.
-----Ursprüngliche Nachricht-----
Von: Grant Ingersoll [mailto:gsin...@apache.org]
Gesendet: Dienstag, 22. April 2008 14:04
An: us...@izpack.codehaus.org
Betreff: Re: AW: AW: [izpack-user] skipPanel() and conditions
I can live with the bug for now, it just prevents me from doing some
error handling in certain conditions.
Here's the roadmap:
http://jira.codehaus.org/browse/IZPACK?report=com.atlassian.jira.plugin.system.project:roadmap-panel
I am using the latest (trunk) for 8 installers that have conditions,
hidden panels, etc. and I'm not having any issues right now. Yesterday
I replaced my 3.11.0 version with patches with the trunk and rebuild all
8 installers and they worked the same as my 3.11.0 with patches so I
think the two are equivalent now.
I think the trunk version is more stable than the 3.11.0 so I would not
hesitate to build it myself and use it.