#78 closed enhancement (fixed)
Preferences: support dynamically computed defaults
Reported by: | David Aspinall | Owned by: | David Aspinall |
---|---|---|---|
Priority: | trivial | Milestone: | |
Component: | 1:pg-eclipse | Keywords: | |
Cc: |
Description
The preference mechanism should support dynamically computed defaults. This can be achieved by using reflection together with a method name given in the preference file:
<pref name="ActiveHighlight" type="string" setDefault="setExample"/>
The method should be located in the already given class associated with the preference file, e.g. ExamplePrefs.java:
public Boolean setExample() { return Eclipse.isRunningOnMac() ? "Orange" : "Blue"; }
This is bogus and slightly silly example, but one reason we want this is to set platform-specific defaults for some values.
Change History (3)
comment:1 Changed 17 years ago by
Type: | defect → enhancement |
---|
comment:2 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
I've now added a simpler mechanism for allowing OS-specific preference overrides in the preference table, as:
The
os
attribute should be contained inPlatform.getOS()
for this to work (somac
would be another way).This is a crude way of having OS-specific prefs: the first preference that appears will win, and non-specific preferences win defaults for all OS settings. The main crudeness is having to repeat the preference, description etc.
But this does for choosing the
Default Symbol Table
inProofGeneralPrefs.xml
.