1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.taxeditor.preference;
|
11
|
|
12
|
import org.eclipse.jface.preference.BooleanFieldEditor;
|
13
|
import org.eclipse.jface.preference.StringFieldEditor;
|
14
|
import org.eclipse.swt.SWT;
|
15
|
import org.eclipse.swt.layout.GridData;
|
16
|
import org.eclipse.swt.layout.RowLayout;
|
17
|
import org.eclipse.swt.widgets.Composite;
|
18
|
|
19
|
import eu.etaxonomy.taxeditor.preference.menu.FieldEditorPreferencePageE4;
|
20
|
|
21
|
/**
|
22
|
* <p>
|
23
|
* TaxonomicEditorGeneralPreferences class.
|
24
|
* </p>
|
25
|
*
|
26
|
* @author n.hoffmann
|
27
|
* @created Sep 1, 2009
|
28
|
* @version 1.0
|
29
|
*/
|
30
|
public class TaxonomicEditorGeneralPreferences extends
|
31
|
FieldEditorPreferencePageE4 {
|
32
|
|
33
|
@Override
|
34
|
protected void createFieldEditors() {
|
35
|
addField(new BooleanFieldEditor(IPreferenceKeys.SHOW_DEBUG_INFORMATION,
|
36
|
"Show UUID and object ID in supplemental data view.",
|
37
|
getFieldEditorParent()));
|
38
|
addField(new BooleanFieldEditor(IPreferenceKeys.SHOW_ID_IN_ENTITY_SELECTION_DIAOLOG,
|
39
|
"Show object id in entity selection dialogs.",
|
40
|
getFieldEditorParent()));
|
41
|
addField(new BooleanFieldEditor(
|
42
|
IPreferenceKeys.SHOULD_EXPAND_SECTION_WHEN_DATA_AVAILABLE,
|
43
|
"Should expand sections when data is available (Details View). This might make the Editor slow.",
|
44
|
getFieldEditorParent()));
|
45
|
addField(new StringFieldEditor(
|
46
|
IPreferenceKeys.EDIT_MAP_SERVICE_ACCES_POINT,
|
47
|
"EDIT Map Service Access Point:", getFieldEditorParent()));
|
48
|
addField(new BooleanFieldEditor(
|
49
|
IPreferenceKeys.SHOULD_CONNECT_AT_STARTUP,
|
50
|
"Connect to last used datasource when launching",
|
51
|
getFieldEditorParent()));
|
52
|
addField(new BooleanFieldEditor(
|
53
|
IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES,
|
54
|
"Show experimental features", getFieldEditorParent()));
|
55
|
addField(new BooleanFieldEditor(IPreferenceKeys.SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS,
|
56
|
"Open search results in separate windows",
|
57
|
getFieldEditorParent()));
|
58
|
addField(new BooleanFieldEditor(IPreferenceKeys.SORT_TAXA_BY_RANK_AND_NAME,
|
59
|
"In selection dialogs for taxa, sort by rank and name",
|
60
|
getFieldEditorParent()));
|
61
|
|
62
|
Composite composite = new Composite(getFieldEditorParent(), SWT.NULL);
|
63
|
composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
|
64
|
composite.setLayout(new RowLayout(1));
|
65
|
|
66
|
// final Label label = new Label(composite, SWT.NONE);
|
67
|
// label.setText("Choose the prefered match mode for searches.");
|
68
|
//
|
69
|
// final Combo combo_MatchMode = new Combo(composite, SWT.NONE);
|
70
|
//
|
71
|
// MatchMode[] matchModes = MatchMode.values();
|
72
|
// int currentSelectionIndex = 0;
|
73
|
// for(int i = 0; i < matchModes.length; i++){
|
74
|
// MatchMode mode = matchModes[i];
|
75
|
// combo_MatchMode.add(mode.name(),i);
|
76
|
// //TODO:the correct preselection is needed here!!
|
77
|
// if (mode.equals(PreferencesUtil.getSearchConfigurator().getMatchMode())){
|
78
|
// currentSelectionIndex = i;
|
79
|
// }
|
80
|
// }
|
81
|
//
|
82
|
// combo_MatchMode.select(currentSelectionIndex);
|
83
|
//
|
84
|
// combo_MatchMode.addSelectionListener(new SelectionAdapter() {
|
85
|
// /* (non-Javadoc)
|
86
|
// * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
|
87
|
// */
|
88
|
// @Override
|
89
|
// public void widgetSelected(SelectionEvent e) {
|
90
|
// int selectionIndex = combo_MatchMode.getSelectionIndex();
|
91
|
// PreferencesUtil.getSearchConfigurator().setMatchMode(MatchMode.valueOf(combo_MatchMode.getItem(selectionIndex)));
|
92
|
// }
|
93
|
// });
|
94
|
|
95
|
|
96
|
|
97
|
|
98
|
}
|
99
|
|
100
|
}
|