return false;
boolean oldAggregateMode = toolWindow.isAggregateMode();
toolWindow.setAggregateMode(true);
ToolWindowAnchor dragAnchor = getOnAnchor();
try {
if (dragAnchor != null) {
switch (dragAnchor) {
case LEFT:
if (onToolWindow != null) {
toolWindow.setAnchor(dragAnchor, anchorIndex != -1 ? anchorIndex - 1 : -1);
toolWindow.aggregate(onToolWindow, AggregationPosition.LEFT);
} else {
if (checkCondition(toolWindow)) {
toolWindow.setAnchor(dragAnchor, 0);
toolWindow.aggregate(AggregationPosition.LEFT);
}
}
break;
case RIGHT:
if (onToolWindow != null) {
toolWindow.setAnchor(dragAnchor, anchorIndex != -1 ? anchorIndex + 1 : -1);
toolWindow.aggregate(onToolWindow, AggregationPosition.RIGHT);
} else {
if (checkCondition(toolWindow)) {
toolWindow.setAnchor(dragAnchor);
toolWindow.aggregate(AggregationPosition.RIGHT);
}
}
break;
case BOTTOM:
if (onToolWindow != null) {
toolWindow.setAnchor(dragAnchor, anchorIndex != -1 ? anchorIndex + 1 : -1);
toolWindow.aggregate(onToolWindow, AggregationPosition.BOTTOM);
} else {
if (checkCondition(toolWindow)) {
toolWindow.setAnchor(dragAnchor);
toolWindow.aggregate(AggregationPosition.BOTTOM);
}
}
break;
case TOP:
if (onToolWindow != null) {
toolWindow.setAnchor(dragAnchor, anchorIndex != -1 ? anchorIndex - 1 : -1);
toolWindow.aggregate(onToolWindow, AggregationPosition.TOP);
} else {
if (checkCondition(toolWindow)) {
toolWindow.setAnchor(dragAnchor, 0);
toolWindow.aggregate(AggregationPosition.TOP);
}
}
break;
}
} else {
if (onToolWindow != null && toolWindow != onToolWindow) {
onToolWindow.addToolWindowTab(toolWindow).setSelected(true);
} else {
toolWindow.aggregate();
}
}
toolWindow.setActive(true);
} finally {
toolWindow.setAggregateMode(oldAggregateMode);
}
return true;
} else
return false;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} else if (transferable.isDataFlavorSupported(MyDoggyTransferable.CONTENT_ID_DF)) {
try {
Content content = getContentManager().getContent(
transferable.getTransferData(MyDoggyTransferable.CONTENT_ID_DF)
);
if (content != null) {
getContentManager().removeContent(content);
if (content.getDockableDelegator() != null) {
Dockable delegator = content.getDockableDelegator();
if (delegator instanceof ToolWindow) {
ToolWindow toolWindow = (ToolWindow) delegator;
ToolWindow onToolWindow = (ToolWindow) getOnDockable();
int anchorIndex = (onToolWindow != null) ? onToolWindow.getAnchorIndex() : -1;
if (toolWindow == onToolWindow)
return false;
boolean oldAggregateMode = toolWindow.isAggregateMode();
toolWindow.setAggregateMode(true);
ToolWindowAnchor dragAnchor = getOnAnchor();
try {
toolWindow.setAnchor(dragAnchor, anchorIndex);
if (dragAnchor != null) {
switch (dragAnchor) {