ciplogic.com
Live with grace. Write superb software.

Do you remember that there was a time in Windows when all the UIs used to have the three magic buttons: 'Ok', 'Apply' and 'Cancel'?

  • Ok would apply the settings, and close the dialog,
  • Apply would apply the settings, and leave the dialog open and
  • Cancel would close the dialog.

My brother used to tell me, man, it's easy to implement this, since 'Ok' becomes only:

1
2
3
4
    public void onOkClicked() {
    	this.onApplyClicked();
        this.onCancelClicked();
    }

And here it is (almost) the same reminiscence in Eclipse (org.eclipse.jface.preference.PreferencePage).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    /**
     * Performs special processing when this page's Apply button has been pressed.
     * <p>
     * This is a framework hook method for sublcasses to do special things when
     * the Apply button has been pressed.
     * The default implementation of this framework method simply calls
     * <code>performOk</code> to simulate the pressing of the page's OK button.
     * </p>
     
     * @see #performOk
     */
    protected void performApply() {
        performOk();
    }

Oh man, how times have changed... oh wait.

PS. If you want to apply the changes, and keep the dialog open, because you want your users to be able to preview the changes, just make those buttons: 'Apply' and 'Close'.

Disqus Comments

comments powered by Disqus

Germanium

The one to rule them all. The browsers that is.

SharpKnight

SharpKnight is an Android chess game.

MagicGroup

MagicGroup is an eclipse plugin.