/**
  * @param storage
  * @param propertyName
  */
 public void storeDialogPositions(
     JDialog dialog, WindowConfigurationStorage storage, String propertyName) {
   storage.setX((dialog.getX()));
   storage.setY((dialog.getY()));
   storage.setWidth((dialog.getWidth()));
   storage.setHeight((dialog.getHeight()));
   String marshalled = marshall(storage);
   setProperty(propertyName, marshalled);
 }
 public WindowConfigurationStorage decorateDialog(JDialog dialog, String propertyName) {
   String unmarshalled = getProperty(propertyName);
   if (unmarshalled != null) {
     WindowConfigurationStorage storage = (WindowConfigurationStorage) unMarshall(unmarshalled);
     if (storage != null) {
       dialog.setLocation(storage.getX(), storage.getY());
       dialog
           .getRootPane()
           .setPreferredSize(new Dimension(storage.getWidth(), storage.getHeight()));
     }
     return storage;
   }
   return null;
 }