Class AbstractActionModel

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addException​(java.lang.Exception exception)
      Add an exception to the list of exceptions thrown when loading the model or performing the action.
      java.lang.String getClassName()  
      java.util.List<java.lang.Exception> getExceptions()
      Get the exceptions thrown by the startup model.
      java.lang.String getName()
      Return the name of of the model or its controlled object.
      java.lang.String getSystemPrefix()  
      boolean isEnabled()
      Get whenether this action is enabled or not.
      boolean isSystemConnectionAction()  
      boolean isValid()
      Test is model is a valid model.
      void performAction()
      Perform the startup action.
      protected abstract void performAction​(javax.swing.Action action)  
      void setClassName​(java.lang.String n)  
      void setEnabled​(boolean value)
      Set whenether this action is enabled or not.
      void setName​(java.lang.String n)
      Set the name of the model.
      void setSystemPrefix​(java.lang.String prefix)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: StartupModel
        Return the name of of the model or its controlled object.
        Specified by:
        getName in interface StartupModel
        Returns:
        the name, an empty string, or null
      • setName

        public void setName​(java.lang.String n)
        Description copied from interface: StartupModel
        Set the name of the model.
        Specified by:
        setName in interface StartupModel
        Parameters:
        n - the name, an empty string, or null
      • isValid

        public boolean isValid()
        Description copied from interface: StartupModel
        Test is model is a valid model. Invalid models will not be shown or saved by the Startup Actions Preferences panel.
        Specified by:
        isValid in interface StartupModel
        Returns:
        true if valid; false otherwise
      • setEnabled

        public void setEnabled​(boolean value)
        Set whenether this action is enabled or not.
        Specified by:
        setEnabled in interface StartupModel
        Parameters:
        value - true if enabled, false otherwise
      • isEnabled

        public boolean isEnabled()
        Get whenether this action is enabled or not.
        Specified by:
        isEnabled in interface StartupModel
        Returns:
        true if enabled, false otherwise
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • performAction

        public void performAction()
                           throws JmriException
        Description copied from interface: StartupModel
        Perform the startup action. The caller is responsible to ensure that this startup model is enabled before calling this method.
        Specified by:
        performAction in interface StartupModel
        Throws:
        JmriException - if there is an exception thrown initializing the startup item; the original exception should be available as Throwable.getCause()
      • getExceptions

        public java.util.List<java.lang.Exception> getExceptions()
        Description copied from interface: StartupModel
        Get the exceptions thrown by the startup model.
        Specified by:
        getExceptions in interface StartupModel
        Returns:
        the list of exceptions thrown during startup in order or an empty list if no exceptions were thrown
      • addException

        public void addException​(java.lang.Exception exception)
        Description copied from interface: StartupModel
        Add an exception to the list of exceptions thrown when loading the model or performing the action.
        Specified by:
        addException in interface StartupModel
        Parameters:
        exception - the exception to retain with the model