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
|
... | ... | |
49 |
41 |
final Composite composite = new Composite(parent, SWT.NULL);
|
50 |
42 |
|
51 |
43 |
|
52 |
|
GridLayout gridLayout = new GridLayout();
|
53 |
|
composite.setLayout(gridLayout);
|
54 |
|
controller = CdmStore.getCurrentApplicationConfiguration();
|
55 |
|
if (controller != null){
|
56 |
|
IPreferenceService service = controller.getPreferenceService();
|
57 |
|
PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowImportExportMenu);
|
58 |
|
CdmPreference isShowSpecimenPref = service.find(key);
|
59 |
|
if (isShowSpecimenPref != null){
|
60 |
|
this.isShowIOMenu = Boolean.valueOf(isShowSpecimenPref.getValue());
|
61 |
|
}
|
62 |
|
|
63 |
|
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowMediaView);
|
64 |
|
CdmPreference isShowMediaViewPref = service.find(key);
|
65 |
|
if (isShowMediaViewPref != null){
|
66 |
|
this.isShowMediaView = Boolean.valueOf(isShowMediaViewPref.getValue());
|
67 |
|
}
|
68 |
|
|
69 |
|
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowChecklistPerspective);
|
70 |
|
CdmPreference isShowChecklistPref = service.find(key);
|
71 |
|
if (isShowChecklistPref != null){
|
72 |
|
this.isShowCheckListPerspective = Boolean.valueOf(isShowChecklistPref.getValue());
|
73 |
|
}
|
74 |
|
|
75 |
|
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowTaxonNodeWizard);
|
76 |
|
CdmPreference isShowTaxonNodeWizardPref = service.find(key);
|
77 |
|
if (isShowTaxonNodeWizardPref != null){
|
78 |
|
this.isShowTaxonNodeWizard = Boolean.valueOf(isShowTaxonNodeWizardPref.getValue());
|
79 |
|
}
|
80 |
|
}
|
81 |
|
final Button showIOMenuButton = new Button(composite, SWT.CHECK);
|
82 |
|
|
83 |
|
showIOMenuButton.setText(Messages.DatabasePreferncesPage_Show_IOMenu);
|
84 |
|
|
85 |
|
showIOMenuButton.setSelection(isShowIOMenu);
|
86 |
|
showIOMenuButton.addSelectionListener(new SelectionAdapter(){
|
87 |
|
@Override
|
88 |
|
public void widgetSelected(SelectionEvent e) {
|
89 |
|
isShowIOMenu = showIOMenuButton.getSelection();
|
90 |
|
|
91 |
|
}
|
92 |
|
});
|
93 |
|
|
94 |
|
final Button showMediaViewButton = new Button(composite, SWT.CHECK);
|
95 |
|
|
96 |
|
showMediaViewButton.setText(Messages.DatabasePreferncesPage_Show_MediaView);
|
97 |
|
|
98 |
|
showMediaViewButton.setSelection(isShowMediaView);
|
99 |
|
showMediaViewButton.addSelectionListener(new SelectionAdapter(){
|
100 |
|
@Override
|
101 |
|
public void widgetSelected(SelectionEvent e) {
|
102 |
|
isShowMediaView = showIOMenuButton.getSelection();
|
103 |
|
|
104 |
|
}
|
105 |
|
});
|
106 |
|
final Button showChecklistPerspectiveButton = new Button(composite, SWT.CHECK);
|
107 |
|
|
108 |
|
showChecklistPerspectiveButton.setText(Messages.DatabasePreferncesPage_Show_ChecklistPerspective);
|
109 |
|
|
110 |
|
showChecklistPerspectiveButton.setSelection(isShowCheckListPerspective);
|
111 |
|
showChecklistPerspectiveButton.addSelectionListener(new SelectionAdapter(){
|
112 |
|
@Override
|
113 |
|
public void widgetSelected(SelectionEvent e) {
|
114 |
|
isShowCheckListPerspective = showChecklistPerspectiveButton.getSelection();
|
115 |
|
|
116 |
|
}
|
117 |
|
});
|
118 |
|
|
119 |
|
final Button showTaxonNodeWizardButton = new Button(composite, SWT.CHECK);
|
120 |
|
|
121 |
|
showTaxonNodeWizardButton.setText(Messages.DatabasePreferncesPage_Show_TaxonNodeWizard);
|
122 |
|
|
123 |
|
showTaxonNodeWizardButton.setSelection(isShowTaxonNodeWizard);
|
124 |
|
showTaxonNodeWizardButton.addSelectionListener(new SelectionAdapter(){
|
125 |
|
@Override
|
126 |
|
public void widgetSelected(SelectionEvent e) {
|
127 |
|
isShowTaxonNodeWizard = showTaxonNodeWizardButton.getSelection();
|
128 |
|
|
129 |
|
}
|
130 |
|
});
|
|
44 |
// GridLayout gridLayout = new GridLayout();
|
|
45 |
// composite.setLayout(gridLayout);
|
|
46 |
// controller = CdmStore.getCurrentApplicationConfiguration();
|
|
47 |
// if (controller != null){
|
|
48 |
// IPreferenceService service = controller.getPreferenceService();
|
|
49 |
// PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowImportExportMenu);
|
|
50 |
// CdmPreference isShowSpecimenPref = service.find(key);
|
|
51 |
// if (isShowSpecimenPref != null){
|
|
52 |
// this.isShowIOMenu = Boolean.valueOf(isShowSpecimenPref.getValue());
|
|
53 |
// }
|
|
54 |
//
|
|
55 |
// key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowMediaView);
|
|
56 |
// CdmPreference isShowMediaViewPref = service.find(key);
|
|
57 |
// if (isShowMediaViewPref != null){
|
|
58 |
// this.isShowMediaView = Boolean.valueOf(isShowMediaViewPref.getValue());
|
|
59 |
// }
|
|
60 |
//
|
|
61 |
// key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowChecklistPerspective);
|
|
62 |
// CdmPreference isShowChecklistPref = service.find(key);
|
|
63 |
// if (isShowChecklistPref != null){
|
|
64 |
// this.isShowCheckListPerspective = Boolean.valueOf(isShowChecklistPref.getValue());
|
|
65 |
// }
|
|
66 |
//
|
|
67 |
// key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowTaxonNodeWizard);
|
|
68 |
// CdmPreference isShowTaxonNodeWizardPref = service.find(key);
|
|
69 |
// if (isShowTaxonNodeWizardPref != null){
|
|
70 |
// this.isShowTaxonNodeWizard = Boolean.valueOf(isShowTaxonNodeWizardPref.getValue());
|
|
71 |
// }
|
|
72 |
// }
|
|
73 |
// final Button showIOMenuButton = new Button(composite, SWT.CHECK);
|
|
74 |
//
|
|
75 |
// showIOMenuButton.setText(Messages.DatabasePreferncesPage_Show_IOMenu);
|
|
76 |
//
|
|
77 |
// showIOMenuButton.setSelection(isShowIOMenu);
|
|
78 |
// showIOMenuButton.addSelectionListener(new SelectionAdapter(){
|
|
79 |
// @Override
|
|
80 |
// public void widgetSelected(SelectionEvent e) {
|
|
81 |
// isShowIOMenu = showIOMenuButton.getSelection();
|
|
82 |
//
|
|
83 |
// }
|
|
84 |
// });
|
|
85 |
//
|
|
86 |
// final Button showMediaViewButton = new Button(composite, SWT.CHECK);
|
|
87 |
//
|
|
88 |
// showMediaViewButton.setText(Messages.DatabasePreferncesPage_Show_MediaView);
|
|
89 |
//
|
|
90 |
// showMediaViewButton.setSelection(isShowMediaView);
|
|
91 |
// showMediaViewButton.addSelectionListener(new SelectionAdapter(){
|
|
92 |
// @Override
|
|
93 |
// public void widgetSelected(SelectionEvent e) {
|
|
94 |
// isShowMediaView = showIOMenuButton.getSelection();
|
|
95 |
//
|
|
96 |
// }
|
|
97 |
// });
|
|
98 |
// final Button showChecklistPerspectiveButton = new Button(composite, SWT.CHECK);
|
|
99 |
//
|
|
100 |
// showChecklistPerspectiveButton.setText(Messages.DatabasePreferncesPage_Show_ChecklistPerspective);
|
|
101 |
//
|
|
102 |
// showChecklistPerspectiveButton.setSelection(isShowCheckListPerspective);
|
|
103 |
// showChecklistPerspectiveButton.addSelectionListener(new SelectionAdapter(){
|
|
104 |
// @Override
|
|
105 |
// public void widgetSelected(SelectionEvent e) {
|
|
106 |
// isShowCheckListPerspective = showChecklistPerspectiveButton.getSelection();
|
|
107 |
//
|
|
108 |
// }
|
|
109 |
// });
|
|
110 |
//
|
|
111 |
// final Button showTaxonNodeWizardButton = new Button(composite, SWT.CHECK);
|
|
112 |
//
|
|
113 |
// showTaxonNodeWizardButton.setText(Messages.DatabasePreferncesPage_Show_TaxonNodeWizard);
|
|
114 |
//
|
|
115 |
// showTaxonNodeWizardButton.setSelection(isShowTaxonNodeWizard);
|
|
116 |
// showTaxonNodeWizardButton.addSelectionListener(new SelectionAdapter(){
|
|
117 |
// @Override
|
|
118 |
// public void widgetSelected(SelectionEvent e) {
|
|
119 |
// isShowTaxonNodeWizard = showTaxonNodeWizardButton.getSelection();
|
|
120 |
//
|
|
121 |
// }
|
|
122 |
// });
|
131 |
123 |
|
132 |
124 |
|
133 |
125 |
return composite;
|
Revert "ref #7849: move general db preferences to its own tab to avoid saving if not edited"
This reverts commit b123c0b7320fdddda7c26405b76be8db119f4445.