private static void saveDialogSettings(SashForm sashForm, IDialogSettings dialogSettings) {
   if (dialogSettings != null) {
     int[] weights = sashForm.getWeights();
     String[] weightStrings = new String[weights.length];
     for (int i = 0; i < weights.length; i++) {
       weightStrings[i] = String.valueOf(weights[i]);
     }
     dialogSettings.put(SASH_WEIGHTS_SETTING, weightStrings);
   }
 }
 /**
  * Persists dialog settings.
  *
  * @param shell
  */
 private void persistSettings(Shell shell) {
   if (shell != null && !shell.isDisposed()) {
     if (isResizable()) {
       IDialogSettings settings = getDialogSettings(true);
       Point size = shell.getSize();
       settings.put(WIDTH, size.x);
       settings.put(HEIGHT, size.y);
       int[] weights = fSashForm.getWeights();
       if (weights.length == 1) {
         settings.put(SASH_WEIGHT_TREE, weights[0]);
       } else if (weights.length == 2) {
         settings.put(SASH_WEIGHT_TREE, weights[0]);
         settings.put(SASH_WEIGHT_DETAILS, weights[1]);
       }
     }
   }
 }
 // --------------------------------------------------------------------------------
 private void onSashResize() {
   if (System.currentTimeMillis() >= initializedTime + 3000) {
     prop.setProperty(DOCUMENT_COMPOSITE_WEIGHT, sashForm.getWeights());
   }
 }