* @author n.hoffmann
* @created Sep 10, 2009
*/
-public class AgentSelectionDialog<T extends AgentBase> extends
- AbstractFilteredCdmResourceSelectionDialog {
+public class AgentSelectionDialog<T extends AgentBase>
+ extends AbstractFilteredCdmResourceSelectionDialog<T> {
protected static final String PERSON = "New Person";
protected static final String TEAM = "New Team";
* @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
* @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
*/
- public static AgentBase select(Shell shell, //ConversationHolder conversation,
- AgentBase entity, boolean selectTeamMember) {
- AgentSelectionDialog dialog = new AgentSelectionDialog(shell, //conversation,
+ public static <S extends AgentBase> S select(Shell shell,
+ S entity, boolean selectTeamMember) {
+ AgentSelectionDialog<S> dialog = new AgentSelectionDialog<>(shell,
"Choose Agent", false, AgentSelectionDialog.class.getCanonicalName(), entity, selectTeamMember);
- return (AgentBase) getSelectionFromDialog(dialog);
+ return getSelectionFromDialog(dialog);
}
/**
* @param settings a {@link java.lang.String} object.
*/
protected AgentSelectionDialog(Shell shell,
- String title, boolean multi, String settings, AgentBase agent, boolean selectTeamMember) {
- super(shell,
- title, multi, settings, agent);
+ String title, boolean multi, String settings, T agent, boolean selectTeamMember) {
+ super(shell, title, multi, settings, agent);
this.selectTeamMember = selectTeamMember;
}
public class DetailsLabelProvider extends LabelProvider {
@Override
public String getText(Object element) {
- AgentBase agent = (AgentBase) getCdmObjectByUuid(((UuidAndTitleCache<AgentBase>) element).getUuid());
+ T agent = getCdmObjectByUuid(((UuidAndTitleCache<AgentBase>) element).getUuid());
if (agent instanceof INomenclaturalAuthor) {
return "Nomenclatural title: '" + ((INomenclaturalAuthor) agent).getNomenclaturalTitle() + "'";
} else {
}
@Override
- protected AgentBase getPersistentObject(UUID cdmUuid) {
- return CdmStore.getService(IAgentService.class).load(cdmUuid);
+ protected T getPersistentObject(UUID cdmUuid) {
+ return (T)CdmStore.getService(IAgentService.class).load(cdmUuid);
}
@Override
if (this.selectTeamMember){
result = new String[1];
result[0] = PERSON;
-
}else{
result = new String[2];
result[0] = PERSON;
@Override
protected void callService(String pattern) {
- model = CdmStore.getService(IAgentService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
+ Class<T> clazz = (Class)AgentBase.class;
+ model = CdmStore.getService(IAgentService.class).getUuidAndTitleCache(clazz, limitOfInitialElements, pattern);
}
}
\ No newline at end of file
import java.text.Collator;
import java.util.Comparator;
+import java.util.List;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
*/
public class NomenclaturalAuthorSelectionDialog extends TeamOrPersonBaseSelectionDialog {
- protected NomenclaturalAuthorSelectionDialog(Shell shell, //ConversationHolder conversation,
+ protected NomenclaturalAuthorSelectionDialog(Shell shell,
String title,
boolean multi, String settings, TeamOrPersonBase<?> agent, boolean teamMemberSelection) {
super(shell, title, multi, settings, agent, teamMemberSelection);
@Override
protected void callService(String pattern) {
- model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(TeamOrPersonBase.class, limitOfInitialElements, pattern);
+ model = (List)CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(TeamOrPersonBase.class, limitOfInitialElements, pattern);
}
@Override
TeamOrPersonBase<?> entity, boolean teamMemberSelection) {
NomenclaturalAuthorSelectionDialog dialog = new NomenclaturalAuthorSelectionDialog(shell, //conversation,
"Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity, teamMemberSelection);
- return (TeamOrPersonBase<?>)getSelectionFromDialog(dialog);
+ return getSelectionFromDialog(dialog);
}
@Override
}
@Override
- protected Comparator<UuidAndTitleCache<?>> getItemsComparator() {
- return new Comparator<UuidAndTitleCache<?>>() {
+ protected Comparator<UuidAndTitleCache<TeamOrPersonBase<?>>> getItemsComparator() {
+ return new Comparator<UuidAndTitleCache<TeamOrPersonBase<?>>>() {
@Override
- public int compare(UuidAndTitleCache<?> entity1,
- UuidAndTitleCache<?> entity2) {
+ public int compare(UuidAndTitleCache<TeamOrPersonBase<?>> entity1,
+ UuidAndTitleCache<TeamOrPersonBase<?>> entity2) {
if (entity1.getUuid().equals(entity2.getUuid())){
return 0;
compareString1 += entity1.getTitleCache();
}
-
String compareString2 = "";
if (entity2.getAbbrevTitleCache() != null){
compareString2 = entity2.getAbbrevTitleCache();
*/
package eu.etaxonomy.taxeditor.ui.dialog.selection;
+import java.util.List;
+
import org.eclipse.swt.widgets.Shell;
import eu.etaxonomy.cdm.api.service.IAgentService;
TeamOrPersonBase entity, boolean teamMemberSelection) {
NomenclaturalPersonAuthorSelectionDialog dialog = new NomenclaturalPersonAuthorSelectionDialog(shell, //conversation,
"Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity,teamMemberSelection);
- return (TeamOrPersonBase)getSelectionFromDialog(dialog);
+ return getSelectionFromDialog(dialog);
}
@Override
protected void callService(String pattern) {
- model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(Person.class, limitOfInitialElements, pattern);
+ model = (List)CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(Person.class, limitOfInitialElements, pattern);
}
}
*/
package eu.etaxonomy.taxeditor.ui.dialog.selection;
+import java.util.List;
+
import org.eclipse.swt.widgets.Shell;
import eu.etaxonomy.cdm.api.service.IAgentService;
TeamOrPersonBase<?> entity, boolean selectTeamMember) {
TeamOrPersonBaseSelectionDialog dialog = new TeamOrPersonBaseSelectionDialog(shell,
"Choose Team or Person", false, TeamOrPersonBaseSelectionDialog.class.getCanonicalName(), entity, selectTeamMember);
- return (TeamOrPersonBase<?>)getSelectionFromDialog(dialog);
+ return getSelectionFromDialog(dialog);
}
@Override
protected void callService(String pattern) {
- model = CdmStore.getService(IAgentService.class).getUuidAndTitleCache(Team.class, limitOfInitialElements, pattern);
- model.addAll( CdmStore.getService(IAgentService.class).getUuidAndTitleCache(Person.class,limitOfInitialElements, pattern));
+ model = (List)CdmStore.getService(IAgentService.class).getUuidAndTitleCache(Team.class, limitOfInitialElements, pattern);
+ model.addAll((List)CdmStore.getService(IAgentService.class).getUuidAndTitleCache(Person.class,limitOfInitialElements, pattern));
}
+ @Override
protected String getTitle(TeamOrPersonBase<?> cdmObject) {
if(cdmObject == null){
return "";
/**
+ * Copyright (C) 2007 EDIT
+ * 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.ui.element;
*
* @author n.hoffmann
* @created Feb 22, 2010
- * @param <T>
*/
//TODO shouldn't ENTITY be bound with super class ICdmBase for example (AbstractFormSection<ENTITY extends ICdmBase>)?
public abstract class AbstractFormSection<ENTITY>
return element;
}
- public ReferenceDetailElement createReferenceDetailElement(ICdmFormElement parentElement, int style, boolean isWizard){
- ReferenceDetailElement element = new ReferenceDetailElement(this, parentElement, style, isWizard);
+ public ReferenceDetailElement createReferenceDetailElement(ICdmFormElement parentElement, int style){
+ ReferenceDetailElement element = new ReferenceDetailElement(this, parentElement, style);
addAndAdaptElement(parentElement, element);
return element;
}
return section;
}
-
public AbstractEntityCollectionElement createEntityCollectionElement(AbstractFormSection parentElement,
Object versionableEntity, SelectionListener removeListener, Color backgroundColor, int style) {
AbstractEntityCollectionElement<?> element = null;
+/**\r
+* Copyright (C) 2018 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
package eu.etaxonomy.taxeditor.ui.element;\r
\r
import org.eclipse.jface.util.PropertyChangeEvent;\r
}\r
\r
/**\r
- * <p>\r
* Constructor for DateDetailSection.\r
- * </p>\r
- *\r
- * @param formFactory\r
- * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}\r
- * object.\r
- * @param parentElement\r
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}\r
- * object.\r
- * @param style\r
- * a int.\r
*/\r
protected DateDetailSection(CdmFormFactory formFactory,\r
ICdmFormElement parentElement, boolean includeVerbatim, int style) {\r
LayoutConstants.FILL_HORIZONTALLY(6, 1));\r
}\r
\r
-\r
-\r
text_freeText = formFactory.createTextWithLabelElement(this,\r
"Freetext", null, style);\r
text_freeText.getMainControl().setLayoutData(\r
\r
\r
/**\r
- * <p>\r
* Setter for the field <code>timePeriod</code>.\r
- * </p>\r
- *\r
- * @param timePeriod\r
- * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.\r
*/\r
@Override\r
public void setEntity(T timePeriod) {\r
}\r
\r
/**\r
- * When setting the entity through parsing we do not want to alter the parse field\r
- * @param timePeriod\r
+ * When setting the entity through parsing we do not want\r
+ * to alter the parse field\r
*/\r
protected void setEntityInternally(T timePeriod){\r
Partial start = timePeriod.getStart();\r
super.setEntity(timePeriod);\r
}\r
\r
- /** {@inheritDoc} */\r
@Override\r
public void propertyChange(PropertyChangeEvent event) {\r
if (event == null) {\r
}\r
}\r
\r
- /**\r
- * @param event\r
- */\r
private void handleException(CdmPropertyChangeEvent event) {\r
firePropertyChangeEvent(new CdmPropertyChangeEvent(this,\r
event.getException()));\r
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));\r
}\r
\r
-// protected abstract T parseNewInstance() ;\r
-\r
protected void updateTitle(){\r
String title = CdmUtils.Nz(getEntity().toString());\r
this.setText(title);\r
layout();\r
}\r
\r
- /** {@inheritDoc} */\r
@Override\r
public void dispose() {\r
formFactory.removePropertyChangeListener(this);\r
/**
* Basic implementation of {@link ICdmComposite}.
+ *
* @author pplitzner
* @date 11.02.2014
*
protected T controller;
- /**
- * @param parent
- * @param style
- */
public AbstractCdmComposite(Composite parent, int style) {
super(parent, style);
}
}
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.mvc.interfaces.CdmComposite#initController(eu.etaxonomy.taxeditor.ui.element.CdmFormFactory, eu.etaxonomy.taxeditor.ui.element.ICdmFormElement)
- */
@Override
public void initController(CdmFormFactory formFactory, ICdmFormElement parentElement) {
initInternalController(formFactory, parentElement);
initChildController(formFactory, parentElement);
}
- /**
- * @param formFactory
- * @param parentElement
- * @return
- */
protected abstract void initInternalController(CdmFormFactory formFactory, ICdmFormElement parentElement);
@Override
public T getController(){
return controller;
}
-
-}
+}
\ No newline at end of file
*/
package eu.etaxonomy.taxeditor.ui.mvc.element;
-
-
-
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
/**
* @author pplitzner
* @date 16.06.2014
- *
*/
public class DateElement extends AbstractCdmComposite<DateElementController> {
private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
private org.joda.time.DateTime initialDateTime;
- private Text textDate;
+ private final Text textDate;
private final Button openDateDialog;
private static final String pattern = "yyyy-MM-dd HH:mm";
/**
* Create the composite.
- * @param parent
- * @param style
*/
public DateElement(Composite parent, org.joda.time.DateTime initDateTime, String label, int style, boolean editableText) {
super(parent, style);
this.initialDateTime = initDateTime.toDateTime(DateTimeZone.UTC);
}
-
addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
// time.setSeconds(initialDateTime.getSecondOfMinute());
}
-
// new Label (dialog, SWT.NONE);
// new Label (dialog, SWT.NONE);
Button ok = new Button (dialog, SWT.PUSH);
return textDate;
}
-
-
-
public static org.joda.time.DateTime makeZonedTimeFromSWT(
org.eclipse.swt.widgets.DateTime widget,
org.eclipse.swt.widgets.DateTime dateTime) {
widget.setDay(dateTime.getDay());
widget.setHours(dateTime.getHours());
widget.setMinutes(dateTime.getMinutes());
-
}
public void setData (org.joda.time.DateTime data) {
*/
public abstract class AbstractCdmDetailSection<ENTITY>
extends AbstractFormSection<ENTITY>
- implements IEnableableFormElement, IExpansionListener, ICacheRelevantFormElement {
+ implements IEnableableFormElement, IExpansionListener {
protected AbstractCdmDetailElement<ENTITY> detailElement;
this(formFactory, null, conversation, parentElement, selectionProvider, style);
}
+ //TODO remove conversation
public AbstractCdmDetailSection(CdmFormFactory formFactory, Class<ENTITY> clazz,
ConversationHolder conversation, ICdmFormElement parentElement,
ISelectionProvider selectionProvider, int style) {
}
}
if(CdmUtils.isBlank(label)){
- label = ((IdentifiableEntity) getEntity()).getTitleCache();
+ label = ((IdentifiableEntity<?>) getEntity()).getTitleCache();
}
if(CdmUtils.isBlank(label)){
- label = ((IdentifiableEntity) getEntity()).generateTitle();
+ label = ((IdentifiableEntity<?>) getEntity()).generateTitle();
}
title = ": " + label;
}
}
}
- @Override
- public void updateCacheRelevance() {
- if (detailElement != null) {
- detailElement.updateCacheRelevance();
- }
- }
-
- @Override
- public void addDependsOnCache(ToggleableTextElement toggleElement) {
- if (detailElement != null) {
- detailElement.addDependsOnCache(toggleElement);
- }
- }
-
@Override
- public CacheRelevance cacheRelevance() {
- return detailElement.cacheRelevance();
+ public void setIrrelevant(boolean irrelevant) {
+ if (detailElement != null) {
+ detailElement.setIrrelevant(irrelevant);
+ }
}
@Override
* @author n.hoffmann
* @created Nov 16, 2009
*/
-public abstract class AbstractEntityCollectionElement<ENTITY> extends
- AbstractCdmFormElement implements IEntityElement<ENTITY>,
- SelectionListener, IConversationEnabled {
+public abstract class AbstractEntityCollectionElement<ENTITY>
+ extends AbstractCdmFormElement
+ implements IEntityElement<ENTITY>, SelectionListener,
+ IConversationEnabled {
protected ENTITY entity;
/**
* Create the elements to be shown in this section client area
*/
- private void renderContent(boolean forceExpansion)
- {
+ private void renderContent(boolean forceExpansion){
Collection<ELEMENT> collection = getCollection(getEntity());
if(collection == null || collection.isEmpty()){
/**
* Creates the widgets for the collection
- *
- * @param elements a {@link java.util.Collection} object.
*/
protected void createDynamicContents(Collection<ELEMENT> elements)
{
entityCollectionElement = formFactory.createEntityCollectionElement(this, element, removeListener, backgroundColor, SWT.NULL);
}
- /** {@inheritDoc} */
@Override
public void setBackground(Color color) {
if(label_empty != null && !label_empty.isDisposed()){
}
/**
- * <p>getTitleString</p>
- *
- * @return a {@link java.lang.String} object.
+ * getTitleString
*/
public String getTitleString() {
return CdmUtils.Nz(title);
}
/**
- * <p>setTitleString</p>
- *
- * @param title a {@link java.lang.String} object.
+ * setTitleString
*/
public void setTitleString(String title){
this.title = title;
layout();
}
- /** {@inheritDoc} */
@Override
public void expansionStateChanging(ExpansionEvent e) {
// logger.warn("Expansion State Changing");
}
- /** {@inheritDoc} */
@Override
public void expansionStateChanged(ExpansionEvent e) {
if(isExpanded()){
* 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.ui.section.agent;
import org.eclipse.swt.events.SelectionListener;
/**
* @author n.hoffmann
* @created Apr 30, 2010
- * @version 1.0
*/
public class TeamMemberElement extends AbstractEntityCollectionElement<Person> {
private EntitySelectionElement<Person> selection_person;
- private final boolean isNomenclatural;
public TeamMemberElement(CdmFormFactory cdmFormFactory,
AbstractFormSection section, Person entity,
SelectionListener removeListener, int style, boolean isNomenclatural) {
super(cdmFormFactory, section, entity, removeListener, null, style);
- this.isNomenclatural =isNomenclatural;
-
}
- /** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement element, int style) {
selection_person = formFactory
.createSelectionElement(Person.class,
- //getConversationHolder(),
this, "Person", null,
EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE,
style);
}
- /** {@inheritDoc} */
@Override
public void setEntity(Person entity) {
this.entity = entity;
selection_person.setEntity(entity);
}
- /** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
if (eventSource == selection_person) {
}
else{
//first remove the edited team member and then add it again
- //because the model allows the same person multiple time in on team
+ //because the model allows the same person multiple time in one team
team.removeTeamMember(getEntity());
team.addTeamMember(selection_person.getEntity(), index);
}
entity = selection_person.getEntity();
}
}
-}
+}
\ No newline at end of file
* @created Apr 30, 2010
*/
public class TeamMemberSection
- extends AbstractUnboundEntityCollectionSection<Team, Person>
- implements ICacheRelevantFormElement {
+ extends AbstractUnboundEntityCollectionSection<Team, Person> {
private boolean isNomenclaturalTeam = false;
@Override
public Comparator<Person> getComparator() {
return (p1, p2) -> {
- if(p1==null){
+ if (p1 == p2){
+ return 0;
+ }else if(p1==null){
return -1;
- }
- if(p2==null){
+ }else if(p2==null){
return 1;
}
+
List<Person> teamMembers = getEntity().getTeamMembers();
int indexOfP1 = teamMembers.indexOf(p1);
int indexOfP2 = teamMembers.indexOf(p2);
public boolean allowAddExisting() {
return false;
}
-
- @Override
- public void updateCacheRelevance() {
- System.out.println("setIrrelevant NOT YET implemented in " + this.getClass().getName());
- }
-
- @Override
- public void addDependsOnCache(ToggleableTextElement toggleElement) {
- System.out.println("addDependsOnCache NOT YET implemented in " + this.getClass().getName());
- }
-
- @Override
- public CacheRelevance cacheRelevance() {
- System.out.println("isCached NOT YET implemented in " + this.getClass().getName());
- return CacheRelevance.NONE;
- }
-
-
}
\ No newline at end of file
* 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.ui.section.description;
import java.util.ArrayList;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
/**
- * <p>ModifierElement class.</p>
+ * ModifierElement class.
*
* @author n.hoffmann
* @created Sep 15, 2010
- * @version 1.0
*/
public class ModifierElement extends AbstractEntityCollectionElement<DefinedTerm> {
super(formFactory, section, entity, removeListener, null, style);
}
- /** {@inheritDoc} */
@Override
public void setEntity(DefinedTerm entity) {
this.entity = entity;
}
}
- /** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement element, int style) {
combo_modifier = formFactory.createDefinedTermComboElement(TermType.Modifier, element, "Modifier", getEntity(), style);
}
- /** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
if(eventSource==combo_modifier && combo_modifier.getSelection()!=null){
}
}
}
-}
+}
\ No newline at end of file
* 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.ui.section.description.detail;
import org.eclipse.swt.SWT;
*
* @author n.hoffmann
* @created Jun 10, 2010
- * @version 1.0
*/
public abstract class AbstractDetailedDescriptionDetailElement<T extends DescriptionElementBase> extends AbstractCdmDetailElement<T>{
}
}
-}
+}
\ No newline at end of file
/**
+ * Copyright (C) 2007 EDIT
+ * 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.ui.section.media;
/**
* @author n.hoffmann
* @created Nov 17, 2009
- * @version 1.0
*/
public class MediaMetaElement extends AbstractEntityCollectionElement<Media> implements ISelectableElement, ITogglableMediaElement{
private TimePeriodElement mediaCreated;
private SelectionArbitrator selectionArbitrator;
-
public MediaMetaElement(CdmFormFactory cdmFormFactory,
AbstractFormSection<?> formElement, Media element,
SelectionListener removeListener, int style) {
if(cdmFormFactory.getSelectionProvider() != null){
selectionArbitrator = cdmFormFactory.createSelectionArbitrator(this);
}
-
-
}
- /** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement element, int style) {
// final IAction switchAction = MediaViewSwitch.createSwitch(MediaMetaElement.this);
text_description = formFactory.createLanguageStringWithLabelElement(element, "Description", null, 100, true, style);
-
-
mediaDetailElement = formFactory.createMediaDetailElement(element);
ICdmFormElement grandGrandParent = getParentElement().getParentElement().getParentElement();
- Class clazz = null;
+ Class<?> clazz = null;
if (grandGrandParent != null){
clazz = grandGrandParent.getClass();
}
addElement(mediaDetailElement);
}
- /** {@inheritDoc} */
@Override
public void setEntity(Media element) {
this.entity = element;
}
createTitle();
-
-
}
public void createTitle() {
text_title.setLanguageString(title);
}
-
-
@Override
protected Media selectFromDialog() {
mediaDetailElement.toggleAdvancedMediaView();
}
- /** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
if (eventSource == selection_artist) {
public MediaDetailElement getMediaDetailElement(){
return mediaDetailElement;
}
-
-
-
-}
+}
\ No newline at end of file
public AuthorshipDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
ISelectionProvider selectionProvider, int style) {
super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
-
}
@Override
* @author pplitzner
* @date 21.01.2014
*/
-public abstract class AbstractUnboundEntityCollectionSection<ENTITY, ELEMENT> extends AbstractEntityCollectionSection<ENTITY, ELEMENT> {
+public abstract class AbstractUnboundEntityCollectionSection<ENTITY, ELEMENT>
+ extends AbstractEntityCollectionSection<ENTITY, ELEMENT> {
private boolean addUnboundElement = false;
* 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.ui.section.occurrence.dna;
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
/**
- *
* @author pplitzner
* @date Oct 16, 2014
- *
- * @param <T>
*/
-public class SampleDesignationTextDetailElement extends
- AbstractEntityCollectionElement<Identifier> {
+public class SampleDesignationTextDetailElement
+ extends AbstractEntityCollectionElement<Identifier> {
protected TextWithLabelElement text_description;
- /**
- * @param formFactory
- * @param section
- * @param entity
- * @param removeListener
- * @param backgroundColor
- * @param style
- */
public SampleDesignationTextDetailElement(CdmFormFactory formFactory, AbstractFormSection<?> section,
Identifier entity, SelectionListener removeListener, Color backgroundColor, int style) {
super(formFactory, section, entity, removeListener, backgroundColor, style);
}
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls
- * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
- */
- /** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement element, int style) {
text_description = formFactory.createTextWithLabelElement(element,
"Sample Designation", null, style);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
- */
@Override
public void handleEvent(Object eventSource) {
if(eventSource==text_description){
}
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#setEntity(java.lang.Object)
- */
@Override
public void setEntity(Identifier entity) {
this.entity = entity;
text_description.setText(entity.getIdentifier());
}
-
-}
+}
\ No newline at end of file
/**
* @author pplitzner
* @date 07.01.2014
- *
*/
-public class SequenceReferenceCollectionDetailElement extends AbstractEntityCollectionElement<Reference>{
+public class SequenceReferenceCollectionDetailElement
+ extends AbstractEntityCollectionElement<Reference>{
protected EntitySelectionElement<Reference> selection_reference;
protected TextWithLabelElement text_referenceDetail;
super(formFactory, section, entity, removeListener, null, style);
}
- /** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement formElement, int style) {
selection_reference = formFactory
- .createSelectionElement(Reference.class,//getConversationHolder(),
+ .createSelectionElement(Reference.class,
formElement, "Reference",
null, EntitySelectionElement.SELECTABLE|EntitySelectionElement.EDITABLE, style);
text_referenceDetail = formFactory.createTextWithLabelElement(
entity.setReferenceAbstract(text_referenceDetail.getText());
}
}
-
-}
+}
\ No newline at end of file
* 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.ui.section.reference;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
*
* @author n.hoffmann
* @created 05.06.2009
- * @version 1.0
*/
public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference> implements ITaxonBaseDetailSection{
- private TaxonBase taxonBase;
+ private TaxonBase<?> taxonBase;
/**
* <p>Constructor for ReferenceBaseDetailSection.</p>
super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
}
- /** {@inheritDoc} */
@Override
- public void setTaxonBase(TaxonBase entity) {
+ public void setTaxonBase(TaxonBase<?> entity) {
this.taxonBase = entity;
- TaxonName name = HibernateProxyHelper.deproxy(entity.getName());
-
- Reference reference = (Reference) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
+ TaxonName name = entity.getName();
+ Reference reference = HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
setEntity(reference);
}
- /** {@inheritDoc} */
@Override
public String getHeading() {
return "Reference";
}
- /** {@inheritDoc} */
@Override
public void refresh() {
super.refresh();
}
@Override
- public TaxonBase getTaxonBase() {
+ public TaxonBase<?> getTaxonBase() {
return taxonBase;
}
@Override
protected AbstractCdmDetailElement<Reference> createCdmDetailElement(AbstractCdmDetailSection<Reference> parentElement, int style) {
- return formFactory.createReferenceDetailElement(parentElement, style, false);
+ return formFactory.createReferenceDetailElement(parentElement, style);
}
-
-}
+}
\ No newline at end of file
* 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.ui.section.reference;
import org.eclipse.swt.SWT;
*
* @author n.hoffmann
* @created Jun 1, 2010
- * @version 1.0
*/
public class ReferenceWizardPage extends AbstractCdmEntityWizardPage<Reference> implements IExceptionHandler{
-
/**
* <p>Constructor for ReferenceBaseWizardPage.</p>
*
@Override
public void createControl(Composite parent) {
-
super.createControl(parent);
-
}
- /*
- * (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.forms.CdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
- */
- /** {@inheritDoc} */
@Override
public AbstractCdmDetailElement<Reference> createElement(ICdmFormElement rootElement){
- ReferenceDetailElement referenceElement = formFactory.createReferenceDetailElement(rootElement, SWT.NULL, true);
+ ReferenceDetailElement referenceElement = formFactory.createReferenceDetailElement(rootElement, SWT.NULL);
referenceElement.addExceptionHandler(this);
referenceElement.setEntity(entity);
referenceElement.setWarnForReferencingObjectsVisible(true);
return referenceElement;
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.forms.IExceptionHandler#handleException(eu.etaxonomy.taxeditor.forms.CdmPropertyChangeEvent)
- */
- /** {@inheritDoc} */
@Override
public void handleException(CdmPropertyChangeEvent event) {
setMessage(event.getException().getMessage(), WARNING);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.forms.IExceptionHandler#clearException()
- */
- /** {@inheritDoc} */
@Override
public void clearException() {
setMessage(null);
}
-}
+}
\ No newline at end of file