Combo booleanCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
- String defaultValue = null;
-
- Object defaultObject = predicate.getDefaultValue();
- if (defaultObject != null){
- if (defaultObject instanceof IKeyLabel){
- defaultValue = ((IKeyLabel)defaultObject).getLabel();
- }else{
- defaultValue = predicate.getDefaultValue().toString();
+ CdmPreference dbPref = PreferencesUtil.getPreferenceFromDB(predicate);
+ String defaultValue = "";
+ if (dbPref != null && !isAdminPage && dbPref.getValue() != null){
+ defaultValue = dbPref.getValue();
+ }else {
+ try{
+ Object defaultObject = predicate.getDefaultValue();
+ if (defaultObject != null){
+ if (defaultObject instanceof IKeyLabel){
+ defaultValue = ((IKeyLabel)defaultObject).getLabel();
+ }else{
+ defaultValue = defaultObject.toString();
+ }
+ }
+ }catch(NullPointerException e){
+ defaultValue = "";
}
+
}
booleanCombo.add(Messages.Preference_Use_Default + " ("+defaultValue+")");;