Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ptp-dev] Questions on AbstractRemotePreferencePage

Hi all,

I have some questions about how AbstractRemotePreferencePage should be correctly subclassed in order to provide a prefence page with remote connection preferences.

I noticed that the class extending AbstractRemotePreferencePage requires a lot of knowledge of how AbstractRemotePreferencePage itself was implemented.

I understand that:
  1. I have to override createContents(). The implementation first calls super.createContents in order to create a Control with remote preferences. I then add more controls with my own preferences.
  2. I have to implement savePreferences()
  3. I have to implement getPreferences()
  4. I have to initialize the fields in createContents() with values from getPreferences().
  5. My fields should have an listener that call super.updatePreferencePage() in order to operate seamlessly with fields from remote preferences. But I cannot reuse the listener declared in AbstractRemotePreferencePage (although its protected, suggesting reuse), I have to provide my own listener instead.
  6. I have to override isValidSettings(). The implementation first calls super.isValidSettings() and then I do my own validation. I call setErrorMessage() and setValid(false) if some of my preferences fields contain invalid values.
  7. I have to override defaultSetting().
  8. I do not understand how to implement saving of preferences. I see that I could override performOk(), but doing so would not be consistent with overrideng defaultSettings() (I would have to override performDefaults instead).
Best regards,
Daniel Felix Ferber

Back to the top