class MinimizedPanel extends JPanel implements SideModel.Listener<T> {

  public int drag(@NotNull AttachedToolWindow<T> tool, int position) {
    AbstractButton button = tool.getMinimizedButton();
    if (!isOpaque()) {
      enableMinimizeButtonDragAndDrop(true);
      button.setVisible(true);
    }
    int insertIndex = findInsertIndex(position, button);
    int index = getComponentIndex(button);
    if (index == insertIndex) {
      return insertIndex;
    }
    if (index >= 0) {
      remove(index);
    }
    add(button, insertIndex);
    revalidate();
    repaint();
    return insertIndex;
  }

    MinimizedPanel(@NotNull Side side, @NotNull SideModel<T> model);

}