Component content = getContentContainer();
content.setVisible(true);
window.getContentPane().add(content, "1,1,FULL,FULL");
if (lastBounds == null) {
FloatingTypeDescriptor typeDescriptor = (FloatingTypeDescriptor) descriptor.getTypeDescriptor(ToolWindowType.FLOATING);
// Set Size
if (typeDescriptor.getSize() == null) {
Window windowAnchestor = descriptor.getWindowAnchestor();
window.setSize(windowAnchestor.getWidth() / 2, (int) (windowAnchestor.getHeight() / 1.5));
} else {
window.setSize(typeDescriptor.getSize());
}
// Set Location
if (typeDescriptor.getLocation() == null) {
if (content.getX() == 0 || content.getY() == 0)
SwingUtil.centrePositionOnScreen(window);
} else
window.setLocation(typeDescriptor.getLocation());
} else {
window.setBounds(lastBounds);
lastBounds = null;
}