Implementation adapted from org.jdesktop.swingx.decorator.IconHighlighter#doHighlight(Component, ComponentAdapter)
760822
@Override
    protected Component doHighlight(final Component component, final ComponentAdapter adapter) {
        final Icon icon = getIcon(adapter.getValue(columnIndex));

        if (icon != null) {
            if (component instanceof IconAware) {
                ((IconAware) component).setIcon(icon);
            } else if (component instanceof JLabel) {
                ((JLabel) component).setIcon(icon);
            }
        } else {
            if (component instanceof JLabel) {
                ((JLabel) component).setText("");
            }
        }
        return component;
    }
1245304
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WToggleButton toggle = (WToggleButton) component;
		XmlStringBuilder xml = renderContext.getWriter();
		boolean readOnly = toggle.isReadOnly();


		xml.appendTagOpen("ui:togglebutton");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", toggle.isHidden(), "true");
		xml.appendOptionalAttribute("selected", toggle.isSelected(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			WComponentGroup<WCheckBox> group = toggle.getGroup();
			String groupName = group == null ? null : group.getId();
			xml.appendOptionalAttribute("groupName", groupName);
			xml.appendOptionalAttribute("disabled", toggle.isDisabled(), "true");
			xml.appendOptionalAttribute("submitOnChange", toggle.isSubmitOnChange(), "true");
			xml.appendOptionalAttribute("toolTip", toggle.getToolTip());
			xml.appendOptionalAttribute("accessibleText", toggle.getAccessibleText());
		}
		xml.appendClose();
		String text = toggle.getText();
		if (text != null) {
			xml.appendEscaped(text);
		}
		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(toggle, renderContext);
		}
		xml.appendEndTag("ui:togglebutton");
	}
1053275
public void setLinkedEmitter(ConfigurableEmitter emitter) {
		// set the title
		Window w = SwingUtilities.windowForComponent(this);
		if (w instanceof Frame)
			((Frame) w).setTitle("Whiskas Gradient Editor (" + emitter.name
					+ ")");

		// clear all values
		properties.removeAllItems();
		values.clear();
		panel.setInterpolator(null);
		enableControls();
	}
1181753
public static void decorateFacetComponent(UIComponent parent, UIComponent comp, FacesContext ctx, ResponseWriter rw)
			throws IOException {
		/*
		 * System.out.println("COMPONENT CLASS = " + comp.getClass().getName());
		 * System.out.println("FAMILY = " + comp.getFamily());
		 * System.out.println("CHILD COUNT = " + comp.getChildCount());
		 * System.out.println("PARENT CLASS = " + comp.getParent().getClass());
		 * 
		 * 
		 * if (app.getClass().getName().endsWith("Button") ||
		 * (app.getChildCount() > 0 &&
		 * app.getChildren().get(0).getClass().getName().endsWith("Button"))) {
		 * rw.startElement("div", inputText); rw.writeAttribute("class",
		 * "input-group-btn", "class"); app.encodeAll(context);
		 * rw.endElement("div"); } else { if (app instanceof Icon) ((Icon)
		 * app).setAddon(true); rw.startElement("span", inputText);
		 * rw.writeAttribute("class", "input-group-addon", "class");
		 * app.encodeAll(context); rw.endElement("span"); }
		 */
		if (comp.getChildCount() >= 1 && comp.getClass().getName().endsWith("Panel")) {
			for (UIComponent child : comp.getChildren()) {
				decorateComponent(parent, child, ctx, rw);
			}
		} else {
			decorateComponent(parent, comp, ctx, rw);
		}
	}
46990
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, int highlightColor) {
        Context ctx = inflater.getContext();
        View view = inflater.inflate(R.layout.navdrawer_item, container, false);

        ImageView iconView = ButterKnife.findById(view, R.id.icon);
        TextView titleView = ButterKnife.findById(view, R.id.title);
        TextView badgeView = ButterKnife.findById(view, R.id.badge);

        // Set the textResId
        FontLoader.apply(titleView, Face.ROBOTO_MEDIUM);
        titleView.setText(textResId);

        // Set the iconResId, if provided
        iconView.setVisibility(iconResId > 0 ? View.VISIBLE : View.GONE);
        if(iconResId > 0)
            iconView.setImageResource(iconResId);

        // configure its appearance according to whether or not it's selected
        titleView.setTextColor(selected ?
                highlightColor :
                UIUtils.getColorAttr(ctx, android.R.attr.textColorPrimary));

        iconView.setColorFilter(selected ?
                highlightColor :
                ctx.getResources().getColor(R.color.navdrawer_icon_tint));

        // Setup the badge view
        if(badge != null) {
            Drawable badgeBackground = DrawableCompat
                    .wrap(ctx.getResources().getDrawable(R.drawable.badge));
            DrawableCompat.setTint(badgeBackground, badge.getColor());
            badgeView.setBackground(badgeBackground);
            badgeView.setTextColor(badge.getTextColor());
            badgeView.setText(badge.getText());
            badgeView.setVisibility(View.VISIBLE);
        }

        return view;
    }
