void () { if (myDimensionServiceKey != null && myInitialSize != null && myOpened) { // myInitialSize can be null only if dialog is disposed before first showing if (LOG.isDebugEnabled()) { LOG.debug("Saving the bounds of a dialog titled '" + getTitle() + "', the monitor configuration is:"); logMonitorConfiguration(); } final Project projectGuess = guessProjectDependingOnKey(myDimensionServiceKey); // Save location Point location = getLocation(); getWindowStateService(projectGuess).putLocation(myDimensionServiceKey, location); if (LOG.isDebugEnabled()) { LOG.debug("Saved location: " + location); } // Save size Dimension size = getSize(); if (!myInitialSize.equals(size)) { getWindowStateService(projectGuess).putSize(myDimensionServiceKey, size); if (LOG.isDebugEnabled()) { LOG.debug("Saved size: " + size + " (the initial size was " + myInitialSize + ")"); } } else if (LOG.isDebugEnabled()) { LOG.debug("Didn't save size because it's the same as the initial size: " + size); } myOpened = false; } }