■ ■ ■ ■ ■ ■
src/main/java/com/nccgroup/loggerplusplus/exports/ElasticExporterConfigDialog.java
| skipped 42 lines |
43 | 43 | | JTextField password = PanelBuilder.createPreferenceTextField(preferences, PREF_ELASTIC_PASSWORD); |
44 | 44 | | |
45 | 45 | | JComboBox<ElasticAuthType> elasticAuthType = new JComboBox<>(ElasticAuthType.values()); |
| 46 | + | elasticAuthType.setSelectedItem(preferences.getSetting(PREF_ELASTIC_AUTH)); |
46 | 47 | | |
47 | 48 | | Runnable setAuthFields = () -> { |
48 | | - | if (ElasticAuthType.ApiKey.equals(elasticAuthType.getSelectedItem())) { |
| 49 | + | ElasticAuthType authType = preferences.getSetting(PREF_ELASTIC_AUTH); |
| 50 | + | |
| 51 | + | if (ElasticAuthType.ApiKey.equals(authType)) { |
49 | 52 | | authUserLabel.setText("Key ID: "); |
50 | 53 | | authPassLabel.setText("Key Secret: "); |
51 | 54 | | userPanel.add(apiKeyId, BorderLayout.CENTER); |
52 | 55 | | passPanel.add(apiKeySecret, BorderLayout.CENTER); |
53 | | - | } else if (ElasticAuthType.Basic.equals(elasticAuthType.getSelectedItem())) { |
| 56 | + | } else if (ElasticAuthType.Basic.equals(authType)) { |
54 | 57 | | authUserLabel.setText("Username: "); |
55 | 58 | | authPassLabel.setText("Password: "); |
56 | 59 | | userPanel.add(username, BorderLayout.CENTER); |
| skipped 92 lines |