1038780
@Deprecated
    @SuppressWarnings("unchecked")
    public static void deselect(final FastAdapter adapter) {
        adapter.recursive(new AdapterPredicate() {
            @Override
            public boolean apply(@NonNull IAdapter lastParentAdapter, int lastParentPosition, @NonNull IItem item, int position) {
                if (position != -1) {
                    SelectExtension extension = (SelectExtension) adapter.getExtension(SelectExtension.class);
                    if (extension != null) {
                        extension.deselect(position);
                    }
                } else {
                    item.withSetSelected(false);
                }
                return true;
            }
        }, false);
    }
306935
function SettingsRenderer(settingsListExplorer, serviceRegistry) {
		this.serviceRegistry = serviceRegistry;
		this.childWidgets = [];
		SelectionRenderer.call(this, {cachePrefix: 'pluginSettings', noRowHighlighting: true}, settingsListExplorer); //$NON-NLS-0$
	}
974678
boolean evaluatePureAnnotationAdapters(org.eclipse.xtext.common.types.JvmOperation operation, ISideEffectContext context) {
		int index = -1;
		int i = 0;
		for (final Adapter adapter : operation.eAdapters()) {
			if (adapter.isAdapterForType(AnnotationJavaGenerationAdapter.class)) {
				index = i;
				break;
			}
			++i;
		}
		if (index >= 0) {
			final AnnotationJavaGenerationAdapter annotationAdapter = (AnnotationJavaGenerationAdapter) operation.eAdapters().get(index);
			assert annotationAdapter != null;
			return annotationAdapter.applyAdaptations(this, operation, context);
		}
		return false;
	}
491869
public void setHighlightedBond(IBond highlightedBond) {
        if ((this.highlightedBond != null) || (highlightedBond != null)) {
            this.highlightedBond = highlightedBond;
            fireChange();
        }
    }
1094099
public void applyToOr(TextView textView, ColorStateList colorDefault) {
        if (mColorInt != 0) {
            textView.setTextColor(mColorInt);
        } else if (mColorRes != -1) {
            textView.setTextColor(ContextCompat.getColor(textView.getContext(), mColorRes));
        } else if (colorDefault != null) {
            textView.setTextColor(colorDefault);
        }
    }
187661
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, int highlightColor) {
        Context ctx = inflater.getContext();
        View view = inflater.inflate(R.layout.navdrawer_item, container, false);

        ImageView iconView = ButterKnife.findById(view, R.id.icon);
        TextView titleView = ButterKnife.findById(view, R.id.title);

        // Set the text
        FontLoader.apply(titleView, Face.ROBOTO_MEDIUM);
        titleView.setText(text);

        // Set the icon, if provided
        iconView.setVisibility(icon > 0 ? View.VISIBLE : View.GONE);
        if(icon > 0)
            iconView.setImageResource(icon);

        // configure its appearance according to whether or not it's selected
        titleView.setTextColor(selected ?
                highlightColor :
                UIUtils.getColorAttr(ctx, android.R.attr.textColorPrimary));

        iconView.setColorFilter(selected ?
                highlightColor :
                ctx.getResources().getColor(R.color.navdrawer_icon_tint));

        return view;
    }
1020474
private static void decorateComponent(UIComponent parent, UIComponent comp, FacesContext ctx, ResponseWriter rw)
			throws IOException {
		if (comp instanceof Icon)
			((Icon) comp).setAddon(true); // modifies the id of the icon

		String classToApply = "input-group-addon";
		if (comp.getClass().getName().endsWith("Button") || comp.getChildCount() > 0)
			classToApply = "input-group-btn";

		if (comp instanceof HtmlOutputText) {
			HtmlOutputText out = (HtmlOutputText)comp;
			
			String sc = out.getStyleClass();
			if (sc == null)
				sc = classToApply;
			else
				sc = sc + " " + classToApply;
			out.setStyleClass(sc);
			comp.encodeAll(ctx);
		}
		else {
			rw.startElement("span", parent);
			rw.writeAttribute("class", classToApply, "class");
			comp.encodeAll(ctx);
		 rw.endElement("span");
		}
	}
