public class Preference extends Feature implements PreferenceSetting<java.lang.Boolean>
Preference
is a Feature
that only affects presentation logic so a user is allowed to
override the system-wide value with their own setting.
This can be dynamically degraded to a non-settable Feature
busing the boolean config parameter
service.feature.name.settableConstructor and Description |
---|
Preference(java.lang.String name,
boolean def,
java.lang.String description) |
Preference(java.lang.String name,
boolean def,
java.lang.String description,
java.lang.String... required_roles) |
Modifier and Type | Method and Description |
---|---|
boolean |
canUserSet(AppContext conn) |
boolean |
canView(SessionService<?> sess)
Does the current user have permissions to set/view this preference.
|
static boolean |
checkDynamicPreference(AppContext conn,
java.lang.String name,
boolean def,
java.lang.String desc,
java.lang.String... roles)
checks a
Preference that is only defined by name (ie the name is generated dynamically) |
void |
clearPreference(AppContext conn) |
java.lang.Boolean |
defaultSetting(AppContext conn) |
boolean |
hasPreference(AppContext conn) |
boolean |
isEnabled(AppContext conn) |
void |
setPreference(AppContext conn,
java.lang.Boolean value) |
checkDynamicFeature, checkFeature, find, getConfigValue, getCurrent, getIndex, getInput, getTag, getTarget, getText, isDef, isEnabled, setTempFeature
equals, findFeatureByName, getDefault, getDescription, getFeatureTable, getKnownFeatures, getName, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compareTo, getCurrent, getDefault, getDescription, getInput, getName
find, getIndex
public Preference(java.lang.String name, boolean def, java.lang.String description)
name
- def
- description
- public Preference(java.lang.String name, boolean def, java.lang.String description, java.lang.String... required_roles)
public boolean isEnabled(AppContext conn)
public boolean canUserSet(AppContext conn)
public java.lang.Boolean defaultSetting(AppContext conn)
defaultSetting
in interface PreferenceSetting<java.lang.Boolean>
public boolean hasPreference(AppContext conn)
hasPreference
in interface PreferenceSetting<java.lang.Boolean>
public void clearPreference(AppContext conn) throws DataFault
clearPreference
in interface PreferenceSetting<java.lang.Boolean>
DataFault
public void setPreference(AppContext conn, java.lang.Boolean value)
setPreference
in interface PreferenceSetting<java.lang.Boolean>
public boolean canView(SessionService<?> sess)
canView
in interface PreferenceSetting<java.lang.Boolean>
sess
- public static boolean checkDynamicPreference(AppContext conn, java.lang.String name, boolean def, java.lang.String desc, java.lang.String... roles)
Preference
that is only defined by name (ie the name is generated dynamically)conn
- name
-