app/src/main/java/com/oracle/javafx/scenebuilder/app/preferences/PreferencesRecordDocument.java
public void writeToJavaPreferences() {

    final URL fxmlLocation = documentWindowController.getEditorController().getFxmlLocation();
    if (fxmlLocation == null) {
      // Document has not been saved => nothing to write
      // This is the case with initial empty document
      return;
    }

    // There is no preferences for this document in the Java preferences DB
    // => create a new preference node
    if (documentPreferences == null) {
      try {
        final File fxmlFile = new File(fxmlLocation.toURI());
        final String filePath = fxmlFile.getPath();
        final String key = generateKey(fxmlFile.getName());
        assert documentsRootPreferences.nodeExists(key) == false;
        // Create a new document preference node under the document root node
        documentPreferences = documentsRootPreferences.node(key);
        // Document path
        documentPreferences.put(PATH, filePath);
      } catch (BackingStoreException ex) {
        Logger.getLogger(PreferencesRecordDocument.class.getName()).log(Level.SEVERE, null, ex);
        return;
      } catch (URISyntaxException ex) {
        Logger.getLogger(PreferencesRecordDocument.class.getName()).log(Level.SEVERE, null, ex);
      }
    }

    assert documentPreferences != null;

    // Window position
    documentPreferences.putDouble(X_POS, getXPos());
    documentPreferences.putDouble(Y_POS, getYPos());

    // Window size
    documentPreferences.putDouble(STAGE_HEIGHT, getStageHeight());
    documentPreferences.putDouble(STAGE_WIDTH, getStageWidth());

    // Panel visibility
    documentPreferences.putBoolean(BOTTOM_VISIBLE, getBottomVisible());
    documentPreferences.putBoolean(LEFT_VISIBLE, getLeftVisible());
    documentPreferences.putBoolean(RIGHT_VISIBLE, getRightVisible());
    documentPreferences.putBoolean(LIBRARY_VISIBLE, getLibraryVisible());
    documentPreferences.putBoolean(DOCUMENT_VISIBLE, getDocumentVisible());

    // Inspector expanded TitledPane
    if (getInspectorSectionId() != null) { // Section ID is null when View Mode differs from section
      documentPreferences.put(INSPECTOR_SECTION_ID, getInspectorSectionId().name());
    }

    // Dividers position
    documentPreferences.putDouble(LEFT_DIVIDER_HPOS, getLeftDividerHPos());
    documentPreferences.putDouble(RIGHT_DIVIDER_HPOS, getRightDividerHPos());
    documentPreferences.putDouble(BOTTOM_DIVIDER_VPOS, getBottomDividerVPos());
    documentPreferences.putDouble(LEFT_DIVIDER_VPOS, getLeftividerVPos());

    // Scene style sheets
    final StringBuilder sb = new StringBuilder();
    for (String sceneStyleSheet : getSceneStyleSheets()) {
      sb.append(sceneStyleSheet);
      sb.append(File.pathSeparator);
    }
    documentPreferences.put(SCENE_STYLE_SHEETS, sb.toString());

    // I18NResource
    final String resource = getI18NResource();
    if (resource != null) {
      documentPreferences.put(I18N_RESOURCE, resource);
    } else {
      documentPreferences.remove(I18N_RESOURCE);
    }

    // Theme
    final EditorPlatform.Theme docTheme = getTheme();
    documentPreferences.put(THEME, docTheme.name());
  }
/** Write the properties data to the java preferences DB. */
Write the properties data to the java preferences DB.
Write the properties data to the java preferences DB .
public void writeToJavaPreferences() {
    final URL fxmlLocation = documentWindowController.getEditorController().getFxmlLocation();
    if (fxmlLocation == null) {
      return;
    }
    if (documentPreferences == null) {
      try {
        final File fxmlFile = new File(fxmlLocation.toURI());
        final String filePath = fxmlFile.getPath();
        final String key = generateKey(fxmlFile.getName());
        assert documentsRootPreferences.nodeExists(key) == false;
        documentPreferences = documentsRootPreferences.node(key);
        documentPreferences.put(PATH, filePath);
      } catch (BackingStoreException ex) {
        Logger.getLogger(PreferencesRecordDocument.class.getName()).log(Level.SEVERE, null, ex);
        return;
      } catch (URISyntaxException ex) {
        Logger.getLogger(PreferencesRecordDocument.class.getName()).log(Level.SEVERE, null, ex);
      }
    }
    assert documentPreferences != null;
    documentPreferences.putDouble(X_POS, getXPos());
    documentPreferences.putDouble(Y_POS, getYPos());
    documentPreferences.putDouble(STAGE_HEIGHT, getStageHeight());
    documentPreferences.putDouble(STAGE_WIDTH, getStageWidth());
    documentPreferences.putBoolean(BOTTOM_VISIBLE, getBottomVisible());
    documentPreferences.putBoolean(LEFT_VISIBLE, getLeftVisible());
    documentPreferences.putBoolean(RIGHT_VISIBLE, getRightVisible());
    documentPreferences.putBoolean(LIBRARY_VISIBLE, getLibraryVisible());
    documentPreferences.putBoolean(DOCUMENT_VISIBLE, getDocumentVisible());
    if (getInspectorSectionId() != null) { 
      documentPreferences.put(INSPECTOR_SECTION_ID, getInspectorSectionId().name());
    }
    documentPreferences.putDouble(LEFT_DIVIDER_HPOS, getLeftDividerHPos());
    documentPreferences.putDouble(RIGHT_DIVIDER_HPOS, getRightDividerHPos());
    documentPreferences.putDouble(BOTTOM_DIVIDER_VPOS, getBottomDividerVPos());
    documentPreferences.putDouble(LEFT_DIVIDER_VPOS, getLeftividerVPos());
    final StringBuilder sb = new StringBuilder();
    for (String sceneStyleSheet : getSceneStyleSheets()) {
      sb.append(sceneStyleSheet);
      sb.append(File.pathSeparator);
    }
    documentPreferences.put(SCENE_STYLE_SHEETS, sb.toString());
    final String resource = getI18NResource();
    if (resource != null) {
      documentPreferences.put(I18N_RESOURCE, resource);
    } else {
      documentPreferences.remove(I18N_RESOURCE);
    }
    final EditorPlatform.Theme docTheme = getTheme();
    documentPreferences.put(THEME, docTheme.name());
  }
