text_width = formFactory.createFloatTextWithLabelElement(formElement, "Width", null, style);
text_width.setEnabled(false);
element_keyValue = formFactory.createKeyValueViewerElement(formElement, "Key", "Value", null);
+ if (entity != null){
+ setEntity(entity);
+ }
}
@Override
public void setEntity(ImageFile entity) {
super.setEntity(entity);
- text_height.setNumber(entity.getHeight());
- text_width.setNumber(entity.getWidth());
- try {
- new LoadImageJob(getEntity().getUri(), true).schedule();
- } catch (Exception e) {
- e.printStackTrace();
- handleException();
+ if (text_height != null){
+ text_height.setNumber(entity.getHeight());
+ text_width.setNumber(entity.getWidth());
+ try {
+ new LoadImageJob(getEntity().getUri(), true).schedule();
+ } catch (Exception e) {
+ e.printStackTrace();
+ handleException();
+ }
}
}