Revision 5bb1eb99
Added by Patrick Plitzner almost 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java | ||
---|---|---|
107 | 107 |
return TaxeditorStorePlugin.getDefault().getPreferenceStore(); |
108 | 108 |
} |
109 | 109 |
|
110 |
static String prefKey(String name) { |
|
110 |
private static String prefKey(String name) {
|
|
111 | 111 |
return name + "_"+ ((CdmRemoteSource)CdmStore.getActiveCdmSource()).toString(); |
112 | 112 |
} |
113 | 113 |
|
... | ... | |
1986 | 1986 |
|
1987 | 1987 |
|
1988 | 1988 |
|
1989 |
/** |
|
1990 |
* Returns whether the named preference is known. |
|
1991 |
* @param prefKey the key of the preference |
|
1992 |
* @return <code>true</code> if the preference is known, <code>false</code> otherwise |
|
1993 |
*/ |
|
1994 |
public static boolean contains(String prefKey){ |
|
1995 |
return getPreferenceStore().contains(prefKey(prefKey)); |
|
1996 |
} |
|
1997 |
|
|
1989 | 1998 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/CdmSectionPart.java | ||
---|---|---|
55 | 55 |
public class CdmSectionPart<T> extends SectionPart implements |
56 | 56 |
IPropertyChangeListener { |
57 | 57 |
|
58 |
public static String EXPANDED = "expanded"; |
|
59 |
public static String COLLAPSED = "collapsed"; |
|
60 |
|
|
58 | 61 |
private final AbstractFormSection<T> formSection; |
59 | 62 |
|
60 | 63 |
/** |
... | ... | |
199 | 202 |
@Override |
200 | 203 |
protected void expansionStateChanged(boolean expanded) { |
201 | 204 |
super.expansionStateChanged(expanded); |
202 |
PreferencesUtil.setBooleanValue(StoreUtil.getPrefKey(formSection.getClass(), rootInput), expanded);
|
|
205 |
PreferencesUtil.setStringValue(StoreUtil.getPrefKey(formSection.getClass(), rootInput), expanded?EXPANDED:COLLAPSED);
|
|
203 | 206 |
} |
204 | 207 |
|
205 | 208 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmDataViewerE4.java | ||
---|---|---|
179 | 179 |
|
180 | 180 |
protected int getSectionStyle(Class<? extends AbstractFormSection> clazz, boolean initiallyExpanded){ |
181 | 181 |
int style = ExpandableComposite.TWISTIE; |
182 |
if(PreferencesUtil.getBooleanValue(StoreUtil.getPrefKey(clazz, getInput())) |
|
183 |
|| initiallyExpanded){ |
|
184 |
style |= ExpandableComposite.EXPANDED; |
|
182 |
String prefKey = StoreUtil.getPrefKey(clazz, getInput()); |
|
183 |
if(PreferencesUtil.contains(prefKey)){ |
|
184 |
style = PreferencesUtil.getStringValue(prefKey)==CdmSectionPart.EXPANDED?style |= ExpandableComposite.EXPANDED:style; |
|
185 |
} |
|
186 |
else{ |
|
187 |
style = initiallyExpanded?style |= ExpandableComposite.EXPANDED:style; |
|
185 | 188 |
} |
186 | 189 |
return style; |
187 | 190 |
} |
Also available in: Unified diff
Fix expansion state preference for details and suppData view