Point () { // handle dimension service manually to store dimensions correctly when switching between search/replace in the same dialog final DimensionService dimensionService = DimensionService.getInstance(); final Dimension size = dimensionService.getSize(myReplace ? REPLACE_DIMENSION_SERVICE_KEY : SEARCH_DIMENSION_SERVICE_KEY, myProject); if (size != null) { setSize(size.width, myEditConfigOnly ? size.height - myScopePanel.getPreferredSize().height : size.height); } else { pack(); // set width from replace if search not available and vice versa final Dimension otherSize = dimensionService.getSize(myReplace ? SEARCH_DIMENSION_SERVICE_KEY : REPLACE_DIMENSION_SERVICE_KEY, myProject); if (otherSize != null) { setSize(otherSize.width, getSize().height); } } if (myEditConfigOnly) return super.getInitialLocation(); final Point location = dimensionService.getLocation(SEARCH_DIMENSION_SERVICE_KEY, myProject); return (location == null) ? super.getInitialLocation() : location; }