Class PreferencesDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class PreferencesDialog extends MCreatorDialog
See Also:
  • Constructor Details

    • PreferencesDialog

      public PreferencesDialog(Window parent)
    • PreferencesDialog

      public PreferencesDialog(Window parent, @Nullable String selectedTab)
  • Method Details

    • addPage

      public void addPage(String name, JComponent page, Runnable onSave)

      Adds a custom page to this dialog, shown when the section with the given name is selected. Pages added this way store their own values, e.g. in PreferencesEntry instances of a hidden PreferencesSection, and call markChanged() when the user changes something.

      Java plugins can add pages from PreferencesDialogEvent.SectionsLoaded. The page can be opened directly by passing its name as the selected tab to PreferencesDialog(Window, String).

      Parameters:
      name - Name of the section shown in the list of sections, also used to identify the page
      page - Component shown when the section is selected
      onSave - Called when preferences are saved, before they are written to the preferences file
    • addEditTemplatesPanel

      public void addEditTemplatesPanel(BlocklyEditorType type)
    • addEditTemplatesPanel

      public void addEditTemplatesPanel(String translationKey, String folder, String extension)
    • markChanged

      public void markChanged()