2 * Copyright (C) 2014 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
.occurrence
;
11 import eu
.etaxonomy
.taxeditor
.l10n
.Messages
;
12 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
13 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
14 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
15 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
22 public class EmptySection
extends AbstractCdmDetailSection
<Object
> {
24 private static final String DEFAULT_MESSAGE
= Messages
.EmptySection_NO_VIEW_IMPLEMENTED
;
25 private final String message
;
27 public EmptySection(String message
, CdmFormFactory formFactory
, ICdmFormElement parentElement
, int style
) {
28 super(formFactory
, null, parentElement
, null, style
);
29 this.message
= message
!=null?message
:DEFAULT_MESSAGE
;
34 public String
getHeading() {
35 return message
!=null?message
:DEFAULT_MESSAGE
;
39 protected AbstractCdmDetailElement
<Object
> createCdmDetailElement(AbstractCdmDetailSection
<Object
> parentElement
, int style
) {
40 return formFactory
.createEmptyElement(parentElement
, message
);
44 public void setEntity(Object entity
) {
45 //update section title because getHeading is invoked
46 //before message is set via constructor