Package jmri.jmrit.beantable
Class Maintenance
java.lang.Object
jmri.jmrit.beantable.Maintenance
A collection of static utilities to provide cross referencing information
among the various PanelPro objects. Most likely, this is incomplete as there
still may be references held by objects unknown to the author. It is intended
to inform users where and how the various elements are used. In particular to
identify useless elements ('orphans'). Currently, called only from the Logix
JFrame, which is probably not its ultimate UI.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddeviceReportPressed(String devName, Frame parent) Find references of a System or User name in the various Manager Objects.static voidfindEmptyPressed(Frame parent) Find useless Conditionals in the various Manager Objects.static voidfindOrphansPressed(Frame parent) Find orphaned elements in the various Manager Objects.(package private) static String[]getTypeAndNames(String name) Find type of element and its names from a name that may be a user name or a system name.(package private) static voidmakeDialog(Component component, Component button, Frame parent, String title) Build and display a dialog box with an OK button and optional 2nd button.(package private) static booleanSearch if a given string is used as the name of a NamedBean.(package private) static booleantestName(String name, boolean found, String[] names, String line1, String line2, String line, StringBuilder tempText) Check if a given string is either a user or a system name.
-
Field Details
-
rbm
-
-
Constructor Details
-
Maintenance
public Maintenance()
-
-
Method Details
-
deviceReportPressed
Find references of a System or User name in the various Manager Objects.- Parameters:
devName- name to look forparent- Frame calling this method
-
findOrphansPressed
Find orphaned elements in the various Manager Objects.- Parameters:
parent- Frame to check
-
findEmptyPressed
Find useless Conditionals in the various Manager Objects.- Parameters:
parent- Frame to check
-
getTypeAndNames
Find type of element and its names from a name that may be a user name or a system name.Searches each Manager for a reference to the "name".
- Parameters:
name- string (name base) to look for- Returns:
- 4 element String array: {Type, userName, sysName, numListeners} - This should probably return an instance of a custom type rather than a bunch of string names
-
testName
static boolean testName(String name, boolean found, String[] names, String line1, String line2, String line, StringBuilder tempText) Check if a given string is either a user or a system name.- Parameters:
name- the string to comparefound- whether the item has already been found somewherenames- array containing system and user name as items 0 and 1line1- message line 1 to use if string is not matchedline2- message line 2 to use if string is not matchedline- message line to use if string is matchedtempText- body of text to add to, a global variable- Returns:
- false if name is null or cannot be matched to the names array
-
search
Search if a given string is used as the name of a NamedBean.- Parameters:
name- the string to look fortext- body of the message to be displayed reporting the result- Returns:
- true if name is found at least once as a bean name
-
makeDialog
Build and display a dialog box with an OK button and optional 2nd button.- Parameters:
component- Body of message to put in dialog boxbutton- optional second button to add to paneparent- Frame that asked for this dialogtitle- text do use as title of the dialog box
-