/**
* 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.
*/
* @version 1.0
*/
public abstract class AbstractDateComparator<T extends ICdmBase> implements Comparator<T>{
-
- public int compare(T o1, T o2) {
+
+ @Override
+ public int compare(T o1, T o2) {
+ if (o1.equals(o2)){
+ return 0;
+ }
+
return getDate(o1).compareTo(getDate(o2));
};
-
+
protected abstract DateTime getDate(T object);
}
RemoteInvocationResult rir = fromCache(currentRemoteInvocation);
if(rir == null) {
- logger.info("Remote invoking : " + currentRemoteInvocation.getMethodName() + "@" + config.getServiceUrl());
- rir = super.doExecuteRequest(config, baos);
+
+ if (!(currentRemoteInvocation.getMethodName() == null) && !(config.getServiceUrl() == null)){
+ // logger.info("Remote invoking : " + currentRemoteInvocation.getMethodName() + "@" + config.getServiceUrl());
+ }
+ rir = super.doExecuteRequest(config, baos);
if(rir.getValue() != null && !rir.hasException()) {
+ if (currentRemoteInvocation == null){
+ logger.debug("return RemoteInvocationResult without caching" );
+ return rir;
+ }
if(cachableMethods.contains(currentRemoteInvocation.getMethodName())) {
rir = new RemoteInvocationResult(cdmEntitySessionManager.load(rir.getValue(), true));
} else if(rir.getValue() instanceof UpdateResult){
/**
* 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.
*/
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.MouseAdapter;
* The <code>IManagedForm</code> can also used for drawing borders by calling
* the method <code>createBorderSupport()</code>.
* </p>
- *
+ *
* @author p.ciardelli
* @author n.hoffmann
* @created 02.06.2008
* <p>
* Constructor for AbstractGroupedContainer.
* </p>
- *
+ *
* @param editor
* a {@link eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor}
* object.
protected void createListener() {
nameCompositeModifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
+ @Override
+ public void modifyText(ModifyEvent e) {
// mark the composite dirty
setDirty(true);
// parse the text
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt
* .events.FocusEvent)
* <p>
* getEmptyTextPrompt
* </p>
- *
+ *
* @return a {@link java.lang.String} object.
*/
protected String getEmptyTextPrompt() {
}
/**
- *
+ *
*/
private void showNameRelations() {
TaxonNameBase<?, ?> name = getName();
}
/**
- *
+ *
*/
public void showAnnotations() {
}
/**
- *
+ *
*/
private void showParsingProblems() {
String text = getNameViewer().getTextWidget().getText();
* <p>
* handleSplitText
* </p>
- *
+ *
* @param text
* a {@link java.lang.String} object.
*/
/**
* Refreshes the display with latest data from the model.
- *
+ *
* Note: Will not parse the text and not calculate errors!
*/
- public void refresh() {
+ @Override
+ public void refresh() {
// showNameRelations();
String text = NameHelper.getDisplayNameWithRef(getTaxonBase());
}
/**
- *
+ *
*/
protected abstract void updateIcon();
protected abstract void updateNonEditableInfo();
/**
- *
+ *
*/
private void enableFreeText() {
setEnabled(isFreetextEditingAllowed());
/**
* Checks whether the freetext should be editable based on specific empty
* fields.
- *
+ *
* @return
*/
private boolean isFreetextEditingAllowed() {
}
/**
- * Checks whether there are more than one, non-orphaned taxon bases
+ * Checks whether there are more than one, non-orphaned taxon bases
* attached to the taxon name
- *
+ *
* @return
*/
private boolean isNameUsedMultipleTimes() {
-
+
Set<TaxonBase> taxonBases = getName().getTaxonBases();
Iterator<TaxonBase> tbItr = taxonBases.iterator();
int nonOrphanedTaxonBaseCount = taxonBases.size();
-
+
while(tbItr.hasNext()) {
- TaxonBase tb = tbItr.next();
+ TaxonBase tb = tbItr.next();
if(tb.isOrphaned()) {
nonOrphanedTaxonBaseCount--;
}
* <p>
* getTaxonBase
* </p>
- *
+ *
* @return the taxonBase
*/
public T getTaxonBase() {
* <p>
* getName
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object.
*/
public TaxonNameBase getName() {
- return (TaxonNameBase) HibernateProxyHelper.deproxy(getTaxonBase()
+ return HibernateProxyHelper.deproxy(getTaxonBase()
.getName());
}
* <p>
* Getter for the field <code>group</code>.
* </p>
- *
+ *
* @return a
* {@link eu.etaxonomy.taxeditor.editor.name.container.AbstractGroup}
* object.
* <p>
* Getter for the field <code>control</code>.
* </p>
- *
+ *
* @return a {@link org.eclipse.swt.widgets.Composite} object.
*/
public Composite getControl() {
* <p>
* setIcon
* </p>
- *
+ *
* @param icon
* a {@link org.eclipse.swt.graphics.Image} object.
*/
* <p>
* setIndent
* </p>
- *
+ *
* @param indent
* a int.
*/
* <p>
* isSelected
* </p>
- *
+ *
* @return a boolean.
*/
public boolean isSelected() {
* <p>
* colorSelected
* </p>
- *
+ *
* @param mode
* a int.
*/
Display display = Display.getCurrent();
Runnable runnable = new Runnable() {
- public void run() {
+ @Override
+ public void run() {
getEditor().getManagedForm().setInput(selection);
}
};
* <p>
* setBackground
* </p>
- *
+ *
* @param color
* a {@link org.eclipse.swt.graphics.Color} object.
*/
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.swt.widgets.Control#setFont(org.eclipse.swt.graphics.Font)
*/
* <p>
* setFont
* </p>
- *
+ *
* @param font
* a {@link org.eclipse.swt.graphics.Font} object.
*/
* <p>
* Getter for the field <code>nameViewer</code>.
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.taxeditor.editor.name.container.NameViewer}
* object.
*/
* If <code>textViewer</code> has already been set, it will show a
* <code>prompt</code> along the lines of
* "Click here to start entering data" when empty.
- *
+ *
* @param prompt
* a {@link java.lang.String} object.
*/
setFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
+ @Override
+ public void focusGained(FocusEvent e) {
if (document.get().equals(prompt)) {
textControl.setFont(getViewerFont());
document.set(""); //$NON-NLS-1$
}
}
- public void focusLost(FocusEvent e) {
+ @Override
+ public void focusLost(FocusEvent e) {
if (document.getLength() == 0) {
initEmptyText();
}
* <p>
* getViewerFont
* </p>
- *
+ *
* @return a {@link org.eclipse.swt.graphics.Font} object.
*/
abstract protected Font getViewerFont();
* <p>
* Setter for the field <code>focusListener</code>.
* </p>
- *
+ *
* @param focusListener
* a {@link org.eclipse.swt.events.FocusListener} object.
*/
* <p>
* setDirty
* </p>
- *
+ *
* @param isDirty
* a boolean.
*/
* <p>
* isDirty
* </p>
- *
+ *
* @return a boolean.
*/
- public boolean isDirty() {
+ @Override
+ public boolean isDirty() {
return isDirty;
}
* <p>
* setMenu
* </p>
- *
+ *
* @param menu
* a {@link org.eclipse.swt.widgets.Menu} object.
*/
* <p>
* setDraggableControl
* </p>
- *
+ *
* @param controls
* an array of {@link org.eclipse.swt.widgets.Control} objects.
*/
* <p>
* setIsDraggable
* </p>
- *
+ *
* @param draggable
* a boolean.
*/
* nonEditableInfo is a label displayed underneath a GroupedComposite's
* input field. For instance, NameComposites display things like name
* relations, sec. references, etc. here.
- *
+ *
* @param info
* the text to display in the label
* @param append
* <p>
* Getter for the field <code>data</code>.
* </p>
- *
+ *
* @return a T object.
*/
- public T getData() {
+ @Override
+ public T getData() {
return data;
}
* <p>
* Setter for the field <code>data</code>.
* </p>
- *
+ *
* @param data
* a T object.
*/
public void setData(T data) {
- this.data = (T) HibernateProxyHelper.deproxy(data);
+ this.data = HibernateProxyHelper.deproxy(data);
}
/**
};
getNameViewer().getTextWidget().addVerifyListener(lineBreakListener);
-
+
}
abstract class LabelEllipsisListener extends ControlAdapter {
* <p>
* Setter for the field <code>group</code>.
* </p>
- *
+ *
* @param group
* a
* {@link eu.etaxonomy.taxeditor.editor.name.container.AbstractGroup}
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.ui.forms.IFormPart#initialize(org.eclipse.ui.forms.IManagedForm
* )
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.forms.IFormPart#dispose()
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.forms.IFormPart#commit(boolean)
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.forms.IFormPart#setFormInput(java.lang.Object)
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.forms.IFormPart#setFocus()
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.forms.IFormPart#isStale()
*/
@Override
public boolean isStale() {
return false;
}
-
+
public void setDisabled(boolean disabled) {
this.enabled = !disabled;
setEnabled(enabled);
}
-
+
public void setEnabled(boolean enabled) {
this.enabled = enabled;
Color color = enabled ? control.getForeground() : EditorUtil.getColor(Resources.COLOR_DISABLED_EDITOR);
-
+
getNameViewer().getTextWidget().setEditable(enabled);
getNameViewer().getTextWidget().setEnabled(enabled);
getNameViewer().getTextWidget().setForeground(color);
}
-
+
public boolean isEnabled(){
return enabled;
}
public class TaxonNodeNavigatorComparator extends ViewerComparator{
+ Comparator<TaxonNode> comparator;
public TaxonNodeNavigatorComparator(Comparator<TaxonNode> comparator){
- super(comparator);
+ super();
+ this.comparator = comparator;
}
if (e1 instanceof Classification && e2 instanceof Classification){
return ((Classification)e1).getTitleCache().compareTo(((Classification)e2).getTitleCache());
} else{
- if (this.getComparator() instanceof TaxonNaturalComparator){
- return this.getComparator().compare((TaxonNode)e1, (TaxonNode)e2);
- }else{
- return this.getComparator().compare(e1,e2);
- }
+ return comparator.compare((TaxonNode)e1, (TaxonNode)e2);
+
}
}
}
import eu.etaxonomy.cdm.model.description.Distribution;
import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
+import eu.etaxonomy.cdm.model.description.KeyStatement;
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
import eu.etaxonomy.cdm.model.description.QuantitativeData;
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
*/
public static String getCache(DescriptionElementBase element,
Language language) {
-
+
String mainElementLabel= null;
DescriptionBase<?> descr = element.getInDescription();
+ descr = CdmBase.deproxy(descr, DescriptionBase.class);
+
if (descr != null){
if (descr.isInstanceOf(TaxonDescription.class)){
Taxon taxon = CdmBase.deproxy(descr, TaxonDescription.class).getTaxon();
}
}
}
-
+
+
String cache = null;
if (element instanceof TextData) {
- cache = ((TextData) element).getText(language);
+ //cache = ((TextData) element).getText(language);
+ cache = "Text Data";
}
if (element instanceof CommonTaxonName) {
cache = ((CommonTaxonName) element).getName();
try{
OriginalSourceBase<?> originalSource = (OriginalSourceBase<?>) element;
// ISourceable sourcedObject = originalSource.getSourcedObj();
- //due to #5743 the bidirectionality for sourced object had to be removed
+ //due to #5743 the bidirectionality for sourced object had to be removed
String sourceObjectTitle = "sourced object data not available (#5743)";
// if(sourcedObject instanceof IIdentifiableEntity){
// sourceObjectTitle = ((IdentifiableEntity) sourcedObject).getTitleCache();
}else if (element instanceof Group) {
Group group = (Group) element;
return group.getName();
- }else{
+ }else if (element instanceof KeyStatement) {
+ KeyStatement keyStatement = (KeyStatement) element;
+ return getCache(keyStatement);
+ }else{
// TODO write return texts for HomotypicalGroup, etc.
return element.toString();
}
if (StringUtils.isBlank(taxonStr)){
taxonStr = "no or unlabled taxon";
}
-
-
+
+
//unit
SpecimenOrObservationBase<?> unit = detEvent.getIdentifiedUnit();
String unitStr;
}else{
unitStr = "no unit";
}
-
+
String result = CdmUtils.concat(" determined as ", unitStr, taxonStr);
return result;
}
}
result = CdmUtils.concat(": ", result, parentStr);
-
+
return result;
}
if (designation.isInstanceOf(SpecimenTypeDesignation.class)){
to = ((SpecimenTypeDesignation)designation).getTypeSpecimen();
}else if (designation.isInstanceOf(NameTypeDesignation.class)){
- to = ((NameTypeDesignation)designation).getTypeName();
+ to = ((NameTypeDesignation)designation).getTypeName();
}else{
throw new RuntimeException("Type Designation class not supported: " + designation.getClass().getName());
}
for (TaxonNameBase<?,?> name : from){
CdmUtils.concat(",", fromString, name.getTitleCache());
}
- String result = CdmUtils.concat(" ", new String[]{from == null ? null : fromString,
+ String result = CdmUtils.concat(" ", new String[]{from == null ? null : fromString,
typeLabel, to == null? null : to.getTitleCache()});
return result;
}
if (StringUtils.isBlank(typeLabel)){
typeLabel = "->";
}
- String result = CdmUtils.concat(" ", new String[]{from == null ? null : from.getTitleCache(),
+ String result = CdmUtils.concat(" ", new String[]{from == null ? null : from.getTitleCache(),
typeLabel, to == null? null : to.getTitleCache()});
return result;
}
-
+
private static String getCache(HomotypicalGroup hg) {
String result = "";
return result;
}
+ private static String getCache(KeyStatement ks) {
+ String result = "";
+
+ result = "KeyStatement";
+
+ return result;
+ }
+
/**
* <p>getObjectClassname</p>
*
private boolean isRankActivated = true;
private boolean isAtomisedEpithetsActivated = true;
private boolean isAuthorshipSectionActivated = true;
+ private boolean isAuthorCacheActivated = true;
private boolean isNomenclaturalReferenceSectionActivated = true;
private boolean isNomenclaturalStatusSectionActivated = true;
private boolean isTypeDesignationSectionActivated = true;
StringBuffer result = new StringBuffer();
//the preference value is build like this:
//<section1>:true;<section2>:false....
+ result.append("simpleViewActivated");
+ result.append(":");
+ result.append(this.isSimpleDetailsViewActivated);
+ result.append(";");
+
result.append("taxon");
result.append(":");
result.append(this.isTaxonSectionActivated);
return result.toString();
}
+ /**
+ * @return the isAuthorCacheActivated
+ */
+ public boolean isAuthorCacheActivated() {
+ return isAuthorCacheActivated;
+ }
+
+ /**
+ * @param isAuthorCacheActivated the isAuthorCacheActivated to set
+ */
+ public void setAuthorCacheActivated(boolean isAuthorCacheActivated) {
+ this.isAuthorCacheActivated = isAuthorCacheActivated;
+ }
+
}
package eu.etaxonomy.taxeditor.preference;
+import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.jface.preference.PreferencePage;
public class NameDetailsViewConfiguration extends PreferencePage implements IWorkbenchPreferencePage {
Composite child ;
@Override
public void init(IWorkbench workbench) {
-
+
}
/*
*/
@Override
protected Control createContents(Composite parent) {
-
+
Composite composite = new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout());
+
+ //boolean isAllowOverride = PreferencesUtil
isSimpleDetailsViewActivated = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION);
final Button activateCheckButton = new Button(composite, SWT.CHECK);
activateCheckButton.setText("Show only a simple name details view");
}
}
});
-
+
child = new Composite(composite, SWT.NULL);
child.setLayout(new GridLayout());
child.setVisible(isSimpleDetailsViewActivated);
-
+
final Button showTaxon = new Button(child, SWT.CHECK);
boolean isShowTaxon = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON);
showTaxon.setText("Show taxon of the name");
PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON, isShowTaxon);
}
});
-
+
final Button showLsid = new Button(child, SWT.CHECK);
boolean isShowLSID = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID);
showLsid.setText("Show Lsid of the name");
PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID, isShowLSID);
}
});
-
+
final Button showNomenclaturalCode = new Button(child, SWT.CHECK);
boolean isShowNomenclaturalCode = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE);
showNomenclaturalCode.setText("Show the nomenclatural code");
PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE, isShowNomenclaturalCode);
}
});
-
+
final Button showNameCache = new Button(child, SWT.CHECK);
boolean isShowNameCache = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE);
showNameCache.setText("Show nameCache of the name (only the scientific name without the author and year)");
@Override
public void widgetSelected(SelectionEvent e) {
boolean isShowAppendedPhrase = showAppendedPhrase.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE, isShowAppendedPhrase);
+ PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE, isShowAppendedPhrase);
}
});
-
+
final Button showRank = new Button(child, SWT.CHECK);
boolean isShowRank = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK);
showRank.setText("Show rank of the name");
PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP, isShowAuthorship);
}
});
-
+
final Button showNomenclaturalRef = new Button(child, SWT.CHECK);
boolean isShowNomenclaturalRef = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE);
showNomenclaturalRef.setText("Show nomenclatural reference section");
PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE, isShowNomenclaturalRef);
}
});
-
+
final Button showNomenclaturalStatus = new Button(child, SWT.CHECK);
boolean isShowNomenclaturalStatus = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS);
showNomenclaturalStatus.setText("Show nomenclatural status section");
PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS, isShowNomenclaturalStatus);
}
});
-
+
final Button showProtologue = new Button(child, SWT.CHECK);
boolean isShowProtologue = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE);
showProtologue.setText("Show protologue section");
PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE, isShowProtologue);
}
});
-
+
final Button showTypeDesignation = new Button(child, SWT.CHECK);
boolean isShowTypeDesignation = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION);
showTypeDesignation.setText("Show name type designation section");
PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION, isShowTypeDesignation);
}
});
-
-
+
+
final Button showNameRelationship = new Button(child, SWT.CHECK);
boolean isShowNameRelationship = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP);
showNameRelationship.setText("Show name relationship section");
@Override
public void widgetSelected(SelectionEvent e) {
boolean isShowNameRelationship = showNameRelationship.getSelection();
- PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION, isShowNameRelationship);
+ PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP, isShowNameRelationship);
}
});
-
+
if(isSimpleDetailsViewActivated){
child.setEnabled(true);
}else{
return composite;
-
+
}
getPreferenceStore().setDefault(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE, false);
getPreferenceStore().setDefault(CHECKLIST_ID_IN_VOCABULARY, true);
getPreferenceStore().setDefault(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS, true);
+ getPreferenceStore().setDefault(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE, true);
getPreferenceStore().setDefault(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP, true);
getPreferenceStore().setDefault(SHOW_NAME_DETAILS_SECTION_HYBRID, true);
getPreferenceStore().setDefault(SHOW_NAME_DETAILS_SECTION_LSID, true);
toggleable_cache = formFactory.createToggleableTextField(this,
"Authorship Cache", entity.getAuthorshipCache(),
entity.isProtectedAuthorshipCache(), style);
- toggleable_cache.setVisible(false);
-
- }
+ addElement(toggleable_cache);
+ }
NomenclaturalCode code = entity.getNomenclaturalCode();
if (isAdvancedView || PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP)){
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.taxeditor.model.ImageResources;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
-import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.ui.dialog.selection.NameSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
protected Control createToolbar() {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
- if(nameChoosable && !PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
+ if(nameChoosable ){
//choose name
Action chooseNameAction = new Action("Choose Name", IAction.AS_PUSH_BUTTON){
@Override