Package jmri.jmrit.beantable
Class Maintenance
- java.lang.Object
-
- jmri.jmrit.beantable.Maintenance
-
public class Maintenance extends java.lang.Object
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 Modifier and Type Field Description (package private) static java.util.ResourceBundle
rbm
-
Constructor Summary
Constructors Constructor Description Maintenance()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
deviceReportPressed(java.lang.String devName, java.awt.Frame parent)
Find references of a System or User name in the various Manager Objects.static void
findEmptyPressed(java.awt.Frame parent)
Find useless Conditionals in the various Manager Objects.static void
findOrphansPressed(java.awt.Frame parent)
Find orphaned elements in the various Manager Objects.(package private) static java.lang.String[]
getTypeAndNames(java.lang.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 void
makeDialog(java.awt.Component component, java.awt.Component button, java.awt.Frame parent, java.lang.String title)
Build and display a dialog box with an OK button and optional 2nd button.(package private) static boolean
search(java.lang.String name, javax.swing.JTextArea text)
Search if a given string is used as the name of a NamedBean.(package private) static boolean
testName(java.lang.String name, boolean found, java.lang.String[] names, java.lang.String line1, java.lang.String line2, java.lang.String line, java.lang.StringBuilder tempText)
Check if a given string is either a user or a system name.
-
-
-
Field Detail
-
rbm
static final java.util.ResourceBundle rbm
-
-
Constructor Detail
-
Maintenance
public Maintenance()
-
-
Method Detail
-
deviceReportPressed
public static void deviceReportPressed(java.lang.String devName, java.awt.Frame parent)
Find references of a System or User name in the various Manager Objects.- Parameters:
devName
- name to look forparent
- Frame calling this method
-
findOrphansPressed
public static void findOrphansPressed(java.awt.Frame parent)
Find orphaned elements in the various Manager Objects.- Parameters:
parent
- Frame to check
-
findEmptyPressed
public static void findEmptyPressed(java.awt.Frame parent)
Find useless Conditionals in the various Manager Objects.- Parameters:
parent
- Frame to check
-
getTypeAndNames
@Nonnull static java.lang.String[] getTypeAndNames(@Nonnull java.lang.String name)
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(java.lang.String name, boolean found, java.lang.String[] names, java.lang.String line1, java.lang.String line2, java.lang.String line, java.lang.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
static boolean search(java.lang.String name, javax.swing.JTextArea text)
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
static void makeDialog(java.awt.Component component, java.awt.Component button, java.awt.Frame parent, java.lang.String title)
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
-
-