Search code examples
javaeclipse-rcp

Disable the Cancel button for a custom preference page in a Eclipse RCP application


For all preferences pages in an Eclipse RCP application there exists both an OK button and a Cancel button.

Is it possible to disable the cancel button in the same way as one can disable the apply button?

E.g the apply button can be disabled with

noDefaultAndApplyButton();

Solution

  • The Cancel and OK buttons are provided by the preferences dialog rather than the current preference page - org.eclipse.jface.preference.PreferenceDialog to be exact.

    This dialog does not provide a way to disable the Cancel button.