Class PreferencesStorage

java.lang.Object
org.jppf.ui.monitoring.charts.config.PreferencesStorage

public class PreferencesStorage extends Object
This class provides an API to store and retrieve the chart configuration preferences, using the preferences mechanism.
Author:
Laurent Cohen
  • Constructor Details

    • PreferencesStorage

      public PreferencesStorage(JPPFChartBuilder chartBuilder)
      Initialize this preferences storage with a specified chart builder.
      Parameters:
      chartBuilder - the chart builder from which to get the charts.
  • Method Details

    • loadChartConfigurations

      public void loadChartConfigurations()
      Load all chart configurations from the preferences tree, and create the corresponding charts.
    • loadDefaultChartConfigurations

      public void loadDefaultChartConfigurations()
      Load all chart configurations from the preferences tree, and create the corresponding charts.
    • loadTabCharts

      public ChartConfiguration[] loadTabCharts(Preferences tabNode)
      Load the chart configurations for a tab from a specified tab preferences node.
      Parameters:
      tabNode - the tab preferences node that contains the chart configuration nodes.
      Returns:
      an array of ChartConfiguration instances.
    • loadChartConfiguration

      public ChartConfiguration loadChartConfiguration(Preferences child)
      Load a chart configuration from a preferences node.
      Parameters:
      child - the preferences node to load the configuration from.
      Returns:
      a ChartConfiguration instance.
    • saveAll

      public void saveAll()
      Save all tabs and charts configurations in the user preferences.
    • saveTabConfiguration

      public void saveTabConfiguration(TabConfiguration tab)
      Save a specified tab configuration in the preferences tree.
      Parameters:
      tab - the tab to save.
    • saveChartConfiguration

      public void saveChartConfiguration(TabConfiguration tab, ChartConfiguration config)
      Save a specified chart configuration in the preferences tree.
      Parameters:
      tab - the tab into which to save the configuration.
      config - the configuration to save.
    • removeAllSaved

      public void removeAllSaved()
      Remove all tabs and charts configurations from the user preferences.