如何在 PropertyPages 中对 "Restore Defaults" 和 "Apply" 按钮进行编程

How to program the "Restore Defaults" and "Apply" button in PropertyPages

我正在为 Eclipse 插件设计 属性 页面。我需要对页面上默认创建的 "Restore Default" 和 "Apply" 按钮进行编程。有人可以帮助我如何去做吗?

谢谢!

您可以覆盖 属性 页面中的 performDefaultsperformApply 方法来处理这些按钮。通常你应该调用 super 方法:

@Override
protected void performDefaults() {
    super.performDefaults();

    // TODO your code
}

@Override
protected void performApply() {
    super.performApply();

    // TODO your code
}