Interface GlobalOptionsStorage

All Known Subinterfaces:
EclipsePluginWorkspace, PluginWorkspace, StandalonePluginWorkspace, WebappPluginWorkspace

@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface GlobalOptionsStorage
This interface should be used to access global application options.
Since:
18
  • Method Details

    • addGlobalOptionListener

      void addGlobalOptionListener(OptionListener listener)
      Adds an OptionListener to the current set of options. The listener is notified when the value of its associated option changes.
      Parameters:
      listener - The OptionListener to be added.
    • removeGlobalOptionListener

      void removeGlobalOptionListener(OptionListener listener)
      Removes an option listener from the current set of option listeners.
      Parameters:
      listener - The OptionListener to be removed.
    • getGlobalObjectProperty

      Object getGlobalObjectProperty(String key)
      Provides the value of the option associated with the specified key. You can only get values for keys defined in the APIAccessibleOptionTags interface.
      Parameters:
      key - The key that uniquely identifies an option.
      Returns:
      The value corresponding to the key or null.
      Throws:
      IllegalArgumentException - If the given key is not accessible via the API.
    • setGlobalObjectProperty

      void setGlobalObjectProperty(String key, Object value)
      Sets a global property in the Oxygen common preferences. You can use such methods to overwrite some global preferences in Oxygen with your own values. To find the key and value types which needs to be overwritten you can export the application preferences to XML (Options -> Export Global Options).
      Parameters:
      key - The key of the option whose value is to be modified.
      value - The new value of the option.
      Since:
      15
    • importGlobalOptions

      void importGlobalOptions(File optionsFile)
      Sets global properties in the Oxygen common preferences. You can use such methods to overwrite some global preferences in Oxygen with your own values. Existing options with keys which are not present in the imported options file will be preserved.
      Parameters:
      optionsFile - The file containing the XML options exported from an Oxygen installation.
      Since:
      16
    • importGlobalOptions

      void importGlobalOptions(File optionsFile, boolean preserveExistingOptionKeys) throws IOException
      Sets global properties in the Oxygen common preferences. You can use such methods to overwrite some global preferences in Oxygen with your own values.
      Parameters:
      optionsFile - The file containing the XML options exported from an Oxygen installation.
      preserveExistingOptionKeys - If true existing options with keys which are not present in the imported options file will be preserved. Otherwise the existing options with keys which are not present in the imported options file are reset to default.
      Throws:
      IOException - If some type of problem arises during the import or if the file cannot be accessed.
      Since:
      18.1
    • saveGlobalOptions

      void saveGlobalOptions() throws IOException
      Save the global application options to their default persistence location.
      Throws:
      IOException - If the save operation fails.
      Since:
      15.2
    • showPreferencesPages

      void showPreferencesPages(String[] pagesToShowKeys, String pageToSelectKey, boolean showChildrenOfPages)
      Show the preferences dialog, with only the desired pages displayed in the table of contents, and select a specific options page.

      The pages to be shown or selected in the dialog are provided using their keys. For the stand-alone application each key corresponds to a OptionPagePluginExtension key (returned via the ro.sync.exml.plugin.option.OptionPagePluginExtension.getKey() method). For Eclipse the keys are actually the IDs of the corresponding <page> elements from plugin.xml.
      Parameters:
      pagesToShowKeys - The keys of the option pages to be shown in the table of contents.
      pageToSelectKey - The key of the page to be selected in the table of contents.
      showChildrenOfPages - True to also show the children of the option pages in the table of contents, false not to show them.
      Since:
      17.1
    • serializePersistentObject

      String serializePersistentObject(Object persistentObject) throws IOException
      Serialize a persistent object to an XML string.
      Parameters:
      persistentObject - The persistent object. It must be an instance of ro.sync.options.PersistentObject
      Returns:
      A string representation of the object in XML format.
      Throws:
      IOException - Thrown if something goes wrong during the serialization.
      Since:
      21
    • deserializePersistentObject

      Object deserializePersistentObject(String persistentObjectStringRepresentation) throws IOException
      De-serialize a persistent object which has previously been serialized as XML using the "serializePersistentObject" method.
      Parameters:
      persistentObjectStringRepresentation - The XML representation of the object.
      Returns:
      The persistent object or null.
      Throws:
      IOException - Thrown if something goes wrong during the de-serialization.
      Since:
      21