Package jmri.jmrit.display
Class EditorManager
java.lang.Object
jmri.beans.UnboundBean
jmri.beans.Bean
jmri.jmrit.display.EditorManager
- All Implemented Interfaces:
PropertyChangeListener,EventListener,BeanInterface,PropertyChangeFirer,PropertyChangeProvider,InstanceManagerAutoDefault
public class EditorManager
extends Bean
implements PropertyChangeListener, 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 Summary
FieldsFields inherited from class jmri.beans.Bean
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an editor to this manager.booleanCheck if an editor with the specified name is in the manager.booleanCheck if an editor is in the manager.<T extends Editor>
TGet the editor with the given name and type.Get the editor with the given title.getAll()Get all managed editors.Get all managed editors that implement the specified type.Get the editor with the given name.Set the title for the Preferences / Messages tab.getList()Get the set of all Editors as a List.Get the set of all editors that implement the specified type.getTargetFrame(String name) Get the editor with the given name or the editor with the given target frame name.voidvoidRemove an editor from this manager.voidSet the details for Preferences / Messages tab.Methods inherited from class jmri.beans.Bean
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, isNotifyOnEDT, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class jmri.beans.UnboundBean
getIndexedProperty, getProperty, getPropertyNames, hasIndexedProperty, hasProperty, setIndexedProperty, setProperty
-
Field Details
-
EDITORS
- See Also:
-
TITLE
- See Also:
-
-
Constructor Details
-
EditorManager
public EditorManager()
-
-
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
Add an editor to this manager.- Parameters:
editor- the editor to add
-
contains
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
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
Get the editor with the given name and type.- Type Parameters:
T- the type of the editor- Parameters:
type- the type of the editorname- the name of the editor- Returns:
- the editor with the given name or null if no editor by that name exists
-
remove
Remove an editor from this manager.- Parameters:
editor- the editor to remove
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
contains
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
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
-