1 19 20 package org.netbeans.modules.websvc.wsitconf.ui.service.subpanels; 21 22 import org.netbeans.modules.websvc.wsitconf.ui.ComboConstants; 23 import org.netbeans.modules.xml.multiview.ui.SectionVisualTheme; 24 25 29 public class ServiceProviderSelectorPanel extends javax.swing.JPanel { 30 31 private boolean inSync = false; 32 33 36 public ServiceProviderSelectorPanel(String spUrl, String certAlias, String tokenType, String keyType) { 37 super(); 38 39 initComponents(); 40 41 this.setSpUrl(spUrl); 42 this.setCertAlias(certAlias); 43 this.setTokenType(tokenType); 44 this.setKeyType(keyType); 45 46 certAliasTextField.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 47 certAliasLabel.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 48 spUrlLabel.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 49 spUrlTextField.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 50 tokenTypeCombo.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 51 tokenTypeLabel.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 52 tokenTypeCombo.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 53 tokenTypeLabel.setBackground(SectionVisualTheme.getDocumentBackgroundColor()); 54 55 inSync = true; 56 tokenTypeCombo.removeAllItems(); 57 tokenTypeCombo.addItem(ComboConstants.ISSUED_TOKENTYPE_SAML10); 58 tokenTypeCombo.addItem(ComboConstants.ISSUED_TOKENTYPE_SAML11); 59 tokenTypeCombo.addItem(ComboConstants.ISSUED_TOKENTYPE_SAML20); 60 tokenTypeCombo.setSelectedIndex(1); 62 keyTypeCombo.removeAllItems(); 63 keyTypeCombo.addItem(ComboConstants.ISSUED_KEYTYPE_PUBLIC); 64 keyTypeCombo.addItem(ComboConstants.ISSUED_KEYTYPE_SYMMETRIC); 65 inSync = false; 66 } 67 68 public String getSpUrl() { 69 return spUrlTextField.getText(); 70 } 71 72 public void setSpUrl(String spUrl) { 73 this.spUrlTextField.setText(spUrl); 74 } 75 76 public String getCertAlias() { 77 return certAliasTextField.getText(); 78 } 79 80 public void setCertAlias(String certAlias) { 81 this.certAliasTextField.setText(certAlias); 82 } 83 84 public String getTokenType() { 85 return (String )tokenTypeCombo.getSelectedItem(); 86 } 87 88 public void setTokenType(String tokenType) { 89 if (tokenType != null) { 90 this.tokenTypeCombo.setSelectedItem(tokenType); 91 } 92 } 93 94 public String getKeyType() { 95 return (String )tokenTypeCombo.getSelectedItem(); 96 } 97 98 public void setKeyType(String keyType) { 99 if (keyType != null) { 100 this.keyTypeCombo.setSelectedItem(keyType); 101 } 102 } 103 104 109 private void initComponents() { 111 112 spUrlLabel = new javax.swing.JLabel (); 113 certAliasLabel = new javax.swing.JLabel (); 114 tokenTypeLabel = new javax.swing.JLabel (); 115 spUrlTextField = new javax.swing.JTextField (); 116 certAliasTextField = new javax.swing.JTextField (); 117 tokenTypeCombo = new javax.swing.JComboBox (); 118 keyTypeLabel = new javax.swing.JLabel (); 119 keyTypeCombo = new javax.swing.JComboBox (); 120 121 spUrlLabel.setText(org.openide.util.NbBundle.getMessage(ServiceProviderSelectorPanel.class, "LBL_STSConfig_ProviderURL")); 123 certAliasLabel.setText(org.openide.util.NbBundle.getMessage(ServiceProviderSelectorPanel.class, "LBL_STSConfig_Alias")); 125 tokenTypeLabel.setText(org.openide.util.NbBundle.getMessage(ServiceProviderSelectorPanel.class, "LBL_STSConfig_TokenType")); 127 keyTypeLabel.setText(org.openide.util.NbBundle.getMessage(ServiceProviderSelectorPanel.class, "LBL_STSConfig_KeyType")); 129 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); 130 this.setLayout(layout); 131 layout.setHorizontalGroup( 132 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 133 .add(layout.createSequentialGroup() 134 .addContainerGap() 135 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 136 .add(spUrlLabel) 137 .add(certAliasLabel) 138 .add(tokenTypeLabel) 139 .add(keyTypeLabel)) 140 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 141 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 142 .add(spUrlTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 288, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 143 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) 144 .add(org.jdesktop.layout.GroupLayout.LEADING, certAliasTextField) 145 .add(org.jdesktop.layout.GroupLayout.LEADING, tokenTypeCombo, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 146 .add(org.jdesktop.layout.GroupLayout.LEADING, keyTypeCombo, 0, 114, Short.MAX_VALUE))) 147 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 148 ); 149 150 layout.linkSize(new java.awt.Component [] {certAliasTextField, keyTypeCombo, tokenTypeCombo}, org.jdesktop.layout.GroupLayout.HORIZONTAL); 151 152 layout.setVerticalGroup( 153 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 154 .add(layout.createSequentialGroup() 155 .addContainerGap() 156 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 157 .add(spUrlLabel) 158 .add(spUrlTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 159 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 160 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 161 .add(certAliasLabel) 162 .add(certAliasTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 163 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 164 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 165 .add(tokenTypeLabel) 166 .add(tokenTypeCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 167 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 168 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 169 .add(keyTypeLabel) 170 .add(keyTypeCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 171 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 172 ); 173 } 175 private javax.swing.JLabel certAliasLabel; 177 private javax.swing.JTextField certAliasTextField; 178 private javax.swing.JComboBox keyTypeCombo; 179 private javax.swing.JLabel keyTypeLabel; 180 private javax.swing.JLabel spUrlLabel; 181 private javax.swing.JTextField spUrlTextField; 182 private javax.swing.JComboBox tokenTypeCombo; 183 private javax.swing.JLabel tokenTypeLabel; 184 186 } 187 | Popular Tags |