/** * Defines the icon the component will display. * @param i */ public void setIcon(SIcon i) { if (isDifferent(icon, i)) { SIcon oldVal = this.icon; // do reload if previous text was null if (isUpdatePossible() && icon != null && SLabel.class.isAssignableFrom(getClass())) update(((LabelCG) getCG()).getIconUpdate(this, i)); else reload(); icon = i; propertyChangeSupport.firePropertyChange("icon", oldVal, this.icon); } }
/** * Sets the text of the label. Nothing will be displayed if the text is an empty string or <code>null</code>. * Use <html> as prefix to disable implicit * quoting of the payload text. By default the component should handle and quote special characters as <code>\n</code> * and <code>\u0123</code> correctly. * * @param t The new text */ public void setText(String t) { if (isDifferent(text, t)) { String oldVal = this.text; // do reload if previous text was null if (isUpdatePossible() && text != null && SLabel.class.isAssignableFrom(getClass())) update(((LabelCG) getCG()).getTextUpdate(this, t)); else reload(); text = t; propertyChangeSupport.firePropertyChange("text", oldVal, this.text); } }
public static void writeInnerComponent(Device device, SCursor component) throws IOException { List<SIcon> icons = component.getIconsByPriority(); device.print("<span>"); for(SIcon icon : icons) { device.print("<img src=\""); device.print(icon.getURL()); device.print("\" alt=\""); device.print(icon.getIconTitle()); if(icon.getIconHeight() != -1) { device.print("\" height=\""); device.print(icon.getIconHeight()); } if(icon.getIconWidth() != -1) { device.print("\" width=\""); device.print(icon.getIconWidth()); } device.print("\" />"); } SLabel label = component.getLabel(); if(label != null) { LabelCG labelCG = (LabelCG)label.getCG(); labelCG.write(device, label); } device.print("</span>"); }