Class ProgCheckAction

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

    public class ProgCheckAction
    extends javax.swing.AbstractAction
    Check the names in an XML programmer file against the names.xml definitions
    See Also:
    XmlFile, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) javax.swing.JPanel _who  
      (package private) javax.swing.JFileChooser fci  
      (package private) static java.util.regex.Pattern ffPattern  
      (package private) static java.lang.String ffRegex  
      (package private) static java.util.regex.Pattern frPattern  
      (package private) static java.lang.String frRegex  
      (package private) static java.util.regex.Pattern numericPattern  
      (package private) static java.lang.String numericRegex  
      • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      ProgCheckAction​(java.lang.String s, javax.swing.JPanel who)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)  
      (package private) static java.lang.String checkIncompleteComprehensive​(java.io.File file)  
      (package private) static java.lang.String checkMissingNames​(java.io.File file)  
      protected static void expandElement​(Element el, java.util.List<Element> list)
      Find all of the display elements descending from this element.
      (package private) static boolean functionMapName​(java.lang.String name)
      Check if the name is a function name, e.g.
      (package private) static Element readFile​(java.io.File file)
      Ask SAX to read and verify a file
      (package private) void warnIncompleteComprehensive​(java.io.File file)
      Check for names in names.xml that are not in file
      (package private) void warnMissingNames​(java.io.File file)
      Check for names in programer that are not in names.xml
      • 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
    • Constructor Detail

      • ProgCheckAction

        public ProgCheckAction​(java.lang.String s,
                               javax.swing.JPanel who)
    • Method Detail

      • actionPerformed

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

        protected static void expandElement​(Element el,
                                            java.util.List<Element> list)
        Find all of the display elements descending from this element.
        Parameters:
        el - the element to search
        list - the list that will be populated with the found elements
      • warnMissingNames

        void warnMissingNames​(java.io.File file)
        Check for names in programer that are not in names.xml
        Parameters:
        file - A decoder definition XML file to be checked
      • checkMissingNames

        static java.lang.String checkMissingNames​(java.io.File file)
      • warnIncompleteComprehensive

        void warnIncompleteComprehensive​(java.io.File file)
        Check for names in names.xml that are not in file
        Parameters:
        file - A decoder definition XML file to be checked
      • functionMapName

        static boolean functionMapName​(java.lang.String name)
        Check if the name is a function name, e.g. "F5 controls output 8" or "FL(f) controls output 14"
        Parameters:
        name - Possible function name to check
        Returns:
        true if the input is a valid name
      • readFile

        static Element readFile​(java.io.File file)
                         throws JDOMException,
                                java.io.IOException
        Ask SAX to read and verify a file
        Parameters:
        file - XML-formatted input file
        Returns:
        root element if successful
        Throws:
        JDOMException - if file can't be parsed
        java.io.IOException - if problems reading file