Revision d7ad25d9
Added by Katja Luther over 2 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationPartElement.java | ||
---|---|---|
45 | 45 |
text_uri = formFactory.createUriWithLabelElement(element, "URI", null, style); |
46 | 46 |
text_size = formFactory.createFloatTextWithLabelElement(element, "Size", null, style); |
47 | 47 |
text_size.setEnabled(false); |
48 |
if (entity != null){ |
|
49 |
setEntity(entity); |
|
50 |
} |
|
48 | 51 |
} |
49 | 52 |
|
50 | 53 |
@Override |
51 | 54 |
public void setEntity(T entity) { |
52 | 55 |
this.entity = entity; |
53 |
if(entity.getSize() != null){ |
|
54 |
text_size.setText(FileUtils.byteCountToDisplaySize(entity.getSize())); |
|
56 |
if (text_size != null){ |
|
57 |
if(entity.getSize() != null){ |
|
58 |
text_size.setText(FileUtils.byteCountToDisplaySize(entity.getSize())); |
|
59 |
} |
|
60 |
if(entity.getUri() != null){ |
|
61 |
text_uri.setParsedText(entity.getUri()); |
|
62 |
} else { |
|
63 |
String uriBuffer = getParentMediaDetailElement().getUriBuffer(); |
|
64 |
if(uriBuffer!=null){ |
|
65 |
text_uri.setText(uriBuffer); |
|
66 |
text_uri.parseText();//just to update the error label |
|
67 |
} |
|
68 |
} |
|
55 | 69 |
} |
56 |
if(entity.getUri() != null){ |
|
57 |
text_uri.setParsedText(entity.getUri()); |
|
58 |
} else { |
|
59 |
String uriBuffer = getParentMediaDetailElement().getUriBuffer(); |
|
60 |
if(uriBuffer!=null){ |
|
61 |
text_uri.setText(uriBuffer); |
|
62 |
text_uri.parseText();//just to update the error label |
|
63 |
} |
|
64 |
} |
|
65 | 70 |
} |
66 | 71 |
|
67 | 72 |
@Override |
Also available in: Unified diff
ref #9838: change order of ui element creation and setting entity in collection elements