update icon image and/or hover text
185897
def update(self, icon=None, hover_text=None):
        
        if icon:
            self._icon = icon
            self._load_icon()
        if hover_text:
            self._hover_text = hover_text
        self._refresh_icon()
300448
function () {
        var self = this, id = self._id, prefix = self.classPrefix, text = self.state.get('text');
        var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
        var image = self.settings.image ? ' style="background-image: url(\'' + self.settings.image + '\')"' : '',
          textHtml = '';

        if (text) {
          self.classes.add('btn-has-text');
          textHtml = '<span class="' + prefix + 'txt">' + self.encode(text) + '</span>';
        }

        return (
          '<div id="' + id + '" class="' + self.classes + '" role="button" tabindex="-1" aria-haspopup="true">' +
          '<button role="presentation" hidefocus="1" type="button" tabindex="-1">' +
          (icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
          '<span id="' + id + '-preview" class="' + prefix + 'preview"></span>' +
          textHtml +
          '</button>' +
          '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' +
          ' <i class="' + prefix + 'caret"></i>' +
          '</button>' +
          '</div>'
        );
      }
141116
function (obj) {
            var cmenu = this;
            var label = obj.label;
            if (typeof obj === "function") {
                obj = {onclick: obj};
            } // If passed a simple function, turn it into a property of an object
            // Default properties, extended in case properties are passed
            var o = $.extend({
                onclick: function () {
                },
                className: '',
                hoverClassName: cmenu.itemHoverClassName,
                icon: '',
                disabled: false,
                title: '',
                hoverItem: cmenu.hoverItem,
                hoverItemOut: cmenu.hoverItemOut
            }, obj);
            // If an icon is specified, hard-code the background-image style. Themes that don't show images should take this into account in their CSS
            var iconStyle = (o.icon) ? 'background-image:url(' + o.icon + ');' : '';
            var $div = $('<div class="' + cmenu.itemClassName + ' ' + o.className + ((o.disabled) ? ' ' + cmenu.disabledItemClassName : '') + '" title="' + o.title + '"></div>')
            // If the item is disabled, don't do anything when it is clicked
                .click(
                    function (e) {
                        if (cmenu.isItemDisabled(this)) {
                            return false;
                        }
                        else {
                            return o.onclick.call(cmenu.target, this, cmenu, e, label);
                        }
                    }
                )
                // Change the class of the item when hovered over
                .hover(
                    function () {
                        o.hoverItem.call(this, (cmenu.isItemDisabled(this)) ? cmenu.disabledItemHoverClassName : o.hoverClassName);
                    }
                    , function () {
                        o.hoverItemOut.call(this, (cmenu.isItemDisabled(this)) ? cmenu.disabledItemHoverClassName : o.hoverClassName);
                    }
                );
            var $idiv = $('<div class="' + cmenu.innerDivClassName + '" style="' + iconStyle + '">' + label + '</div>');
            $div.append($idiv);
            return $div;
        }
1175098
def set_icon(self):
		
		if not self.attrs.get("_icon"):
			return

		if "Date" in self.field.field.__class__.__name__:
			return

		self.values["field"] = INPUT_WRAPPER % {
			"field": self.values["field"],
			"help": self.values["help"], 
			"style": "%sicon " % escape(pad(self.attrs.get("_align", ""))),
			"icon": format_html(ICON_TEMPLATE, self.attrs.get("_icon")),
		}
778145
def icon=(icon)
      if icon.respond_to? :read
        icon_string = 'data:image/jpg;base64,'
        icon_string += Base64.strict_encode64(icon.read)
        update_server_data(icon_id: icon_string)
      else
        update_server_data(icon_id: icon)
      end
    end
916557
function (icon, param) {
            var stateObject = this.getStateObject();
            var iconParts = stateObject.icons[icon].split(":");
            var iconInfo = ariaWidgetsAriaSkinInterface.getIcon(iconParts[0], iconParts[1]);
            var active = stateObject.icons[icon + "IsActive"];
            if (iconInfo) {
                this._icons[icon].iconInfo = iconInfo;
                this._icons[icon].active = active;
                if (active) {
                    this._icons[icon].tooltip = this._tooltipLabels[param.activeIconIndex++];
                }
                param.width += iconInfo.width + (iconInfo.borderLeft || 0) + (iconInfo.borderRight || 0);
            } else {
                this.$logError(this.ICON_NOT_FOUND, icon);
            }
        }
212566
private void updateIcon() {
		// Define the icon.
		int icon = R.drawable.document_gray;
		if(this.selectable) {
			icon = (this.file != null && file.isDirectory())? R.drawable.folder : R.drawable.document;
		}

		// Set the icon.
		this.icon.setImageDrawable(getResources().getDrawable( icon ));

		// Change the color of the text.
		if(icon != R.drawable.document_gray) {
			this.label.setTextColor(getResources().getColor(R.color.daidalos_active_file));
		} else {
			this.label.setTextColor(getResources().getColor(R.color.daidalos_inactive_file));
		}
	}
1121029
function createIcon(options, enableTooltips, shortcuts) {
	options = options || {};
	var el = document.createElement("a");
	enableTooltips = (enableTooltips == undefined) ? true : enableTooltips;

	if(options.title && enableTooltips) {
		el.title = createTootlip(options.title, options.action, shortcuts);

		if(isMac) {
			el.title = el.title.replace("Ctrl", "⌘");
			el.title = el.title.replace("Alt", "⌥");
		}
	}

	el.tabIndex = -1;
	el.className = options.className;
	return el;
}
715358
public final void updateIcon(final IconType type) {
        if (type != null) updateIcon(Styles.FONT_AWESOME_BASE + " " + type.getCssName());
    }
984881
def set_icon(self, icon):
        ''''''
        self._icon = icon
        return self._listitem.setIconImage(icon)
280988
private void updateDecoration() {
        if (lastResult != null) {
            if (lastResult) {
                setIcon(validIcon);
                setToolTipText(validText);
            } else {
                setIcon(invalidIcon);
                setToolTipText(invalidText);
            }
        }
    }
1229201
public void setIcon(Icon icon) {

        if (icon == null) {
            m_iconContainer.clear();
            this.m_icon = null;
        } else {
            m_iconContainer.getElement().appendChild(icon.getElement());
            this.m_icon = icon;
        }
    }
388865
function (iconInfo) {
            var cfg = this._cfg;
            var vAlign = !cfg.verticalAlign ? "" : "vertical-align: " + cfg.verticalAlign;
            var margins = "margin: 0 0 0 0 "; // default value

            if (cfg.margins != null && cfg.margins.match(/^(\d+|x) (\d+|x) (\d+|x) (\d+|x)$/)) {
                var margArray = cfg.margins.split(" ");
                margins = ['margin:', margArray[0], 'px ', margArray[1], 'px ', margArray[2], 'px ', margArray[3],
                        'px; '].join('');
            } else if (iconInfo.margins != null) {
                margins = iconInfo.margins;
            }
            if (cfg.sourceImage) {
                return [margins, ';padding:0;background:url(', iconInfo.imageURL, ') no-repeat; width:',
                        iconInfo.width, 'px;height:', iconInfo.height, 'px;', vAlign].join('');
            } else {
                return [margins, ';padding:0;background-position:-', iconInfo.iconLeft, 'px -', iconInfo.iconTop,
                        'px;', vAlign].join('');
            }
        }
886563
def itooltip(title, icon_suffix = 'info-circle', html_options = {})
      html_options[:title] = title
      (html_options[:data] ||= {}).merge! toggle: 'tooltip', placement: 'top'

      fa_icon icon_suffix, html_options
    end
1115027
def OnUpdate(self, event):
        """"""

        attributes = event.attr

        self._update_font(attributes["textfont"])
        self._update_pointsize(attributes["pointsize"])
        self._update_font_weight(attributes["fontweight"])
        self._update_font_style(attributes["fontstyle"])
        self._update_frozencell(attributes["frozen"])
        self._update_lockedcell(attributes["locked"])
        self._update_markupcell(attributes["markup"])
        self._update_underline(attributes["underline"])
        self._update_strikethrough(attributes["strikethrough"])
        self._update_justification(attributes["justification"])
        self._update_alignment(attributes["vertical_align"])
        self._update_fontcolor(attributes["textcolor"])
        self._update_merge(attributes["merge_area"] is not None)
        self._update_textrotation(attributes["angle"])
        self._update_bgbrush(attributes["bgcolor"])
        self._update_bordercolor(attributes["bordercolor_bottom"])
        self._update_borderwidth(attributes["borderwidth_bottom"])

        self.Refresh()

        event.Skip()
242604
function (iconInfo, active) {
            // TODO: mutualize with the icon widget
            var style = ['padding:0;display:inline-block;background-position:-', iconInfo.iconLeft, 'px -',
                    iconInfo.iconTop, 'px;width:', iconInfo.width, 'px;height:', iconInfo.height,
                    'px;vertical-align: top;'];
            if (active) {
                style.push('cursor:pointer;');
            }
            return style.join('');
        }
1257243
private void adaptIcon() {
        if (iconImageView != null) {
            ImageViewCompat.setImageTintList(iconImageView, iconTintList);
            ImageViewCompat.setImageTintMode(iconImageView, iconTintMode);
            iconImageView.setImageDrawable(icon);
            iconImageView.setVisibility(icon != null ? View.VISIBLE : View.GONE);
        }

        adaptTitleContainerVisibility();
    }