Package jmri.jmrit.beantable.beanedit
Class BeanEditAction<B extends NamedBean>
java.lang.Object
javax.swing.AbstractAction
jmri.jmrit.beantable.beanedit.BeanEditAction<B>
- Type Parameters:
B- the type of supported NamedBean
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action
- Direct Known Subclasses:
BlockEditAction,LightEditAction,OBlockEditAction,SensorDebounceEditAction,SensorEditAction,SensorPullUpEditAction,TurnoutEditAction
Provides the basic information and structure for for a editing the details of
a bean object.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JButtonApply Button.(package private) Bprotected ArrayList<BeanItemPanel>(package private) JTextArea(package private) JScrollPane(package private) JmriJFrame(package private) NamedBeanHandleManagerprotected Component(package private) JTextFieldFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidaddToPanel(JPanel panel, List<BeanEditItem> items) Set out the panel based upon the items passed in via the ArrayList.(package private) booleanallowBlockNameChange(String changeType, String newName) Determine whether it is safe to rename/remove a Block user name.protected void(package private) BeanItemPanelCreate a generic panel that holds the basic bean information System Name, User Name, and Comment.protected void(package private) voidprotected abstract BgetByUserName(String name) protected abstract Stringprotected voidCall to create all the different tabs that will be added to the frame.protected voidInitialise panels to be at start of Tabbed Panel menu.protected voidInitialise panels to be at end of Tabbed Panel menu.(package private) BeanItemPanelCreate a generic panel that holds Bean Property details.voidGeneric method to remove the user name from a bean.voidrenameBean(String _newName) Generic method to change the user name of a Bean.protected voidvoidsave()protected voidvoidvoid(package private) BeanItemPanelCreate a generic panel that holds Bean usage details.(package private) static booleanvalidateNumericalInput(String text) Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
bean
-
userNameField
-
commentField
-
commentFieldScroller
-
bei
-
f
-
selectedTab
-
applyBut
Apply Button. Accessible so Edit Actions can set custom tool tip. -
nbMan
-
-
Constructor Details
-
BeanEditAction
-
BeanEditAction
public BeanEditAction()
-
-
Method Details
-
setBean
-
initPanels
Call to create all the different tabs that will be added to the frame. -
initPanelsFirst
Initialise panels to be at start of Tabbed Panel menu. Default empty. -
initPanelsLast
Initialise panels to be at end of Tabbed Panel menu. Startup usage details and Properties. -
basicDetails
Create a generic panel that holds the basic bean information System Name, User Name, and Comment.- Returns:
- a new panel
-
usageDetails
Create a generic panel that holds Bean usage details.- Returns:
- a new panel
-
propertiesDetails
Create a generic panel that holds Bean Property details.- Returns:
- a new panel
-
saveBasicItems
-
resetBasicItems
-
helpTarget
-
setSelectedComponent
-
actionPerformed
-
applyButtonAction
-
cancelButtonAction
-
addToPanel
Set out the panel based upon the items passed in via the ArrayList.- Parameters:
panel- JPanel to add stuff toitems- aBeanEditItemlist of key-value pairs for the items to add
-
formatTextAreaAsLabel
-
save
-
validateNumericalInput
-
getByUserName
-
renameBean
Generic method to change the user name of a Bean.- Parameters:
_newName- string to use as the new user name
-
removeName
Generic method to remove the user name from a bean. -
allowBlockNameChange
Determine whether it is safe to rename/remove a Block user name.The user name is used by the LayoutBlock to link to the block and by Layout Editor track components to link to the layout block.
- Parameters:
changeType- This will be Remove or Rename.newName- For Remove this will be empty, for Rename it will be the new user name.- Returns:
- true to continue with the user name change.
-