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:
- 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.
- I have to implement savePreferences()
- I have to implement getPreferences()
- I have to initialize the fields in createContents() with values
from getPreferences().
- 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.
- 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.
- I have to override defaultSetting().
- 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
|