public void setState(@Nullable IErrorState state) { this.state = state; if (state != null) { int lineHeight = StringUtil.getLineHeight(maxTextWidth, getTooltip(), Translator.translateToLocal(state.getUnlocalizedHelp())); maxHeight = lineHeight + 20; } }
@Override public void draw(int x, int y) { if (state == null) { return; } // Draw background drawBackground(x, y); y += 4; int xIcon = x + 5; int xBody = x + 14; int xHeader = x + 24; // Draw sprite drawSprite(state.getSprite(), xIcon, y); y += 4; // Write description if fully opened if (isFullyOpened()) { y += drawHeader(getTooltip(), xHeader, y); y += 4; String helpString = Translator.translateToLocal(state.getUnlocalizedHelp()); drawSplitText(helpString, xBody, y, maxTextWidth); } }