public void update() {
    removeAll();
    int height = getIconHeight();
    JBLabel firstLabel = null;

    for (VcsBookmarkRef bookmark : myBookmarks) {
      Icon icon = new BookmarkIcon(this, height, getBackground(), bookmark);
      JBLabel label = createLabel(bookmark.getText(), icon);
      label.setIconTextGap(JBUI.scale(2));
      addWrapped(label, firstLabel);
      if (firstLabel == null) firstLabel = label;
    }

    for (Map.Entry<VcsRefType, Collection<VcsRef>> typeAndRefs : myGroupedVisibleReferences.entrySet()) {
      VcsRefType type = typeAndRefs.getKey();
      Collection<VcsRef> refs = typeAndRefs.getValue();
      int refIndex = 0;
      for (VcsRef reference : refs) {
        Icon icon = createIcon(type, refs, refIndex, height);
        String ending = (refIndex != refs.size() - 1) ? "," : "";
        String text = reference.getName() + ending;
        JBLabel label = createLabel(text, icon);
        addWrapped(label, firstLabel);
        if (firstLabel == null) firstLabel = label;
        refIndex++;
      }
    }
    if (getHiddenReferencesSize() > 0) {
      JBLabel label = createRestLabel(getHiddenReferencesSize());
      addWrapped(label, Objects.requireNonNull(firstLabel));
    }

    setVisible(!myGroupedVisibleReferences.isEmpty() || !myBookmarks.isEmpty());
    revalidate();
    repaint();
  }
public void update()