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;
}
}
-
- /**
- * <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) && !(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();
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
/**
- * <p>AuthorshipDetailSection class.</p>
- *
* @author n.hoffmann
* @created 05.06.2009
* @version 1.0
private TaxonBase taxonBase;
- /**
- * <p>Constructor for AuthorshipDetailSection.</p>
- *
- * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
- * @param style a int.
- * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
- * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
- * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
- */
public AuthorshipDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
ISelectionProvider selectionProvider, int style) {
super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
}
- /**
- * {@inheritDoc}
- *
- * Author title is not in titleCache field
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#setSectionTitle()
- */
- @Override
- protected void setSectionTitle() {
- if(getEntity() != null){
- String title = getHeading() + ": " + getEntity().getAuthorshipCache();
- // we have to duplicate ampersands otherwise they are treated as
- // mnenomic (see Label.setText() documentation)
- // see also #4302
- title = title.replace("&", "&&");
- this.setText(title);
- }
- }
-
/** {@inheritDoc} */
@Override
public void setTaxonBase(TaxonBase entity) {
setEntity(name);
}
- /*
- * (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.forms.section.cdmdetail.AbstractCdmDetailSection#getHeading()
- */
/** {@inheritDoc} */
@Override
public String getHeading() {
return "Authorship";
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
- */
@Override
public TaxonBase getTaxonBase() {
return taxonBase;
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
- */
@Override
protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
return formFactory.createAuthorshipDetailElement(parentElement, style);
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
/**
- * <p>NonViralNameDetailSection class.</p>
- *
* @author n.hoffmann
* @created May 20, 2010
* @version 1.0
super(formFactory, conversation, parentElement, selectionProvider, style);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#createToolbar()
- */
@Override
protected Control createToolbar() {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
}
- /**
- * @param nonViralName
- *
- */
private boolean checkForMultipleNameUsages(NonViralName nonViralName) {
return nonViralName.getTaxonBases().size() != 1;
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
- */
/** {@inheritDoc} */
@Override
public String getHeading() {
return "Name";
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#setTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
- */
/** {@inheritDoc} */
@Override
public void setTaxonBase(TaxonBase taxon) {
setEntity(name);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#setSectionTitle()
- */
- @Override
- protected void setSectionTitle() {
- super.setSectionTitle();
- String title = getText();
- // we have to duplicate ampersands otherwise they are treated as
- // mnenomic (see Label.setText() documentation)
- // see also #4302
- title = title.replace("&", "&&");
- setText(title);
- }
-
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
- */
@Override
public TaxonBase getTaxonBase() {
return taxonBase;
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
- */
@Override
protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
return formFactory.createNonViralNameDetailElement(parentElement);
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
/**
- * <p>TaxonBaseDetailSection class.</p>
- *
* @author n.hoffmann
* @created Nov 4, 2009
* @version 1.0
*/
public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase> {
- /**
- * <p>Constructor for TaxonBaseDetailSection.</p>
- *
- * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
- * @param style a int.
- * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
- * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
- * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
- */
public TaxonBaseDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
}
return getEntity() != null ? getEntity().getClass().getSimpleName() : "TaxonBase";
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
- */
@Override
protected AbstractCdmDetailElement<TaxonBase> createCdmDetailElement(AbstractCdmDetailSection<TaxonBase> parentElement, int style) {
return formFactory.createTaxonBaseDetailElement(parentElement, style);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#setSectionTitle()
- */
- @Override
- protected void setSectionTitle() {
- super.setSectionTitle();
- String title = getText();
- // we have to duplicate ampersands otherwise they are treated as
- // mnenomic (see Label.setText() documentation)
- // see also #4302
- title = title.replace("&", "&&");
- setText(title);
- }
-
}