Source:
public void initContextData(Session session, Context uiSharedContext) { selectedAuthenticationMethod = uiSharedContext.getAuthenticationMethod(); if (log.isDebugEnabled()) log.debug( "Initializing configuration panel for authentication method: " + selectedAuthenticationMethod + " for context " + uiSharedContext.getName()); resetLoggedInOutIndicators(); if (selectedAuthenticationMethod != null) { if (selectedAuthenticationMethod.getAuthCheckingStrategy() != null) getAuthenticationVerifComboBox() .getModel() .setSelectedItem( new AuthCheckingStrategyType( selectedAuthenticationMethod.getAuthCheckingStrategy())); setPollFieldStatuses( (AuthCheckingStrategyType) getAuthenticationVerifComboBox().getSelectedItem()); getPollUrlField().setText(selectedAuthenticationMethod.getPollUrl()); getPollDataField().setText(selectedAuthenticationMethod.getPollData()); getPollHeadersField().setText(selectedAuthenticationMethod.getPollHeaders()); getPollFrequencySpinner().setValue(selectedAuthenticationMethod.getPollFrequency()); getAuthFrequencyUnitsComboBox() .setSelectedItem( new AuthPollFrequencyUnitsType( selectedAuthenticationMethod.getPollFrequencyUnits())); if (selectedAuthenticationMethod.getLoggedInIndicatorPattern() != null) getLoggedInIndicatorRegexField() .setText( selectedAuthenticationMethod .getLoggedInIndicatorPattern() .pattern()); else getLoggedInIndicatorRegexField().setText(""); if (selectedAuthenticationMethod.getLoggedOutIndicatorPattern() != null) getLoggedOutIndicatorRegexField() .setText( selectedAuthenticationMethod .getLoggedOutIndicatorPattern() .pattern()); else getLoggedOutIndicatorRegexField().setText(""); if (shownMethodType != null && shownMethodType.isTypeForMethod(selectedAuthenticationMethod)) { if (shownMethodType.hasOptionsPanel()) { log.debug( "Binding authentication method to existing panel of proper type for context " + uiSharedContext.getName()); shownConfigPanel.bindMethod( selectedAuthenticationMethod, getAuthenticationIndicatorsPanel()); } return; } for (AuthenticationMethodType type : extension.getAuthenticationMethodTypes()) if (type.isTypeForMethod(selectedAuthenticationMethod)) { log.debug( "Binding authentication method to new panel of proper type for context " + uiSharedContext.getName()); needsConfirm = false; getAuthenticationMethodsComboBox().setSelectedItem(type); needsConfirm = true; break; } } }

Target:
public void initContextData(Session session, Context uiSharedContext) { selectedAuthenticationMethod = uiSharedContext.getAuthenticationMethod(); if (log.isDebugEnabled()) log.debug( "Initializing configuration panel for authentication method: " + selectedAuthenticationMethod + " for context " + uiSharedContext.getName()); resetLoggedInOutIndicators(); if (selectedAuthenticationMethod != null) { if (selectedAuthenticationMethod.getAuthCheckingStrategy() != null) { getAuthenticationVerifComboBox() .getModel() .setSelectedItem( new AuthCheckingStrategyType( selectedAuthenticationMethod.getAuthCheckingStrategy())); } setPollFieldStatuses( (AuthCheckingStrategyType) getAuthenticationVerifComboBox().getSelectedItem()); getPollUrlField().setText(selectedAuthenticationMethod.getPollUrl()); getPollDataField().setText(selectedAuthenticationMethod.getPollData()); getPollHeadersField().setText(selectedAuthenticationMethod.getPollHeaders()); getPollFrequencySpinner().setValue(selectedAuthenticationMethod.getPollFrequency()); getAuthFrequencyUnitsComboBox() .setSelectedItem( new AuthPollFrequencyUnitsType( selectedAuthenticationMethod.getPollFrequencyUnits())); if (selectedAuthenticationMethod.getLoggedInIndicatorPattern() != null) getLoggedInIndicatorRegexField() .setText( selectedAuthenticationMethod .getLoggedInIndicatorPattern() .pattern()); else getLoggedInIndicatorRegexField().setText(""); if (selectedAuthenticationMethod.getLoggedOutIndicatorPattern() != null) getLoggedOutIndicatorRegexField() .setText( selectedAuthenticationMethod .getLoggedOutIndicatorPattern() .pattern()); else getLoggedOutIndicatorRegexField().setText(""); if (shownMethodType != null && shownMethodType.isTypeForMethod(selectedAuthenticationMethod)) { if (shownMethodType.hasOptionsPanel()) { log.debug( "Binding authentication method to existing panel of proper type for context " + uiSharedContext.getName()); shownConfigPanel.bindMethod( selectedAuthenticationMethod, getAuthenticationIndicatorsPanel()); } return; } for (AuthenticationMethodType type : extension.getAuthenticationMethodTypes()) if (type.isTypeForMethod(selectedAuthenticationMethod)) { log.debug( "Binding authentication method to new panel of proper type for context " + uiSharedContext.getName()); needsConfirm = false; getAuthenticationMethodsComboBox().setSelectedItem(type); needsConfirm = true; break; } } }