1
|
/**
|
2
|
* Copyright (C) 2014 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
|
package eu.etaxonomy.taxeditor.preference;
|
10
|
|
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;
|
17
|
|
18
|
import eu.etaxonomy.taxeditor.l10n.Messages;
|
19
|
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
|
20
|
|
21
|
/**
|
22
|
* @author pplitzner
|
23
|
* @date 13.02.2014
|
24
|
*
|
25
|
*/
|
26
|
public class MediaPreferences extends CdmPreferencePage {
|
27
|
|
28
|
BooleanFieldEditor advanced;
|
29
|
BooleanFieldEditor preview;
|
30
|
|
31
|
@Override
|
32
|
protected Control createContents(Composite parent) {
|
33
|
Composite top = new Composite(parent, SWT.LEFT);
|
34
|
|
35
|
|
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,
|
41
|
top);
|
42
|
advanced.setPreferenceStore(getPreferenceStore());
|
43
|
advanced.load();
|
44
|
Label mediaView = new Label(top, SWT.NULL);
|
45
|
mediaView.setText("Media View");
|
46
|
preview = new BooleanFieldEditor(PreferencesUtil.createPreferenceString(IPreferenceKeys.SHOW_MEDIA_PREVIEW),
|
47
|
Messages.MediaPreferences_preview,
|
48
|
top);
|
49
|
preview.setPreferenceStore(getPreferenceStore());
|
50
|
preview.load();
|
51
|
return top;
|
52
|
|
53
|
}
|
54
|
|
55
|
@Override
|
56
|
protected void performDefaults() {
|
57
|
advanced.presentsDefaultValue();
|
58
|
preview.presentsDefaultValue();
|
59
|
super.performDefaults();
|
60
|
}
|
61
|
|
62
|
|
63
|
|
64
|
|
65
|
}
|