2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.preference
;
12 import org
.eclipse
.jface
.preference
.BooleanFieldEditor
;
13 import org
.eclipse
.swt
.SWT
;
14 import org
.eclipse
.swt
.layout
.GridData
;
15 import org
.eclipse
.swt
.layout
.RowLayout
;
16 import org
.eclipse
.swt
.widgets
.Composite
;
17 import org
.eclipse
.ui
.internal
.IPreferenceConstants
;
18 import org
.eclipse
.ui
.internal
.Workbench
;
20 import eu
.etaxonomy
.taxeditor
.l10n
.Messages
;
21 import eu
.etaxonomy
.taxeditor
.preference
.menu
.FieldEditorPreferencePageE4
;
25 * TaxonomicEditorGeneralPreferences class.
29 * @created Sep 1, 2009
32 public class TaxonomicEditorGeneralPreferences
extends
33 FieldEditorPreferencePageE4
{
35 private BooleanFieldEditor runInBackgroundEditor
;
38 protected void createFieldEditors() {
39 runInBackgroundEditor
= new BooleanFieldEditor(IPreferenceConstants
.RUN_IN_BACKGROUND
,
40 Messages
.TaxonomicEditorGeneralPreferences_background
,
41 getFieldEditorParent());
42 addField(runInBackgroundEditor
);
44 // addField(new BooleanFieldEditor(PreferencesUtil.createPreferenceString(IPreferenceKeys.SHOW_DEBUG_INFORMATION),
45 // "Show UUID and object ID in supplemental data view",
46 // getFieldEditorParent()));
47 // addField(new BooleanFieldEditor(PreferencesUtil.createPreferenceString(IPreferenceKeys.SHOW_ID_IN_ENTITY_SELECTION_DIAOLOG),
48 // "Show object id in entity selection dialogs",
49 // getFieldEditorParent()));
50 // addField(new BooleanFieldEditor(PreferencesUtil.createPreferenceString(
51 // IPreferenceKeys.SHOULD_EXPAND_SECTION_WHEN_DATA_AVAILABLE),
52 // "Should expand sections when data is available (Details View). This might make the Editor slow.",
53 // getFieldEditorParent()));
54 // addField(new StringFieldEditor(PreferencesUtil.createPreferenceString(
55 // IPreferenceKeys.EDIT_MAP_SERVICE_ACCES_POINT),
56 // "EDIT Map Service Access Point:", getFieldEditorParent()));
57 addField(new BooleanFieldEditor(PreferencesUtil
.createPreferenceString(
58 IPreferenceKeys
.SHOULD_CONNECT_AT_STARTUP
),
59 Messages
.TaxonomicEditorGeneralPreferences_connect
,
60 getFieldEditorParent()));
61 // addField(new BooleanFieldEditor(PreferencesUtil.createPreferenceString(
62 // IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES),
63 // "Show experimental features", getFieldEditorParent()));
64 // addField(new BooleanFieldEditor(PreferencesUtil.createPreferenceString(
65 // IPreferenceKeys.SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS),
66 // Messages.TaxonomicEditorGeneralPreferences_search_window,
67 // getFieldEditorParent()));
68 // addField(new BooleanFieldEditor(PreferencesUtil.createPreferenceString(IPreferenceKeys.SORT_TAXA_BY_RANK_AND_NAME),
69 // "In selection dialogs for taxa, sort by rank and name",
70 // getFieldEditorParent()));
71 // addField(new BooleanFieldEditor(PreferencesUtil.createPreferenceString(
72 // IPreferenceKeys.FILTER_COMMON_NAME_REFERENCES),
73 // "Filter common name references", getFieldEditorParent()));
75 Composite composite
= new Composite(getFieldEditorParent(), SWT
.NULL
);
76 composite
.setLayoutData(new GridData(SWT
.FILL
, SWT
.TOP
, true, false, 2, 1));
77 composite
.setLayout(new RowLayout(1));
79 // final Label label = new Label(composite, SWT.NONE);
80 // label.setText("Choose the prefered match mode for searches.");
82 // final Combo combo_MatchMode = new Combo(composite, SWT.NONE);
84 // MatchMode[] matchModes = MatchMode.values();
85 // int currentSelectionIndex = 0;
86 // for(int i = 0; i < matchModes.length; i++){
87 // MatchMode mode = matchModes[i];
88 // combo_MatchMode.add(mode.name(),i);
89 // //TODO:the correct preselection is needed here!!
90 // if (mode.equals(PreferencesUtil.getSearchConfigurator().getMatchMode())){
91 // currentSelectionIndex = i;
95 // combo_MatchMode.select(currentSelectionIndex);
97 // combo_MatchMode.addSelectionListener(new SelectionAdapter() {
99 // * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
102 // public void widgetSelected(SelectionEvent e) {
103 // int selectionIndex = combo_MatchMode.getSelectionIndex();
104 // PreferencesUtil.getSearchConfigurator().setMatchMode(MatchMode.valueOf(combo_MatchMode.getItem(selectionIndex)));
110 protected void initialize() {
112 //TODO this is a q&d hack to make the e3 preference work
113 runInBackgroundEditor
.setPreferenceStore(Workbench
.getInstance().getPreferenceStore());
114 runInBackgroundEditor
.load();