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
.jface
.preference
.FieldEditorPreferencePage
;
14 import org
.eclipse
.jface
.preference
.StringFieldEditor
;
15 import org
.eclipse
.swt
.SWT
;
16 import org
.eclipse
.swt
.events
.SelectionAdapter
;
17 import org
.eclipse
.swt
.events
.SelectionEvent
;
18 import org
.eclipse
.swt
.layout
.GridData
;
19 import org
.eclipse
.swt
.layout
.RowLayout
;
20 import org
.eclipse
.swt
.widgets
.Combo
;
21 import org
.eclipse
.swt
.widgets
.Composite
;
22 import org
.eclipse
.swt
.widgets
.Label
;
23 import org
.eclipse
.ui
.IWorkbench
;
24 import org
.eclipse
.ui
.IWorkbenchPreferencePage
;
26 import eu
.etaxonomy
.cdm
.persistence
.query
.MatchMode
;
30 * TaxonomicEditorGeneralPreferences class.
34 * @created Sep 1, 2009
37 public class TaxonomicEditorGeneralPreferences
extends
38 FieldEditorPreferencePage
implements IWorkbenchPreferencePage
{
44 * org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors
48 protected void createFieldEditors() {
49 addField(new BooleanFieldEditor(IPreferenceKeys
.SHOW_DEBUG_INFORMATION
,
50 "Show UUID and object ID in supplemental data view.",
51 getFieldEditorParent()));
52 addField(new BooleanFieldEditor(IPreferenceKeys
.SHOW_ID_IN_ENTITY_SELECTION_DIAOLOG
,
53 "Show object id in entity selection dialogs.",
54 getFieldEditorParent()));
55 addField(new BooleanFieldEditor(
56 IPreferenceKeys
.SHOULD_EXPAND_SECTION_WHEN_DATA_AVAILABLE
,
57 "Should expand sections when data is available (Details View). This might make the Editor slow.",
58 getFieldEditorParent()));
59 addField(new StringFieldEditor(
60 IPreferenceKeys
.EDIT_MAP_SERVICE_ACCES_POINT
,
61 "EDIT Map Service Access Point:", getFieldEditorParent()));
62 addField(new BooleanFieldEditor(
63 IPreferenceKeys
.SHOULD_CONNECT_AT_STARTUP
,
64 "Connect to last used datasource when launching",
65 getFieldEditorParent()));
66 addField(new BooleanFieldEditor(
67 IPreferenceKeys
.SHOW_EXPERIMENTAL_FEATURES
,
68 "Show experimental features", getFieldEditorParent()));
69 addField(new BooleanFieldEditor(IPreferenceKeys
.SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS
,
70 "Open search results in separate windows",
71 getFieldEditorParent()));
72 // addField(new BooleanFieldEditor(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION,
73 // "Show only a simple name details view",
74 // getFieldEditorParent()));
76 Composite composite
= new Composite(getFieldEditorParent(), SWT
.NULL
);
77 composite
.setLayoutData(new GridData(SWT
.FILL
, SWT
.TOP
, true, false, 2, 1));
78 composite
.setLayout(new RowLayout(1));
80 // final Label label = new Label(composite, SWT.NONE);
81 // label.setText("Choose the prefered match mode for searches.");
83 // final Combo combo_MatchMode = new Combo(composite, SWT.NONE);
85 // MatchMode[] matchModes = MatchMode.values();
86 // int currentSelectionIndex = 0;
87 // for(int i = 0; i < matchModes.length; i++){
88 // MatchMode mode = matchModes[i];
89 // combo_MatchMode.add(mode.name(),i);
90 // //TODO:the correct preselection is needed here!!
91 // if (mode.equals(PreferencesUtil.getSearchConfigurator().getMatchMode())){
92 // currentSelectionIndex = i;
96 // combo_MatchMode.select(currentSelectionIndex);
98 // combo_MatchMode.addSelectionListener(new SelectionAdapter() {
100 // * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
103 // public void widgetSelected(SelectionEvent e) {
104 // int selectionIndex = combo_MatchMode.getSelectionIndex();
105 // PreferencesUtil.getSearchConfigurator().setMatchMode(MatchMode.valueOf(combo_MatchMode.getItem(selectionIndex)));
118 * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
121 public void init(IWorkbench workbench
) {
122 setPreferenceStore(PreferencesUtil
.getPreferenceStore());