/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
package eu.etaxonomy.taxeditor.preference;
-import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
* @created 20.05.2008
* @version 1.0
*/
-public class DescriptionPreferences extends PreferencePage implements
+public class DescriptionPreferences extends FieldEditorPreferencePage implements
IWorkbenchPreferencePage {
/** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.preferences.desc"{trunked}</code> */
public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.preferences.description";
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
+
/** {@inheritDoc} */
@Override
protected Control createContents(Composite parent) {
-
+
Composite container = new Composite(parent, SWT.NULL);
container.setLayout(new GridLayout());
return container;
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
/** {@inheritDoc} */
- public void init(IWorkbench workbench) {
+ @Override
+ public void init(IWorkbench workbench) {
}
+
+ @Override
+ protected void createFieldEditors() {
+ addField(new BooleanFieldEditor(IPreferenceKeys.SHOW_VOCABULARY_ID_FOR_TERM_LABELS,
+ "Show vocabulary id for term labels.",
+ getFieldEditorParent()));
+ }
}
public static final String SHOW_DEBUG_INFORMATION = "eu.etaxonomy.taxeditor.showDebugInformation";
/**
- * Whether to show UUID and database id in the supplemental data view.
+ * Whether to show database id in the entity selection dialogs.
*/
public static final String SHOW_ID_IN_ENTITY_SELECTION_DIAOLOG = "eu.etaxonomy.taxeditor.showIdInEntitySelectionDiaolog";
+ /**
+ * Whether to show vocabulary of the term when displaying it's label.
+ */
+ public static final String SHOW_VOCABULARY_ID_FOR_TERM_LABELS = "eu.etaxonomy.taxeditor.showVocabularyIdForTermLabels";
+
/**
*
*/
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.store.CdmStore;
return "";
}else{
String termLabel = term.getLabel(CdmStore.getDefaultLanguage());
- if(term.getVocabulary()!=null){
+ if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_VOCABULARY_ID_FOR_TERM_LABELS)
+ && term.getVocabulary()!=null){
termLabel += " ["+term.getVocabulary().getLabel(CdmStore.getDefaultLanguage())+"]";
}
return termLabel;