jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • IzPack
  • IZPACK-604

The ability manipulate the Quit button and process Quit events

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Critical Critical
  • Resolution: Unresolved
  • Affects Version/s: 4.3.2, 4.3.3
  • Fix Version/s: 4.3.3, 5.0
  • Component/s: Installer
  • Labels:
    None

Description

Currently Izpack has the following limitations:
a) You cannot hide or disable the Quit button on the InstallerFrame. In our scenario we have optional panels for rollback if anything should fail during installation and we definitively don't want the user to be able to Quit before we can do rollback.
b) The Quit button doesn't allow custom handling of events. If a user chooses yes, I would like to be able to veto his decision and do different processing like displaying a message, or just add some logic to the quit process.

Please give panels access to the quit button and also the ability process the quit events.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Tim Anderson added a comment - 13/Apr/12 6:41 AM

Would an API like the following suffice?
You would have access to the 3 buttons, 'Next', 'Previous' and 'Quit' and be able to register a VetoableEventListener for each to veto the default behaviour of next(), previous() and quit().

public class InstallerFrame  {

     public Navigator getNavigator() { ... }

}

public interface Navigator
{

    /**
     * Returns the button to navigate to the next panel.
     *
     * @return the 'next' button
     */
    JButton getNext();

    /**
     * Registers a listener that may veto navigation to the next panel.
     *
     * @param listener the listener. May be <tt>null</tt>
     */
    void setNextListener(VetoableEventListener listener);

    /**
     * Returns the button to navigate to the previous panel.
     *
     * @return the 'previous' button
     */
    JButton getPrevious();

    /**
     * Registers a listener that may veto navigation to the previous panel.
     *
     * @param listener the listener. May be <tt>null</tt>
     */
    void setPreviousListener(VetoableEventListener listener);

    /**
     * Returns the button to quit installation.
     *
     * @return the 'quit' button
     */
    JButton getQuit();

    /**
     * Registers a listener that may veto quitting installation.
     *
     * @param listener the listener. May be <tt>null</tt>
     */
    void setQuitListener(VetoableEventListener listener);

    /**
     * Navigates to the next panel.
     *
     * @return <tt>true</tt> if the next panel was displayed, or <tt>false</tt> if the last panel is displayed or
     *         navigation is vetoed
     */
    boolean next();

    /**
     * Navigates to the previous panel.
     *
     * @return <tt>true</tt> if the previous panel was displayed, or <tt>false</tt> if the first panel is displayed or
     *         navigation is vetoed
     */
    boolean previous();

    /**
     * Quits installation.
     *
     * @return <tt>true</tt> if installation was quit, or <tt>false</tt> if quit failed was vetoed
     */
    boolean quit();

}

public interface VetoableEventListener extends EventListener
{

    /**
     * Invoked to determine if an event should be vetoed.
     *
     * @param source the source that triggered the event
     * @return <tt>true</tt> if the event should be vetoed, or <tt>false</tt> if it should proceed
     */
    boolean veto(Object source);
}
Show
Tim Anderson added a comment - 13/Apr/12 6:41 AM Would an API like the following suffice? You would have access to the 3 buttons, 'Next', 'Previous' and 'Quit' and be able to register a VetoableEventListener for each to veto the default behaviour of next(), previous() and quit().
public class InstallerFrame  {

     public Navigator getNavigator() { ... }

}

public interface Navigator
{

    /**
     * Returns the button to navigate to the next panel.
     *
     * @return the 'next' button
     */
    JButton getNext();

    /**
     * Registers a listener that may veto navigation to the next panel.
     *
     * @param listener the listener. May be <tt>null</tt>
     */
    void setNextListener(VetoableEventListener listener);

    /**
     * Returns the button to navigate to the previous panel.
     *
     * @return the 'previous' button
     */
    JButton getPrevious();

    /**
     * Registers a listener that may veto navigation to the previous panel.
     *
     * @param listener the listener. May be <tt>null</tt>
     */
    void setPreviousListener(VetoableEventListener listener);

    /**
     * Returns the button to quit installation.
     *
     * @return the 'quit' button
     */
    JButton getQuit();

    /**
     * Registers a listener that may veto quitting installation.
     *
     * @param listener the listener. May be <tt>null</tt>
     */
    void setQuitListener(VetoableEventListener listener);

    /**
     * Navigates to the next panel.
     *
     * @return <tt>true</tt> if the next panel was displayed, or <tt>false</tt> if the last panel is displayed or
     *         navigation is vetoed
     */
    boolean next();

    /**
     * Navigates to the previous panel.
     *
     * @return <tt>true</tt> if the previous panel was displayed, or <tt>false</tt> if the first panel is displayed or
     *         navigation is vetoed
     */
    boolean previous();

    /**
     * Quits installation.
     *
     * @return <tt>true</tt> if installation was quit, or <tt>false</tt> if quit failed was vetoed
     */
    boolean quit();

}

public interface VetoableEventListener extends EventListener
{

    /**
     * Invoked to determine if an event should be vetoed.
     *
     * @param source the source that triggered the event
     * @return <tt>true</tt> if the event should be vetoed, or <tt>false</tt> if it should proceed
     */
    boolean veto(Object source);
}
Hide
Permalink
Alwyn Schoeman added a comment - 13/Apr/12 10:46 AM

It would definitively help in the cases where you want to be able to tell the user he can't quit right now. Obviously this doesn't give the ability to disable or hide the quit button.

Show
Alwyn Schoeman added a comment - 13/Apr/12 10:46 AM It would definitively help in the cases where you want to be able to tell the user he can't quit right now. Obviously this doesn't give the ability to disable or hide the quit button.
Hide
Permalink
Tim Anderson added a comment - 13/Apr/12 4:57 PM

You can via:

navigator.getQuit().setEnabled(false);
navigator.getQuit().setVisible(false);
Show
Tim Anderson added a comment - 13/Apr/12 4:57 PM You can via:
navigator.getQuit().setEnabled(false);
navigator.getQuit().setVisible(false);

People

  • Assignee:
    Tim Anderson
    Reporter:
    Alwyn Schoeman
Vote (1)
Watch (1)

Dates

  • Created:
    17/Aug/10 10:02 AM
    Updated:
    29/Apr/12 8:34 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.