import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
-import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
protected ICdmDetailElement<ENTITY> detailElement;
- /**
- * <p>
- * Constructor for AbstractCdmDetailSection.
- * </p>
- *
- * @param formFactory
- * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
- * object.
- * @param conversation
- * a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
- * object.
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param selectionProvider
- * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
- * @param style
- * a int.
- * @param <ENTITY>
- * a ENTITY object.
- */
public AbstractCdmDetailSection(CdmFormFactory formFactory,
ConversationHolder conversation, ICdmFormElement parentElement,
ISelectionProvider selectionProvider, int style) {
}
}
- /**
- * @param abstractCdmDetailSection
- * @param definedTermClass
- * @param null1
- */
protected void createControlsByType(AbstractCdmDetailSection<ENTITY> formElement, Class<ENTITY> entityClass, int style) {
TableWrapLayout layout = (TableWrapLayout) getLayoutComposite().getLayout();
layout.topMargin = 10;
- layout.numColumns = 2;
+ layout.numColumns = DEFAULT_NUM_COLUMNS;
getLayoutComposite().setLayout(layout);
if(entityClass==null){
}
}
-
- /**
- * <p>
- * createControls
- * </p>
- *
- * @param formElement
- * a
- * {@link eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection}
- * object.
- * @param style
- * a int.
- */
protected void createControls(AbstractCdmDetailSection<ENTITY> formElement, int style) {
createControlsByType(formElement, null, style);
}
return createCdmDetailElement(parentElement, style);
}
- /**
- * <p>
- * getHeading
- * </p>
- *
- * @return the heading for this section
- */
public abstract String getHeading();
/** {@inheritDoc} */
super.dispose();
}
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.forms.section.AbstractEditorFormSection#setBackground
- * (org.eclipse.swt.graphics.Color)
- */
/** {@inheritDoc} */
@Override
public void setBackground(Color color) {
super.setBackground(color);
}
- /**
- * <p>
- * setEntity
- * </p>
- *
- * @param entity
- * a ENTITY object.
- */
@Override
public void setEntity(ENTITY entity) {
if (detailElement != null) {
layout();
}
- /**
- * <p>
- * setSectionTitle
- * </p>
- */
protected void setSectionTitle() {
String title = "";
- if (getEntity() != null && (getEntity() instanceof IdentifiableEntity)) {
+ if (getEntity() != null && (getEntity() instanceof IdentifiableEntity) && !(getEntity() instanceof SpecimenOrObservationBase)) {
title = ": " + ((IdentifiableEntity) getEntity()).getTitleCache();
+ // we have to duplicate ampersands otherwise they are treated as
+ // mnenomic (see Label.setText() documentation)
+ // see also #4302
+ title = title.replace("&", "&&");
}
this.setText(String.format("%s%s", getHeading(), title));
setTextClient(createToolbar());
}
- /**
- * @return
- */
protected Control createToolbar() {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
return toolBarManager.createControl(this);
}
- /**
- * <p>
- * updateTitle
- * </p>
- */
public void updateTitle() {
if (!isDisposed()) {
setSectionTitle();