Package jmri.util.swing
Class GuiUtilBase
- java.lang.Object
-
- jmri.util.swing.GuiUtilBase
-
- Direct Known Subclasses:
JMenuUtil
,JToolBarUtil
,JTreeUtil
public class GuiUtilBase extends java.lang.Object
Common utility methods for working with GUI items
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
GuiUtilBase.CallingAbstractAction
-
Constructor Summary
Constructors Constructor Description GuiUtilBase()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static javax.swing.Action
actionFromNode(org.jdom2.Element child, WindowInterface wi, java.lang.Object context)
(package private) static javax.swing.Action
createActionInCallingWindow(java.lang.Object obj, java.lang.String[] args, java.lang.String name, javax.swing.Icon icon)
Create an action against the object that invoked the creation of the GUIBase, a string array is used so that in the future further options can be specified to be passed.(package private) static javax.swing.Action
createEmptyMenuItem(javax.swing.Icon icon, java.lang.String name)
protected static org.jdom2.Element
rootFromName(java.lang.String name)
Get root element from XML file, handling errors locally.(package private) static void
setParameters(JmriAbstractAction act, java.util.HashMap<java.lang.String,java.lang.String> parameters)
-
-
-
Constructor Detail
-
GuiUtilBase
public GuiUtilBase()
-
-
Method Detail
-
actionFromNode
static javax.swing.Action actionFromNode(org.jdom2.Element child, WindowInterface wi, java.lang.Object context)
-
createActionInCallingWindow
static javax.swing.Action createActionInCallingWindow(java.lang.Object obj, java.lang.String[] args, java.lang.String name, javax.swing.Icon icon)
Create an action against the object that invoked the creation of the GUIBase, a string array is used so that in the future further options can be specified to be passed.- Parameters:
obj
- the object to create an action forargs
- arguments to passed remoteCalls method of objname
- name of the actionicon
- icon for the action- Returns:
- the action for obj or an empty action with name and icon
-
createEmptyMenuItem
static javax.swing.Action createEmptyMenuItem(javax.swing.Icon icon, java.lang.String name)
-
setParameters
static void setParameters(JmriAbstractAction act, java.util.HashMap<java.lang.String,java.lang.String> parameters)
-
rootFromName
protected static org.jdom2.Element rootFromName(java.lang.String name)
Get root element from XML file, handling errors locally.- Parameters:
name
- the name of the XML file- Returns:
- the root element or null
-
-