use of com.codename1.rad.ui.image.PropertyImageRenderer in project CodeRAD by shannah.
the class LabelPropertyView method update.
@Override
public void update() {
super.update();
String oldVal = getComponent().getText();
String newVal = iconOnly ? "" : getText();
boolean changed = false;
if (!Objects.equals(oldVal, newVal)) {
getComponent().setText(newVal);
changed = true;
}
if (iconField != null) {
PropertyImageRenderer iconRenderer = iconField.getIconRenderer();
if (iconRenderer != null) {
if (!getIconPropertySelector().getText("").equals(lastIcon)) {
lastIcon = getIconPropertySelector().getText("");
Image icon = iconRenderer.createImage(iconPropertySelector);
changed = true;
getComponent().setIcon(icon);
}
}
}
if (changed) {
Form f = getComponent().getComponentForm();
if (f != null) {
f.revalidateLater();
}
}
}
Aggregations