921532
private void showErrorIconHax(Drawable icon) {
        if (icon == null)
            return;

        // only for JB 4.2 and 4.2.1
        if (android.os.Build.VERSION.SDK_INT != Build.VERSION_CODES.JELLY_BEAN
                && android.os.Build.VERSION.SDK_INT != Build.VERSION_CODES.JELLY_BEAN_MR1)
            return;

        try {
            Class<?> textview = Class.forName("android.widget.TextView");
            Field tEditor = textview.getDeclaredField("mEditor");
            tEditor.setAccessible(true);
            Class<?> editor = Class.forName("android.widget.Editor");
            Method privateShowError = editor.getDeclaredMethod("setErrorIcon",
                    Drawable.class);
            privateShowError.setAccessible(true);
            privateShowError.invoke(tEditor.get(this), icon);
        } catch (Exception e) {
            // e.printStackTrace(); // oh well, we tried
        }
    }
185669
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WDefinitionList list = (WDefinitionList) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("ui:definitionlist");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");

		switch (list.getType()) {
			case FLAT:
				xml.appendAttribute("type", "flat");
				break;

			case COLUMN:
				xml.appendAttribute("type", "column");
				break;

			case STACKED:
				xml.appendAttribute("type", "stacked");
				break;

			case NORMAL:
				break;

			default:
				throw new SystemException("Unknown layout type: " + list.getType());
		}

		xml.appendClose();

		// Render margin
		MarginRendererUtil.renderMargin(list, renderContext);

		for (Duplet<String, ArrayList<WComponent>> term : list.getTerms()) {
			xml.appendTagOpen("ui:term");
			xml.appendAttribute("text", I18nUtilities.format(null, term.getFirst()));
			xml.appendClose();

			for (WComponent data : term.getSecond()) {
				xml.appendTag("ui:data");
				data.paint(renderContext);
				xml.appendEndTag("ui:data");
			}

			xml.appendEndTag("ui:term");
		}

		xml.appendEndTag("ui:definitionlist");
	}
1316927
private void doHighlight(String colorMode) throws WidgetException {
		if (!(getGUIDriver() instanceof HighlightProvider)) {
			return;
		}
		HighlightProvider highDriver = (HighlightProvider) getGUIDriver();

		if (highDriver.isHighlight()) {
			setBackgroundColor(highDriver.getHighlightColor(colorMode));
		}
	}
676614
public static void applyDecidedIconOrSetGone(ImageHolder imageHolder, ImageView imageView, int iconColor, boolean tint) {
        if (imageHolder != null && imageView != null) {
            Drawable drawable = ImageHolder.decideIcon(imageHolder, imageView.getContext(), iconColor, tint);
            if (drawable != null) {
                imageView.setImageDrawable(drawable);
                imageView.setVisibility(View.VISIBLE);
            } else if (imageHolder.getBitmap() != null) {
                imageView.setImageBitmap(imageHolder.getBitmap());
                imageView.setVisibility(View.VISIBLE);
            } else {
                imageView.setVisibility(View.GONE);
            }
        } else if (imageView != null) {
            imageView.setVisibility(View.GONE);
        }
    }
814056
public static void applyMultiIconTo(Drawable icon, int iconColor, Drawable selectedIcon, int selectedIconColor, boolean tinted, ImageView imageView) {
        //if we have an icon then we want to set it
        if (icon != null) {
            //if we got a different color for the selectedIcon we need a StateList
            if (selectedIcon != null) {
                if (tinted) {
                    imageView.setImageDrawable(new PressedEffectStateListDrawable(icon, selectedIcon, iconColor, selectedIconColor));
                } else {
                    imageView.setImageDrawable(UIUtils.getIconStateList(icon, selectedIcon));
                }
            } else if (tinted) {
                imageView.setImageDrawable(new PressedEffectStateListDrawable(icon, iconColor, selectedIconColor));
            } else {
                imageView.setImageDrawable(icon);
            }
            //make sure we display the icon
            imageView.setVisibility(View.VISIBLE);
        } else {
            //hide the icon
            imageView.setVisibility(View.GONE);
        }
    }