Revision 986b34c8
Added by Patrick Plitzner over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/GeneralAdminPreferencePage.java | ||
---|---|---|
9 | 9 |
package eu.etaxonomy.taxeditor.databaseAdmin.preferencePage; |
10 | 10 |
|
11 | 11 |
import org.eclipse.swt.SWT; |
12 |
import org.eclipse.swt.events.SelectionAdapter; |
|
13 |
import org.eclipse.swt.events.SelectionEvent; |
|
14 |
import org.eclipse.swt.layout.GridLayout; |
|
15 |
import org.eclipse.swt.widgets.Button; |
|
16 | 12 |
import org.eclipse.swt.widgets.Composite; |
17 | 13 |
import org.eclipse.swt.widgets.Control; |
18 | 14 |
|
19 | 15 |
import eu.etaxonomy.cdm.api.application.ICdmRepository; |
20 | 16 |
import eu.etaxonomy.cdm.api.service.IPreferenceService; |
21 | 17 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference; |
22 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey; |
|
23 | 18 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
24 |
import eu.etaxonomy.cdm.model.metadata.PreferenceSubject; |
|
25 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
|
26 | 19 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
27 | 20 |
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage; |
28 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
29 | 21 |
|
30 | 22 |
/** |
31 | 23 |
* @author k.luther |
... | ... | |
47 | 39 |
protected Control createContents(Composite parent) { |
48 | 40 |
final Composite composite = new Composite(parent, SWT.NULL); |
49 | 41 |
|
50 |
GridLayout gridLayout = new GridLayout(); |
|
51 |
composite.setLayout(gridLayout); |
|
52 |
controller = CdmStore.getCurrentApplicationConfiguration(); |
|
53 |
if (controller != null){ |
|
54 |
IPreferenceService service = controller.getPreferenceService(); |
|
55 |
PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowImportExportMenu); |
|
56 |
CdmPreference isShowSpecimenPref = service.find(key); |
|
57 |
if (isShowSpecimenPref != null){ |
|
58 |
this.isShowIOMenu = Boolean.valueOf(isShowSpecimenPref.getValue()); |
|
59 |
} |
|
60 |
|
|
61 |
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowMediaView); |
|
62 |
CdmPreference isShowMediaViewPref = service.find(key); |
|
63 |
if (isShowMediaViewPref != null){ |
|
64 |
this.isShowMediaView = Boolean.valueOf(isShowMediaViewPref.getValue()); |
|
65 |
} |
|
66 |
|
|
67 |
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowChecklistPerspective); |
|
68 |
CdmPreference isShowChecklistPref = service.find(key); |
|
69 |
if (isShowChecklistPref != null){ |
|
70 |
this.isShowCheckListPerspective = Boolean.valueOf(isShowChecklistPref.getValue()); |
|
71 |
} |
|
72 |
|
|
73 |
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowTaxonNodeWizard); |
|
74 |
CdmPreference isShowTaxonNodeWizardPref = service.find(key); |
|
75 |
if (isShowTaxonNodeWizardPref != null){ |
|
76 |
this.isShowTaxonNodeWizard = Boolean.valueOf(isShowTaxonNodeWizardPref.getValue()); |
|
77 |
} |
|
78 |
} |
|
79 |
final Button showIOMenuButton = new Button(composite, SWT.CHECK); |
|
80 |
|
|
81 |
showIOMenuButton.setText(Messages.DatabasePreferncesPage_Show_IOMenu); |
|
82 |
|
|
83 |
showIOMenuButton.setSelection(isShowIOMenu); |
|
84 |
showIOMenuButton.addSelectionListener(new SelectionAdapter(){ |
|
85 |
@Override |
|
86 |
public void widgetSelected(SelectionEvent e) { |
|
87 |
isShowIOMenu = showIOMenuButton.getSelection(); |
|
88 |
|
|
89 |
} |
|
90 |
}); |
|
91 |
|
|
92 |
final Button showMediaViewButton = new Button(composite, SWT.CHECK); |
|
93 |
|
|
94 |
showMediaViewButton.setText(Messages.DatabasePreferncesPage_Show_MediaView); |
|
95 |
|
|
96 |
showMediaViewButton.setSelection(isShowMediaView); |
|
97 |
showMediaViewButton.addSelectionListener(new SelectionAdapter(){ |
|
98 |
@Override |
|
99 |
public void widgetSelected(SelectionEvent e) { |
|
100 |
isShowMediaView = showIOMenuButton.getSelection(); |
|
101 |
|
|
102 |
} |
|
103 |
}); |
|
104 |
final Button showChecklistPerspectiveButton = new Button(composite, SWT.CHECK); |
|
105 |
|
|
106 |
showChecklistPerspectiveButton.setText(Messages.DatabasePreferncesPage_Show_ChecklistPerspective); |
|
107 |
|
|
108 |
showChecklistPerspectiveButton.setSelection(isShowCheckListPerspective); |
|
109 |
showChecklistPerspectiveButton.addSelectionListener(new SelectionAdapter(){ |
|
110 |
@Override |
|
111 |
public void widgetSelected(SelectionEvent e) { |
|
112 |
isShowCheckListPerspective = showChecklistPerspectiveButton.getSelection(); |
|
113 |
|
|
114 |
} |
|
115 |
}); |
|
116 |
|
|
117 |
final Button showTaxonNodeWizardButton = new Button(composite, SWT.CHECK); |
|
118 |
|
|
119 |
showTaxonNodeWizardButton.setText(Messages.DatabasePreferncesPage_Show_TaxonNodeWizard); |
|
120 |
|
|
121 |
showTaxonNodeWizardButton.setSelection(isShowTaxonNodeWizard); |
|
122 |
showTaxonNodeWizardButton.addSelectionListener(new SelectionAdapter(){ |
|
123 |
@Override |
|
124 |
public void widgetSelected(SelectionEvent e) { |
|
125 |
isShowTaxonNodeWizard = showTaxonNodeWizardButton.getSelection(); |
|
126 |
|
|
127 |
} |
|
128 |
}); |
|
42 |
// GridLayout gridLayout = new GridLayout();
|
|
43 |
// composite.setLayout(gridLayout);
|
|
44 |
// controller = CdmStore.getCurrentApplicationConfiguration();
|
|
45 |
// if (controller != null){
|
|
46 |
// IPreferenceService service = controller.getPreferenceService();
|
|
47 |
// PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowImportExportMenu);
|
|
48 |
// CdmPreference isShowSpecimenPref = service.find(key);
|
|
49 |
// if (isShowSpecimenPref != null){
|
|
50 |
// this.isShowIOMenu = Boolean.valueOf(isShowSpecimenPref.getValue());
|
|
51 |
// }
|
|
52 |
// |
|
53 |
// key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowMediaView);
|
|
54 |
// CdmPreference isShowMediaViewPref = service.find(key);
|
|
55 |
// if (isShowMediaViewPref != null){
|
|
56 |
// this.isShowMediaView = Boolean.valueOf(isShowMediaViewPref.getValue());
|
|
57 |
// }
|
|
58 |
// |
|
59 |
// key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowChecklistPerspective);
|
|
60 |
// CdmPreference isShowChecklistPref = service.find(key);
|
|
61 |
// if (isShowChecklistPref != null){
|
|
62 |
// this.isShowCheckListPerspective = Boolean.valueOf(isShowChecklistPref.getValue());
|
|
63 |
// }
|
|
64 |
// |
|
65 |
// key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowTaxonNodeWizard);
|
|
66 |
// CdmPreference isShowTaxonNodeWizardPref = service.find(key);
|
|
67 |
// if (isShowTaxonNodeWizardPref != null){
|
|
68 |
// this.isShowTaxonNodeWizard = Boolean.valueOf(isShowTaxonNodeWizardPref.getValue());
|
|
69 |
// }
|
|
70 |
// }
|
|
71 |
// final Button showIOMenuButton = new Button(composite, SWT.CHECK);
|
|
72 |
// |
|
73 |
// showIOMenuButton.setText(Messages.DatabasePreferncesPage_Show_IOMenu);
|
|
74 |
// |
|
75 |
// showIOMenuButton.setSelection(isShowIOMenu);
|
|
76 |
// showIOMenuButton.addSelectionListener(new SelectionAdapter(){
|
|
77 |
// @Override
|
|
78 |
// public void widgetSelected(SelectionEvent e) {
|
|
79 |
// isShowIOMenu = showIOMenuButton.getSelection();
|
|
80 |
// |
|
81 |
// }
|
|
82 |
// });
|
|
83 |
// |
|
84 |
// final Button showMediaViewButton = new Button(composite, SWT.CHECK);
|
|
85 |
// |
|
86 |
// showMediaViewButton.setText(Messages.DatabasePreferncesPage_Show_MediaView);
|
|
87 |
// |
|
88 |
// showMediaViewButton.setSelection(isShowMediaView);
|
|
89 |
// showMediaViewButton.addSelectionListener(new SelectionAdapter(){
|
|
90 |
// @Override
|
|
91 |
// public void widgetSelected(SelectionEvent e) {
|
|
92 |
// isShowMediaView = showIOMenuButton.getSelection();
|
|
93 |
// |
|
94 |
// }
|
|
95 |
// });
|
|
96 |
// final Button showChecklistPerspectiveButton = new Button(composite, SWT.CHECK);
|
|
97 |
// |
|
98 |
// showChecklistPerspectiveButton.setText(Messages.DatabasePreferncesPage_Show_ChecklistPerspective);
|
|
99 |
// |
|
100 |
// showChecklistPerspectiveButton.setSelection(isShowCheckListPerspective);
|
|
101 |
// showChecklistPerspectiveButton.addSelectionListener(new SelectionAdapter(){
|
|
102 |
// @Override
|
|
103 |
// public void widgetSelected(SelectionEvent e) {
|
|
104 |
// isShowCheckListPerspective = showChecklistPerspectiveButton.getSelection();
|
|
105 |
// |
|
106 |
// }
|
|
107 |
// });
|
|
108 |
// |
|
109 |
// final Button showTaxonNodeWizardButton = new Button(composite, SWT.CHECK);
|
|
110 |
// |
|
111 |
// showTaxonNodeWizardButton.setText(Messages.DatabasePreferncesPage_Show_TaxonNodeWizard);
|
|
112 |
// |
|
113 |
// showTaxonNodeWizardButton.setSelection(isShowTaxonNodeWizard);
|
|
114 |
// showTaxonNodeWizardButton.addSelectionListener(new SelectionAdapter(){
|
|
115 |
// @Override
|
|
116 |
// public void widgetSelected(SelectionEvent e) {
|
|
117 |
// isShowTaxonNodeWizard = showTaxonNodeWizardButton.getSelection();
|
|
118 |
// |
|
119 |
// }
|
|
120 |
// });
|
|
129 | 121 |
|
130 | 122 |
return composite; |
131 | 123 |
} |
Also available in: Unified diff
ref #7849 Temporarily removed general DB preferences