2 * Copyright (C) 2014 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.
9 package eu
.etaxonomy
.taxeditor
.preference
;
11 import org
.eclipse
.jface
.preference
.BooleanFieldEditor
;
12 import org
.eclipse
.swt
.SWT
;
13 import org
.eclipse
.swt
.layout
.GridData
;
14 import org
.eclipse
.swt
.widgets
.Composite
;
15 import org
.eclipse
.swt
.widgets
.Control
;
16 import org
.eclipse
.swt
.widgets
.Label
;
18 import eu
.etaxonomy
.taxeditor
.l10n
.Messages
;
19 import eu
.etaxonomy
.taxeditor
.preference
.menu
.CdmPreferencePage
;
26 public class MediaPreferences
extends CdmPreferencePage
{
28 BooleanFieldEditor advanced
;
29 BooleanFieldEditor preview
;
32 protected Control
createContents(Composite parent
) {
33 Composite top
= new Composite(parent
, SWT
.LEFT
);
36 top
.setLayoutData(new GridData(GridData
.FILL_HORIZONTAL
));
37 Label mediaDetailsView
= new Label(top
, SWT
.NULL
);
38 mediaDetailsView
.setText("Details View");
39 advanced
= new BooleanFieldEditor(PreferencesUtil
.createPreferenceString(IPreferenceKeys
.SHOW_ADVANCED_MEDIA_SECTION
),
40 Messages
.MediaPreferences_advanced
,
42 advanced
.setPreferenceStore(getPreferenceStore());
45 Label mediaView
= new Label(top
, SWT
.NULL
);
46 mediaView
.setText("Media View");
47 preview
= new BooleanFieldEditor(PreferencesUtil
.createPreferenceString(IPreferenceKeys
.SHOW_MEDIA_PREVIEW
),
48 Messages
.MediaPreferences_preview
,
50 preview
.setPreferenceStore(getPreferenceStore());
58 public void createControl(Composite parent
){
59 super.createControl(parent
);
60 if (getApplyButton() != null){
61 this.getApplyButton().setEnabled(true);
66 public boolean performOk() {
69 return super.performOk();
73 protected void performDefaults() {
74 advanced
.loadDefault();
75 preview
.loadDefault();
76 super.performDefaults();