private void applyStyle()

in cell/src/main/java/jetbrains/jetpad/cell/toDom/BaseCellMapper.java [169:195]


  private void applyStyle(boolean selected, boolean focusHighlighted, Color background) {
    updateCssStyle(CSS.outlined(), focusHighlighted && !isLeaf() && !selected);
    updateCssStyle(CSS.selected(), selected);
    updateCssStyle(CSS.paired(), getSource().get(Cell.PAIR_HIGHLIGHTED));
    updateCssStyle(CSS.link(), getSource().get(Cell.LINK));

    String backgroundColor = null;
    if (isLeaf() && focusHighlighted) {
      backgroundColor = CSS.currentHighlightColor();
    } else if (background != null) {
      backgroundColor = background.toCssColor();
    }

    String underline = getSource().get(Cell.LINK) && getSource().get(Cell.HOVERED) ? CSS.blueUnderline()
        : getSource().get(Cell.RED_UNDERLINE) ? CSS.redUnderline()
        : getSource().get(Cell.YELLOW_UNDERLINE) ? CSS.yellowUnderline() : null;
    applyBackground(backgroundColor, underline);

    Style style = getTarget().getStyle();
    Color borderColor = getSource().get(Cell.BORDER_COLOR);
    style.setBorderStyle(borderColor == null ? Style.BorderStyle.NONE : Style.BorderStyle.SOLID);
    style.setBorderWidth(borderColor == null ? 0 : 1, Style.Unit.PX);
    style.setBorderColor(borderColor == null ? null : borderColor.toCssColor());

    updateCssStyle(CSS.hidden(), !getSource().get(Cell.VISIBLE));
    updateCssStyle(CSS.hasShadow(), getSource().get(Cell.HAS_SHADOW));
  }