1 |
729887cf
|
n.hoffmann
|
/**
|
2 |
|
|
*
|
3 |
|
|
*/
|
4 |
f211dd28
|
n.hoffmann
|
package eu.etaxonomy.taxeditor.ui.section.supplemental;
|
5 |
729887cf
|
n.hoffmann
|
|
6 |
|
|
import java.util.Collection;
|
7 |
|
|
|
8 |
|
|
|
9 |
2d9a13f7
|
n.hoffmann
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
10 |
729887cf
|
n.hoffmann
|
import eu.etaxonomy.cdm.model.common.Extension;
|
11 |
|
|
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
|
12 |
78222507
|
n.hoffmann
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
13 |
|
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
14 |
f211dd28
|
n.hoffmann
|
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
|
15 |
729887cf
|
n.hoffmann
|
|
16 |
|
|
/**
|
17 |
3be6ef3e
|
n.hoffmann
|
* <p>ExtensionSection class.</p>
|
18 |
729887cf
|
n.hoffmann
|
*
|
19 |
3be6ef3e
|
n.hoffmann
|
* @author nho
|
20 |
|
|
* @version $Id: $
|
21 |
729887cf
|
n.hoffmann
|
*/
|
22 |
|
|
public class ExtensionSection extends AbstractEntityCollectionSection<IdentifiableEntity, Extension> {
|
23 |
|
|
|
24 |
|
|
/**
|
25 |
3be6ef3e
|
n.hoffmann
|
* <p>Constructor for ExtensionSection.</p>
|
26 |
|
|
*
|
27 |
78222507
|
n.hoffmann
|
* @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
|
28 |
3be6ef3e
|
n.hoffmann
|
* @param style a int.
|
29 |
78222507
|
n.hoffmann
|
* @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
|
30 |
3be6ef3e
|
n.hoffmann
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
31 |
729887cf
|
n.hoffmann
|
*/
|
32 |
2d9a13f7
|
n.hoffmann
|
public ExtensionSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
|
33 |
|
|
super(cdmFormFactory, conversation,parentElement, "Extensions", style);
|
34 |
729887cf
|
n.hoffmann
|
}
|
35 |
|
|
|
36 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
37 |
729887cf
|
n.hoffmann
|
@Override
|
38 |
|
|
public Extension createNewElement() {
|
39 |
|
|
return Extension.NewInstance();
|
40 |
|
|
}
|
41 |
|
|
|
42 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
43 |
729887cf
|
n.hoffmann
|
@Override
|
44 |
|
|
public Collection<Extension> getCollection(IdentifiableEntity entity) {
|
45 |
cfcb0ce6
|
n.hoffmann
|
return entity.getExtensions();
|
46 |
729887cf
|
n.hoffmann
|
}
|
47 |
|
|
|
48 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
49 |
729887cf
|
n.hoffmann
|
@Override
|
50 |
|
|
public String getEmptyString() {
|
51 |
|
|
return "No extensions yet.";
|
52 |
|
|
}
|
53 |
|
|
|
54 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
55 |
729887cf
|
n.hoffmann
|
@Override
|
56 |
|
|
protected String getTooltipString() {
|
57 |
|
|
return "Create a new extension";
|
58 |
|
|
}
|
59 |
|
|
|
60 |
|
|
|
61 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
62 |
729887cf
|
n.hoffmann
|
@Override
|
63 |
|
|
public void addElement(Extension element) {
|
64 |
|
|
getEntity().addExtension(element);
|
65 |
|
|
}
|
66 |
|
|
|
67 |
|
|
|
68 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
69 |
729887cf
|
n.hoffmann
|
@Override
|
70 |
|
|
public void removeElement(Extension element) {
|
71 |
|
|
getEntity().removeExtension(element);
|
72 |
|
|
}
|
73 |
|
|
|
74 |
|
|
}
|