void (@NotNull Project project, @NotNull InternalDecorator decorator, @NotNull ContentManager contentManager) { Content dropTargetContent = createDropTargetContent(); DnDSupport.createBuilder(decorator) .setTargetChecker(new DnDTargetChecker() { @Override public boolean update(DnDEvent event) { Object o = event.getAttachedObject(); boolean dropPossible = o instanceof ServiceViewDragBean && event.getPointOn(decorator).y < decorator.getHeaderHeight(); event.setDropPossible(dropPossible, ""); if (dropPossible) { if (contentManager.getIndexOfContent(dropTargetContent) < 0) { contentManager.addContent(dropTargetContent); } ServiceViewDragBean dragBean = (ServiceViewDragBean)o; ItemPresentation presentation; if (dragBean.getItems().size() > 1 && dragBean.getContributor() != null) { presentation = dragBean.getContributor().getViewDescriptor(project).getPresentation(); } else { ServiceViewItem item = dragBean.getItems().get(0); presentation = item.getViewDescriptor().getPresentation(); dropTargetContent.setTabColor(item.getColor()); } dropTargetContent.setDisplayName(getDisplayName(presentation)); dropTargetContent.setIcon(presentation.getIcon(false)); } else if (contentManager.getIndexOfContent(dropTargetContent) >= 0) { contentManager.removeContent(dropTargetContent, false); } return true; } }) .setCleanUpOnLeaveCallback(() -> { if (!contentManager.isDisposed() && contentManager.getIndexOfContent(dropTargetContent) >= 0) { contentManager.removeContent(dropTargetContent, false); } }) .setDropHandler(new DnDDropHandler() { @Override public void drop(DnDEvent event) { Object o = event.getAttachedObject(); if (o instanceof ServiceViewDragBean) { ((ServiceViewManagerImpl)ServiceViewManager.getInstance(project)).extract((ServiceViewDragBean)o); } } }) .install(); decorator.addMouseMotionListener(new MouseAdapter() { @Override public void mouseExited(MouseEvent e) { if (contentManager.getIndexOfContent(dropTargetContent) >= 0) { contentManager.removeContent(dropTargetContent, false); } } }); }