Revision 185eb33b
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableAreaVocabulariesPage.java | ||
---|---|---|
17 | 17 |
import java.util.UUID; |
18 | 18 |
|
19 | 19 |
import org.apache.commons.lang.StringUtils; |
20 |
import org.eclipse.swt.SWT; |
|
21 |
import org.eclipse.swt.events.SelectionAdapter; |
|
22 |
import org.eclipse.swt.events.SelectionEvent; |
|
23 |
import org.eclipse.swt.widgets.Button; |
|
24 | 20 |
import org.eclipse.swt.widgets.Composite; |
25 | 21 |
|
26 | 22 |
import eu.etaxonomy.cdm.api.service.IVocabularyService; |
... | ... | |
42 | 38 |
* @since 04.06.2018 |
43 | 39 |
* |
44 | 40 |
*/ |
45 |
public class AvailableAreaVocabulariesPage extends AbstractTermSelectionWizardPage implements ICdmEntitySessionEnabled{ |
|
41 |
public class AvailableAreaVocabulariesPage extends AbstractAdminTermSelectionWizardPage implements ICdmEntitySessionEnabled{
|
|
46 | 42 |
|
47 |
CdmPreference pref; |
|
48 | 43 |
String featureTitle; |
49 |
boolean allowOverride; |
|
44 |
|
|
50 | 45 |
|
51 | 46 |
public AvailableAreaVocabulariesPage(String pageName, boolean localPref, CdmPreference pref, String featureTitle) { |
52 |
super(pageName, TermType.NamedArea); |
|
47 |
super(pageName, TermType.NamedArea, pref);
|
|
53 | 48 |
this.localPref = localPref; |
54 |
this.pref = pref; |
|
55 | 49 |
this.featureTitle = featureTitle; |
56 | 50 |
|
57 | 51 |
} |
... | ... | |
63 | 57 |
setDescription(String.format(Messages.AvailableAreaVocabulariesPage_PAGE_DESCRIPTION, featureTitle)); |
64 | 58 |
if (!localPref){ |
65 | 59 |
|
66 |
final Button activateCheckButton = new Button(parent, SWT.CHECK); |
|
67 |
activateCheckButton.setText("Allow Override"); |
|
68 |
activateCheckButton.setSelection(pref.isAllowOverride()); |
|
69 |
activateCheckButton.addSelectionListener(new SelectionAdapter(){ |
|
70 |
@Override |
|
71 |
public void widgetSelected(SelectionEvent e) { |
|
72 |
pref.setAllowOverride(activateCheckButton.getSelection()); |
|
73 |
} |
|
74 |
}); |
|
60 |
createAllowOverrideButton(parent); |
|
75 | 61 |
} |
76 | 62 |
super.createControl(parent); |
77 | 63 |
|
78 | 64 |
treeComposite.getViewer().setContentProvider(new RootElementsOnlyTreeContentProvider()); |
79 | 65 |
} |
80 | 66 |
|
67 |
|
|
68 |
|
|
81 | 69 |
@Override |
82 | 70 |
protected String getCheckedValuesFromPreferences() { |
83 | 71 |
String vocString = null; |
... | ... | |
89 | 77 |
return vocString; |
90 | 78 |
} |
91 | 79 |
|
80 |
protected CdmPreference getPreferences() { |
|
81 |
return pref; |
|
82 |
} |
|
83 |
|
|
92 | 84 |
@Override |
93 | 85 |
public ICdmEntitySession getCdmEntitySession() { |
94 | 86 |
return null; |
Also available in: Unified diff
ref #7849: improve DB preference handling and use editorpreferencePredicates keys also for local preferences