public void actionPerformed()

in commons-transfer/commons-transfer-interactive/src/main/java/org/apache/archiva/commons/transfer/interactive/swing/ActionMapper.java [123:162]


    public void actionPerformed( ActionEvent evt )
    {
        String actionCommand = evt.getActionCommand();

        if ( evt.getSource() instanceof JButton )
        {
            JButton btn = (JButton) evt.getSource();
            actionCommand = btn.getActionCommand();
        }

        if ( actionCommand == null )
        {
            log.debug( "Encountered null action command. " + evt );
            return;
        }

        Method method = commandMap.get( actionCommand.toLowerCase() );
        if ( method == null )
        {
            log.debug( "Action command " + actionCommand + " does not have a corresponding command method." );
            return;
        }

        try
        {
            method.invoke( commandObject, new Object[] { evt } );
        }
        catch ( IllegalArgumentException e )
        {
            log.error( "Unable to call method " + method + ".", e );
        }
        catch ( IllegalAccessException e )
        {
            log.error( "Unable to call method " + method + ".", e );
        }
        catch ( InvocationTargetException e )
        {
            log.error( "Unable to call method " + method + ".", e );
        }
    }