Class BeanEditAction<B extends NamedBean>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.swing.JButton applyBut
      Apply Button.
      (package private) B bean  
      protected java.util.ArrayList<BeanItemPanel> bei  
      (package private) javax.swing.JTextArea commentField  
      (package private) javax.swing.JScrollPane commentFieldScroller  
      (package private) JmriJFrame f  
      (package private) NamedBeanHandleManager nbMan  
      protected java.awt.Component selectedTab  
      (package private) javax.swing.JTextField userNameField  
      • Fields inherited from class javax.swing.AbstractAction

        changeSupport, enabled
      • Fields 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
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)  
      protected void addToPanel​(javax.swing.JPanel panel, java.util.List<BeanEditItem> items)
      Set out the panel based upon the items passed in via the ArrayList.
      (package private) boolean allowBlockNameChange​(java.lang.String changeType, java.lang.String newName)
      Determine whether it is safe to rename/remove a Block user name.
      protected void applyButtonAction​(java.awt.event.ActionEvent e)  
      (package private) BeanItemPanel basicDetails()
      Create a generic panel that holds the basic bean information System Name, User Name, and Comment.
      protected void cancelButtonAction​(java.awt.event.ActionEvent e)  
      (package private) void formatTextAreaAsLabel​(javax.swing.JTextPane pane)  
      protected abstract B getByUserName​(java.lang.String name)  
      protected abstract java.lang.String helpTarget()  
      protected void initPanels()
      Call to create all the different tabs that will be added to the frame.
      protected void initPanelsFirst()
      Initialise panels to be at start of Tabbed Panel menu.
      protected void initPanelsLast()
      Initialise panels to be at end of Tabbed Panel menu.
      (package private) BeanItemPanel propertiesDetails()
      Create a generic panel that holds Bean Property details.
      void removeName()
      Generic method to remove the user name from a bean.
      void renameBean​(java.lang.String _newName)
      Generic method to change the user name of a Bean.
      protected void resetBasicItems​(java.awt.event.ActionEvent e)  
      void save()  
      protected void saveBasicItems​(java.awt.event.ActionEvent e)  
      void setBean​(B bean)  
      void setSelectedComponent​(java.awt.Component c)  
      (package private) BeanItemPanel usageDetails()
      Create a generic panel that holds Bean usage details.
      (package private) static boolean validateNumericalInput​(java.lang.String text)  
      • Methods inherited from class javax.swing.AbstractAction

        addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.swing.Action

        accept
    • Method Detail

      • setBean

        public void setBean​(B bean)
      • initPanels

        protected void initPanels()
        Call to create all the different tabs that will be added to the frame.
      • initPanelsFirst

        protected void initPanelsFirst()
        Initialise panels to be at start of Tabbed Panel menu. Default empty.
      • initPanelsLast

        protected void initPanelsLast()
        Initialise panels to be at end of Tabbed Panel menu. Startup usage details and Properties.
      • basicDetails

        BeanItemPanel basicDetails()
        Create a generic panel that holds the basic bean information System Name, User Name, and Comment.
        Returns:
        a new panel
      • helpTarget

        protected abstract java.lang.String helpTarget()
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
      • applyButtonAction

        protected void applyButtonAction​(java.awt.event.ActionEvent e)
      • cancelButtonAction

        protected void cancelButtonAction​(java.awt.event.ActionEvent e)
      • addToPanel

        protected void addToPanel​(javax.swing.JPanel panel,
                                  java.util.List<BeanEditItem> items)
        Set out the panel based upon the items passed in via the ArrayList.
        Parameters:
        panel - JPanel to add stuff to
        items - a BeanEditItem list of key-value pairs for the items to add
      • save

        public void save()
      • getByUserName

        protected abstract B getByUserName​(java.lang.String name)
      • renameBean

        public void renameBean​(java.lang.String _newName)
        Generic method to change the user name of a Bean.
        Parameters:
        _newName - string to use as the new user name
      • removeName

        public void removeName()
        Generic method to remove the user name from a bean.
      • allowBlockNameChange

        boolean allowBlockNameChange​(java.lang.String changeType,
                                     java.lang.String newName)
        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.