public void writeToJavaPreferences ( ) { final URL fxmlLocation = documentWindowController . getEditorController ( ) . getFxmlLocation ( ) ; if ( fxmlLocation == null ) { return ; } if ( documentPreferences == null ) { try { final File fxmlFile = new File ( fxmlLocation . toURI ( ) ) ; final String filePath = fxmlFile . getPath ( ) ; final String key = generateKey ( fxmlFile . getName ( ) ) ; assert documentsRootPreferences . nodeExists ( key ) == false ; documentPreferences = documentsRootPreferences . node ( key ) ; documentPreferences . put ( PATH , filePath ) ; } catch ( BackingStoreException ex ) { Logger . getLogger ( PreferencesRecordDocument . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; return ; } catch ( URISyntaxException ex ) { Logger . getLogger ( PreferencesRecordDocument . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } assert documentPreferences != null ; documentPreferences . putDouble ( X_POS , getXPos ( ) ) ; documentPreferences . putDouble ( Y_POS , getYPos ( ) ) ; documentPreferences . putDouble ( STAGE_HEIGHT , getStageHeight ( ) ) ; documentPreferences . putDouble ( STAGE_WIDTH , getStageWidth ( ) ) ; documentPreferences . putBoolean ( BOTTOM_VISIBLE , getBottomVisible ( ) ) ; documentPreferences . putBoolean ( LEFT_VISIBLE , getLeftVisible ( ) ) ; documentPreferences . putBoolean ( RIGHT_VISIBLE , getRightVisible ( ) ) ; documentPreferences . putBoolean ( LIBRARY_VISIBLE , getLibraryVisible ( ) ) ; documentPreferences . putBoolean ( DOCUMENT_VISIBLE , getDocumentVisible ( ) ) ; if ( getInspectorSectionId ( ) != null ) { documentPreferences . put ( INSPECTOR_SECTION_ID , getInspectorSectionId ( ) . name ( ) ) ; } documentPreferences . putDouble ( LEFT_DIVIDER_HPOS , getLeftDividerHPos ( ) ) ; documentPreferences . putDouble ( RIGHT_DIVIDER_HPOS , getRightDividerHPos ( ) ) ; documentPreferences . putDouble ( BOTTOM_DIVIDER_VPOS , getBottomDividerVPos ( ) ) ; documentPreferences . putDouble ( LEFT_DIVIDER_VPOS , getLeftividerVPos ( ) ) ; final StringBuilder sb = new StringBuilder ( ) ; for ( String sceneStyleSheet : getSceneStyleSheets ( ) ) { sb . append ( sceneStyleSheet ) ; sb . append ( File . pathSeparator ) ; } documentPreferences . put ( SCENE_STYLE_SHEETS , sb . toString ( ) ) ; final String resource = getI18NResource ( ) ; if ( resource != null ) { documentPreferences . put ( I18N_RESOURCE , resource ) ; } else { documentPreferences . remove ( I18N_RESOURCE ) ; } final EditorPlatform . Theme docTheme = getTheme ( ) ; documentPreferences . put ( THEME , docTheme . name ( ) ) ; }
Write the properties data to the java preferences DB.
Write the properties data to the java preferences DB .
// Document has not been saved => nothing to write // This is the case with initial empty document // There is no preferences for this document in the Java preferences DB // => create a new preference node // Create a new document preference node under the document root node // Document path // Window position // Window size // Panel visibility // Inspector expanded TitledPane // Section ID is null when View Mode differs from section // Dividers position // Scene style sheets // I18NResource // Theme