Joscha
Joscha

Reputation: 4693

How to remove "restore defaults" and "apply" button in custom RCP Preference Page

When creating a preference page in RCP, e.g. something like:

public class MyPreferencePage extends org.eclipse.jface.preference.PreferencePage  implements IWorkbenchPreferencePage

how can I remove the "Restore default values" and "Apply" buttons which get added by default. Using

this.getDefaultsButton().setVisible(false);
this.getApplyButton().setVisible(false);

results in an error.

Upvotes: 3

Views: 2414

Answers (2)

Francis Upton IV
Francis Upton IV

Reputation: 19443

Call PreferencePage.noDefaultAndApplyButton() before your control is created.

Upvotes: 11

Dhrumil Shah
Dhrumil Shah

Reputation: 746

use this noDefaultAndApplyButton() before your code begins

Upvotes: 0

Related Questions