Revision 2e1e89cd
Added by Patrick Plitzner over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractEntityCollectionSection.java | ||
---|---|---|
69 | 69 |
|
70 | 70 |
private AbstractEntityCollectionElement<ENTITY> entityCollectionElement; |
71 | 71 |
|
72 |
private Collection<ELEMENT> collection; |
|
73 |
|
|
72 | 74 |
public AbstractEntityCollectionSection(CdmFormFactory formFactory, ConversationHolder conversation, ICdmFormElement parentElement, String title, int style) { |
73 | 75 |
super(formFactory, parentElement, ExpandableComposite.CLIENT_INDENT | style); |
74 | 76 |
this.title = title; |
... | ... | |
161 | 163 |
@Override |
162 | 164 |
public void setEntity(ENTITY entity) { |
163 | 165 |
if(entity != null){ |
166 |
collection = getCollection(entity); |
|
164 | 167 |
super.setEntity(entity); |
165 | 168 |
internalUpdateSection(false); |
166 | 169 |
} |
... | ... | |
174 | 177 |
* Override in subclasses if you want to have a different behaviour. |
175 | 178 |
*/ |
176 | 179 |
protected void setSectionTitle() { |
177 |
Collection<ELEMENT> collection = getCollection(getEntity()); |
|
178 |
if(collection != null && collection.size() > 0){ |
|
180 |
if(collection != null && !collection.isEmpty()){ |
|
179 | 181 |
this.setText(getTitleString() + " +"); |
180 | 182 |
}else{ |
181 | 183 |
this.setText(getTitleString()); |
... | ... | |
216 | 218 |
*/ |
217 | 219 |
private void renderContent(boolean forceExpansion) |
218 | 220 |
{ |
219 |
Collection<ELEMENT> collection = getCollection(getEntity()); |
|
220 | 221 |
|
221 | 222 |
if(collection == null || collection.isEmpty()){ |
222 | 223 |
createEmptyContent(); |
Also available in: Unified diff
ref #6554 Cache collection for entity collection sections