{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Preferences Editor","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":false}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"preferences-editor","__idx":0},"children":["Preferences Editor"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"preferences-editor-extension","__idx":1},"children":["Preferences Editor Extension"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/intviewer/intviewer-tutorial/using-intviewer-components-walkthroughs/adding-a-preferences-dialog-walkthrough"},"children":["walkthrough"]}," is available for the addition of a preferences dialog."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["PreferencesDialog"]}," is a centralized location for the user to change an application's settings. The ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["PreferencesDialog"]}," is designed to be extended. If you provide a new plugin for INTViewer, you can extend the ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["PreferencesDialog"]}," so that the user can configure the preferences (settings) relevant to your plugin. INTViewer itself extends this dialog. The extension consists of implementation of ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["IObjectEditor"]}," and configuration entries. The ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["IObjectEditor"]}," is simple interface with two methods:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["IOBJECTEDITOR INTERFACE"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"public interface IObjectEditor {\n    /**\n     * Gets the editor panel for the object to be edited\n     * @return a JPanel for the editor\n     */\n    JPanel getPanel();\n    /**\n     * Applies any editor parameters selected by user to the object.\n     */\n    void apply();\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It is just a JPanel factory which is responsible for user interface. When user presses \"apply\" button the method ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["apply()"]}," is called. Inside this call all preferences should be saved to persistent storage. Any storage could be used to save/restore settings, but Java Preferences API is preferable, because it is a standard. The ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["PreferencesDialog"]}," uses layer.xml configuration file to hook up all _IObjectEditor_s. An example of the use of the Java Preferences API is available in the form of a DemoPreferencesUtil.java file at the bottom of the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/intviewer/intviewer-tutorial/using-intviewer-components-walkthroughs/adding-a-preferences-dialog-walkthrough"},"children":["Adding a new Preference Dialog Walkthrough"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configuration node looks like:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PREFERENCE CONFIGURATION NODE"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"<filesystem>\n <folder name=\"PreferencePanels\">\n  <folder name=\"Gui Preferences\"> <!- This folder is optional ->\n   <folder name=\"Cursor\">\n    <attr name=\"editor\" stringvalue = \"com.interactive.intviewer.gui.preferences.CursorPreferenceEditor\"/>\n    <attr name =\"help\"  stringvalue = \"preferences_tracking_cursor\"/>\n   </folder>\n  </folder>\n </folder>\n</filesystem>\n","lang":"xml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All extensions are organized as a tree. The ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["PreferencePanels"]}," node is a root. Each xml node (folder) may have two optional attributes- \"editor\" and \"help\". First one is just a full name of IObjectEditor implementation. Second one is java help id. This tree may have any number of levels. In code above folder \"Gui Preferences\" is used for grouping several editors together."]}]},"headings":[{"value":"Preferences Editor","id":"preferences-editor","depth":1},{"value":"Preferences Editor Extension","id":"preferences-editor-extension","depth":2}],"frontmatter":{"title":"Preferences Editor","pageId":"other-useful-intviewer-apis/preferences-editor","seo":{"title":"Preferences Editor"}},"lastModified":"2026-10-22T14:32:05.579Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/intviewer/other-useful-intviewer-apis/preferences-editor","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}