2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
;
11 import java
.util
.Collection
;
12 import java
.util
.Comparator
;
14 import eu
.etaxonomy
.cdm
.model
.common
.Extension
;
15 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableEntity
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.DefaultCdmBaseComparator
;
24 public class ExtensionSection
extends AbstractEntityCollectionSection
<IdentifiableEntity
, Extension
> {
26 public ExtensionSection(CdmFormFactory cdmFormFactory
, ICdmFormElement parentElement
, int style
) {
27 super(cdmFormFactory
, parentElement
, "Extensions", style
);
31 public Extension
createNewElement() {
32 return Extension
.NewInstance();
36 public Collection
<Extension
> getCollection(IdentifiableEntity entity
) {
37 return entity
.getExtensions();
41 public Comparator
<Extension
> getComparator() {
42 return new DefaultCdmBaseComparator
<>();
46 public String
getEmptyString() {
47 return "No extensions yet.";
51 protected String
getTooltipString() {
52 return "Create a new extension";
56 public void addElement(Extension element
) {
57 getEntity().addExtension(element
);
61 public void removeElement(Extension element
) {
62 getEntity().removeExtension(element
);
66 public Extension
addExisting() {
67 // TODO Auto-generated method stub
72 public boolean allowAddExisting() {
73 // TODO Auto-generated method stub