Class EditorManager

java.lang.Object
jmri.beans.UnboundBean
jmri.beans.Bean
jmri.jmrit.display.EditorManager
All Implemented Interfaces:
PropertyChangeListener, EventListener, BeanInterface, PropertyChangeFirer, PropertyChangeProvider, InstanceManagerAutoDefault

Manager for JMRI Editors. This manager tracks editors, extending the Set interface to do so (so it can be interacted with as a normal set), while also providing some methods specific to editors.

This manager listens to the title property of Editors to be notified to changes to the title of the Editor that could affect the order of editors.

This manager generates an IndexedPropertyChangeEvent for the property named editors when an editor is added or removed and forwards the PropertyChangeEvent for the title property of Editors in the manager.

  • Field Details

  • Constructor Details

  • Method Details

    • getClassDescription

      Set the title for the Preferences / Messages tab. Called by JmriUserPreferencesManager.
      Returns:
      the title string.
    • setMessagePreferencesDetails

      Set the details for Preferences / Messages tab. Called by JmriUserPreferencesManager.

      The dialogs are in jmri.configurexml.LoadXmlConfigAction and jmri.jmrit.display.Editor. They are anchored here since the preferences system appears to need a class that can instantiated.

    • add

      public void add(@Nonnull Editor editor)
      Add an editor to this manager.
      Parameters:
      editor - the editor to add
    • contains

      public boolean contains(@Nonnull Editor editor)
      Check if an editor is in the manager.
      Parameters:
      editor - the editor to check for
      Returns:
      true if this manager contains an editor with name; false otherwise
    • getAll

      Get all managed editors. This set is sorted by the title of the editor.
      Returns:
      the set of all editors
    • getAll

      @Nonnull public <T extends Editor> SortedSet<T> getAll(@Nonnull Class<T> type)
      Get all managed editors that implement the specified type. This set is sorted by the title of the editor.
      Type Parameters:
      T - the specified type
      Parameters:
      type - the specified type
      Returns:
      the set of all editors of the specified type
    • get

      Get the editor with the given title.
      Parameters:
      title - the title of the editor
      Returns:
      the editor with the given title or null if no editor by that title exists
    • getByName

      Get the editor with the given name.
      Parameters:
      name - the name of the editor
      Returns:
      the editor with the given name or null if no editor by that name exists
    • getTargetFrame

      Get the editor with the given name or the editor with the given target frame name.
      Parameters:
      name - the name of the editor or target frame
      Returns:
      the editor or null
    • get

      @CheckForNull public <T extends Editor> T get(@Nonnull Class<T> type, @Nonnull String name)
      Get the editor with the given name and type.
      Type Parameters:
      T - the type of the editor
      Parameters:
      type - the type of the editor
      name - the name of the editor
      Returns:
      the editor with the given name or null if no editor by that name exists
    • remove

      public void remove(@Nonnull Editor editor)
      Remove an editor from this manager.
      Parameters:
      editor - the editor to remove
    • propertyChange

      Specified by:
      propertyChange in interface PropertyChangeListener
    • contains

      public boolean contains(String name)
      Check if an editor with the specified name is in the manager.
      Parameters:
      name - the name to check for
      Returns:
      true if this manager contains an editor with name; false otherwise
    • getList

      Get the set of all Editors as a List. This is a convenience method for use in scripts.
      Returns:
      the set of all Editors
    • getList

      @Nonnull public <T extends Editor> List<T> getList(@Nonnull Class<T> type)
      Get the set of all editors that implement the specified type. This is a convenience method for use in scripts.
      Type Parameters:
      T - the specified type
      Parameters:
      type - the specified type
      Returns:
      the set of all editors that implement the specified type