[izpack-users] Help text for the userInputPanel Fields

Bartz, Klaus Klaus.Bartz at coi.de
Fri Jun 15 09:13:28 CEST 2007


Hi Mandeep,
some installer tools (e.g. MSI) means that a separated help will
be not state of the art...
But you can add tool tips to your components (buttons etc.), 
if you write custom panels. And you can also add your own button 
into the navigation panel of IzPack.

How to add a button into the navigation panel:
you can implement a hidden IzPanel which implements the interface
GUIListener and ActionListener. Place it at first panel. 
Call parent.addGuiListener(this) in the constructor.
Create the help button in guiActionPerformed if the flag is GUI_BUILDED.
Add the button to the given navigation panel.
Do not forget to add "this" as ActionListener of the help button.
Do your help work in actionPerformed.

Cheers 

Klaus



public class HelpFeaturePanel extends IzPanel implements GUIListener,
ActionListener
{
    // Other class specific variables.
    /** The help button. */
    protected JButton helpButton;

    /**
     * The constructor.
     * 
     * @param parent The parent IzPack installer frame.
     * @param idata The installer internal data.
     */
    public HelpFeaturePanel(InstallerFrame parent, InstallData idata)
    {
        super(parent, idata);
        setHidden(true);
        parent.addGuiListener(this);

    }

    /** Called when the panel becomes active. */
    public void panelActivate()
    {
        parent.skipPanel();
    }

    /*
     * (non-Javadoc)
     * 
     * @see
com.izforge.izpack.installer.GUIListener#guiActionPerformed(int,
java.lang.Object)
     */
    public void guiActionPerformed(int what, Object param)
    {
        if (what == GUI_BUILDED)
        {
            JPanel navPanel = (JPanel) param;
            helpButton =
ButtonFactory.createButton(parent.langpack.getString("installer.help"),
                    parent.icons.getImageIcon("help"),
idata.buttonsHColor);
            navPanel.add(helpButton, 0);
            helpButton.addActionListener(this);
        }

    }

    /*
     * (non-Javadoc)
     * 
     * @see
java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent
)
     */
    public void actionPerformed(ActionEvent e)
    {
        // Your help implementation.
    }
}

> -----Original Message-----
> From: izpack-users-bounces at lists.berlios.de 
> [mailto:izpack-users-bounces at lists.berlios.de] On Behalf Of 
> Mandeep Saini
> Sent: Thursday, June 14, 2007 7:02 PM
> To: izpack-users at lists.berlios.de
> Subject: [izpack-users] Help text for the userInputPanel Fields
> 
> 
> Hi all,
> 
> Is there any way to give help text for user Input Panel 
> fields, may be 
> by using a button or by tool tip on mouse over? Or I have to write my 
> own code to do this?
> 
> If right now this functionality is not available then are there any 
> plans for such feature in the future?
> 
> Regards
> Mandeep
> 
> -- 
> ______________________________________________________________________
> 
> Mandeep Saini	
> System Engineer
> 
> DANTE - www.dante.net
> 
> Tel: +44 (0) 1223 371 300 (Ext. 349)
> Fax: +44 (0) 1223 371 371
> 
> City House, 126-130 Hills Road
> Cambridge CB2 1PQ
> UK 
> _____________________________________________________________________
> 
> _______________________________________________
> izpack-users mailing list
> izpack-users at lists.berlios.de 
> https://lists.berlios.de/mailman/listinfo/izpack-users
> 



More information about the izpack-users mailing list