KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > wsitconf > ui > service > profiles > Generic


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.websvc.wsitconf.ui.service.profiles;
21
22 import org.netbeans.modules.websvc.wsitconf.ui.ComboConstants;
23 import org.netbeans.modules.xml.multiview.ui.SectionVisualTheme;
24 import org.netbeans.modules.xml.wsdl.model.WSDLComponent;
25 import org.netbeans.modules.xml.wsdl.model.WSDLModel;
26
27 /**
28  *
29  * @author Martin Grebac
30  */

31 public class Generic extends javax.swing.JPanel JavaDoc implements ComboConstants {
32
33     private boolean inSync = false;
34
35     private WSDLComponent comp;
36     private WSDLModel model;
37     
38     /**
39      * Creates new form Generic
40      */

41     public Generic(WSDLComponent comp) {
42         super();
43         initComponents();
44         this.model = comp.getModel();
45         this.comp = comp;
46
47         algoSuiteCombo.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
48         algoSuiteLabel.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
49         authTokenCombo.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
50         authTokenLabel.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
51         confidentCombo.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
52         confidentLabel.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
53         integrityCombo.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
54         integrityLabel.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
55
56         layoutLabel.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
57         layoutCombo.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
58         wssVersionLabel.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
59         wssVersionCombo.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
60
61         derivedKeysChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
62         encryptOrderChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
63         entireSignChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
64         protectTokenChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
65         secConvChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
66         timestampChBox.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
67
68         inSync = true;
69         layoutCombo.removeAllItems();
70         layoutCombo.addItem(ComboConstants.STRICT);
71         layoutCombo.addItem(ComboConstants.LAX);
72         layoutCombo.addItem(ComboConstants.LAXTSFIRST);
73         layoutCombo.addItem(ComboConstants.LAXTSLAST);
74         
75         confidentCombo.removeAllItems();
76         confidentCombo.addItem(ComboConstants.NONE);
77         confidentCombo.addItem(ComboConstants.RANDOMSYMMETRIC_KEYS);
78         confidentCombo.addItem(ComboConstants.ISSUEDSYMMETRIC_KEYS);
79         confidentCombo.addItem(ComboConstants.TRANSPORTPROTECTION);
80
81         integrityCombo.removeAllItems();
82         integrityCombo.addItem(ComboConstants.NONE);
83         integrityCombo.addItem(ComboConstants.ASSYMETRIC_KEYS);
84         integrityCombo.addItem(ComboConstants.RANDOMSYMMETRIC_KEYS);
85         integrityCombo.addItem(ComboConstants.ISSUEDSYMMETRIC_KEYS);
86
87         wssVersionCombo.removeAllItems();
88         wssVersionCombo.addItem(ComboConstants.WSS10);
89         wssVersionCombo.addItem(ComboConstants.WSS11);
90
91         algoSuiteCombo.removeAllItems();
92         algoSuiteCombo.addItem(ComboConstants.BASIC256);
93         algoSuiteCombo.addItem(ComboConstants.BASIC192);
94         algoSuiteCombo.addItem(ComboConstants.BASIC128);
95         algoSuiteCombo.addItem(ComboConstants.TRIPLEDES);
96         algoSuiteCombo.addItem(ComboConstants.BASIC256RSA15);
97         algoSuiteCombo.addItem(ComboConstants.BASIC192RSA15);
98         algoSuiteCombo.addItem(ComboConstants.BASIC128RSA15);
99         algoSuiteCombo.addItem(ComboConstants.TRIPLEDESRSA15);
100 // algoSuiteCombo.addItem(ComboConstants.BASIC256SHA256);
101
// algoSuiteCombo.addItem(ComboConstants.BASIC192SHA256);
102
// algoSuiteCombo.addItem(ComboConstants.BASIC128SHA256);
103
// algoSuiteCombo.addItem(ComboConstants.TRIPLEDESSHA256);
104
// algoSuiteCombo.addItem(ComboConstants.BASIC256SHA256RSA15);
105
// algoSuiteCombo.addItem(ComboConstants.BASIC192SHA256RSA15);
106
// algoSuiteCombo.addItem(ComboConstants.BASIC128SHA256RSA15);
107
// algoSuiteCombo.addItem(ComboConstants.TRIPLEDESSHA256RSA15);
108

109         authTokenCombo.removeAllItems();
110         authTokenCombo.addItem(ComboConstants.NONE);
111         authTokenCombo.addItem(ComboConstants.USERNAME);
112         authTokenCombo.addItem(ComboConstants.X509);
113         authTokenCombo.addItem(ComboConstants.SAML);
114         authTokenCombo.addItem(ComboConstants.ISSUED);
115         authTokenCombo.addItem(ComboConstants.HTTPS);
116         authTokenCombo.addItem(ComboConstants.KERBEROS);
117
118         inSync = false;
119         
120         sync();
121     }
122     
123     private void sync() {
124         inSync = true;
125
126
127         inSync = false;
128     }
129
130     public void setValue(javax.swing.JComponent JavaDoc source, Object JavaDoc value) {
131
132         if (!inSync) {
133 // if (source.equals(inclusionLevelCombo)) {
134
// SecurityTokensModelHelper.setTokenInclusionLevel(tokenType, (String)inclusionLevelCombo.getSelectedItem());
135
//// setter.setDirty();
136
// return;
137
// }
138
//
139
// if (source.equals(requireDerivedKeysChBox)) {
140
// boolean enable = requireDerivedKeysChBox.isSelected();
141
// if (SecurityPolicyModelHelper.isAttributeEnabled((ExtensibilityElement) tokenType, RequireDerivedKeys.class) != enable) {
142
// SecurityPolicyModelHelper.enableRequireDerivedKeys(tokenType, enable);
143
//// setter.setDirty();
144
// }
145
// return;
146
// }
147
}
148     }
149
150     
151     private void setRequireDerivedKeys(Boolean JavaDoc enable) {
152         if (enable == null) {
153             this.derivedKeysChBox.setSelected(false);
154         } else {
155             this.derivedKeysChBox.setSelected(enable);
156         }
157     }
158     
159     /** This method is called from within the constructor to
160      * initialize the form.
161      * WARNING: Do NOT modify this code. The content of this method is
162      * always regenerated by the Form Editor.
163      */

164     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
165
private void initComponents() {
166
167         authTokenLabel = new javax.swing.JLabel JavaDoc();
168         authTokenCombo = new javax.swing.JComboBox JavaDoc();
169         integrityLabel = new javax.swing.JLabel JavaDoc();
170         integrityCombo = new javax.swing.JComboBox JavaDoc();
171         secConvChBox = new javax.swing.JCheckBox JavaDoc();
172         timestampChBox = new javax.swing.JCheckBox JavaDoc();
173         protectTokenChBox = new javax.swing.JCheckBox JavaDoc();
174         entireSignChBox = new javax.swing.JCheckBox JavaDoc();
175         derivedKeysChBox = new javax.swing.JCheckBox JavaDoc();
176         confidentLabel = new javax.swing.JLabel JavaDoc();
177         confidentCombo = new javax.swing.JComboBox JavaDoc();
178         algoSuiteLabel = new javax.swing.JLabel JavaDoc();
179         algoSuiteCombo = new javax.swing.JComboBox JavaDoc();
180         layoutLabel = new javax.swing.JLabel JavaDoc();
181         layoutCombo = new javax.swing.JComboBox JavaDoc();
182         wssVersionLabel = new javax.swing.JLabel JavaDoc();
183         wssVersionCombo = new javax.swing.JComboBox JavaDoc();
184         encryptOrderChBox = new javax.swing.JCheckBox JavaDoc();
185
186         authTokenLabel.setText(org.openide.util.NbBundle.getMessage(Generic.class, "LBL_AuthToken")); // NOI18N
187

188         integrityLabel.setText(org.openide.util.NbBundle.getMessage(Generic.class, "LBL_IntegrityLabel")); // NOI18N
189

190         secConvChBox.setText(org.openide.util.NbBundle.getMessage(Generic.class, "LBL_SecConvLabel")); // NOI18N
191
secConvChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
192         secConvChBox.setMargin(new java.awt.Insets JavaDoc(0, 0, 0, 0));
193
194         timestampChBox.setText(org.openide.util.NbBundle.getMessage(Generic.class, "LBL_IncludeTimestamp")); // NOI18N
195
timestampChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
196         timestampChBox.setMargin(new java.awt.Insets JavaDoc(0, 0, 0, 0));
197
198         protectTokenChBox.setText(org.openide.util.NbBundle.getMessage(Generic.class, "LBL_ProtectTokenLabel")); // NOI18N
199
protectTokenChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
200         protectTokenChBox.setMargin(new java.awt.Insets JavaDoc(0, 0, 0, 0));
201
202         entireSignChBox.setText(org.openide.util.NbBundle.getMessage(Generic.class, "LBL_EntireSignLabel")); // NOI18N
203
entireSignChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
204         entireSignChBox.setMargin(new java.awt.Insets JavaDoc(0, 0, 0, 0));
205
206         derivedKeysChBox.setText(org.openide.util.NbBundle.getMessage(Generic.class, "LBL_RequireDerivedKeys")); // NOI18N
207
derivedKeysChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
208         derivedKeysChBox.setMargin(new java.awt.Insets JavaDoc(0, 0, 0, 0));
209
210         confidentLabel.setText(org.openide.util.NbBundle.getMessage(Generic.class, "LBL_ConfidentialityLabel")); // NOI18N
211

212         algoSuiteLabel.setText(org.openide.util.NbBundle.getMessage(Generic.class, "LBL_AlgoSuiteLabel")); // NOI18N
213

214         layoutLabel.setText(org.openide.util.NbBundle.getMessage(Generic.class, "LBL_LayoutLabel")); // NOI18N
215

216         wssVersionLabel.setText(org.openide.util.NbBundle.getMessage(Generic.class, "LBL_WSSVersionLabel")); // NOI18N
217

218         encryptOrderChBox.setText(org.openide.util.NbBundle.getMessage(Generic.class, "LBL_EncryptOrderLabel")); // NOI18N
219
encryptOrderChBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
220         encryptOrderChBox.setMargin(new java.awt.Insets JavaDoc(0, 0, 0, 0));
221
222         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
223         this.setLayout(layout);
224         layout.setHorizontalGroup(
225             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
226             .add(layout.createSequentialGroup()
227                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
228                     .add(layout.createSequentialGroup()
229                         .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
230                             .add(authTokenLabel)
231                             .add(integrityLabel)
232                             .add(confidentLabel)
233                             .add(algoSuiteLabel)
234                             .add(layoutLabel)
235                             .add(wssVersionLabel))
236                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
237                         .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
238                             .add(algoSuiteCombo, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
239                             .add(integrityCombo, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
240                             .add(confidentCombo, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
241                             .add(layoutCombo, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
242                             .add(wssVersionCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
243                             .add(authTokenCombo, 0, 144, Short.MAX_VALUE)))
244                     .add(secConvChBox)
245                     .add(derivedKeysChBox)
246                     .add(timestampChBox)
247                     .add(protectTokenChBox)
248                     .add(entireSignChBox)
249                     .add(encryptOrderChBox))
250                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
251         );
252
253         layout.linkSize(new java.awt.Component JavaDoc[] {algoSuiteCombo, authTokenCombo, confidentCombo, integrityCombo, layoutCombo, wssVersionCombo}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
254
255         layout.setVerticalGroup(
256             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
257             .add(layout.createSequentialGroup()
258                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
259                     .add(authTokenLabel)
260                     .add(authTokenCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
261                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
262                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
263                     .add(integrityLabel)
264                     .add(integrityCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
265                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
266                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
267                     .add(confidentLabel)
268                     .add(confidentCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
269                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
270                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
271                     .add(algoSuiteLabel)
272                     .add(algoSuiteCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
273                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
274                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
275                     .add(layoutLabel)
276                     .add(layoutCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
277                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
278                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
279                     .add(wssVersionLabel)
280                     .add(wssVersionCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
281                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
282                 .add(secConvChBox)
283                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
284                 .add(derivedKeysChBox)
285                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
286                 .add(timestampChBox)
287                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
288                 .add(protectTokenChBox)
289                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
290                 .add(entireSignChBox)
291                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
292                 .add(encryptOrderChBox)
293                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
294         );
295
296         layout.linkSize(new java.awt.Component JavaDoc[] {algoSuiteCombo, authTokenCombo, confidentCombo, integrityCombo, layoutCombo, wssVersionCombo}, org.jdesktop.layout.GroupLayout.VERTICAL);
297
298     }// </editor-fold>//GEN-END:initComponents
299

300     // Variables declaration - do not modify//GEN-BEGIN:variables
301
private javax.swing.JComboBox JavaDoc algoSuiteCombo;
302     private javax.swing.JLabel JavaDoc algoSuiteLabel;
303     private javax.swing.JComboBox JavaDoc authTokenCombo;
304     private javax.swing.JLabel JavaDoc authTokenLabel;
305     private javax.swing.JComboBox JavaDoc confidentCombo;
306     private javax.swing.JLabel JavaDoc confidentLabel;
307     private javax.swing.JCheckBox JavaDoc derivedKeysChBox;
308     private javax.swing.JCheckBox JavaDoc encryptOrderChBox;
309     private javax.swing.JCheckBox JavaDoc entireSignChBox;
310     private javax.swing.JComboBox JavaDoc integrityCombo;
311     private javax.swing.JLabel JavaDoc integrityLabel;
312     private javax.swing.JComboBox JavaDoc layoutCombo;
313     private javax.swing.JLabel JavaDoc layoutLabel;
314     private javax.swing.JCheckBox JavaDoc protectTokenChBox;
315     private javax.swing.JCheckBox JavaDoc secConvChBox;
316     private javax.swing.JCheckBox JavaDoc timestampChBox;
317     private javax.swing.JComboBox JavaDoc wssVersionCombo;
318     private javax.swing.JLabel JavaDoc wssVersionLabel;
319     // End of variables declaration//GEN-END:variables
320

321 }
322
Popular Tags