protected JComboBox < AuthenticationMethodType > getAuthenticationMethodsComboBox ( ) { if ( authenticationMethodsComboBox == null ) { Vector < AuthenticationMethodType > methods = new Vector <> ( extension . getAuthenticationMethodTypes ( ) ) ; authenticationMethodsComboBox = new JComboBox <> ( methods ) ; authenticationMethodsComboBox . setSelectedItem ( null ) ; // Prepare the listener for the change of selection authenticationMethodsComboBox . addItemListener ( new ItemListener ( ) { @ Override public void itemStateChanged ( ItemEvent e ) { if ( e . getStateChange ( ) == ItemEvent . SELECTED && ! e . getItem ( ) . equals ( shownMethodType ) ) { log . debug ( "Selected new Authentication type: " + e . getItem ( ) ) ; AuthenticationMethodType type = ( ( AuthenticationMethodType ) e . getItem ( ) ) ; if ( shownMethodType == null || type . getAuthenticationCredentialsType ( ) != shownMethodType . getAuthenticationCredentialsType ( ) ) { if ( needsConfirm && ! confirmAndResetUsersCredentials ( type ) ) { log . debug ( "Cancelled change of authentication type." ) ; authenticationMethodsComboBox . setSelectedItem ( shownMethodType ) ; return ; } } resetLoggedInOutIndicators ( ) ; // If no authentication method was previously selected or it's a different // class, create a new authentication method object if ( selectedAuthenticationMethod == null || ! type . isTypeForMethod ( selectedAuthenticationMethod ) ) { selectedAuthenticationMethod = type . createAuthenticationMethod ( getContextIndex ( ) ) ; } // Show the configuration panel changeMethodConfigPanel ( type ) ; if ( type . hasOptionsPanel ( ) ) { shownConfigPanel . bindMethod ( selectedAuthenticationMethod , getAuthenticationIndicatorsPanel ( ) ) ; } } } } ) ; } return authenticationMethodsComboBox ; }
Gets the authentication method types combo box .