Source Code Cross Referenced for SNMPPanel.java in  » IDE-Netbeans » jmx » org » netbeans » modules » jmx » configwizard » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » jmx » org.netbeans.modules.jmx.configwizard 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:         *
004:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * The contents of this file are subject to the terms of either the GNU
007:         * General Public License Version 2 only ("GPL") or the Common
008:         * Development and Distribution License("CDDL") (collectively, the
009:         * "License"). You may not use this file except in compliance with the
010:         * License. You can obtain a copy of the License at
011:         * http://www.netbeans.org/cddl-gplv2.html
012:         * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013:         * specific language governing permissions and limitations under the
014:         * License.  When distributing the software, include this License Header
015:         * Notice in each file and include the License file at
016:         * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
017:         * particular file as subject to the "Classpath" exception as provided
018:         * by Sun in the GPL Version 2 section of the License file that
019:         * accompanied this code. If applicable, add the following below the
020:         * License Header, with the fields enclosed by brackets [] replaced by
021:         * your own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         *
024:         * Contributor(s):
025:         *
026:         * The Original Software is NetBeans. The Initial Developer of the Original
027:         * Software is Sun Microsystems, Inc. Portions Copyright 2004-2005 Sun
028:         * Microsystems, Inc. All Rights Reserved.
029:         *
030:         * If you wish your version of this file to be governed by only the CDDL
031:         * or only the GPL Version 2, indicate your decision by adding
032:         * "[Contributor] elects to include this software in this distribution
033:         * under the [CDDL or GPL Version 2] license." If you do not indicate a
034:         * single choice of license, a recipient has the option to distribute
035:         * your version of this file under either the CDDL, the GPL Version 2 or
036:         * to extend the choice of license to its licensees as provided above.
037:         * However, if you add GPL Version 2 code and therefore, elected the GPL
038:         * Version 2 license, then the option applies only if the new code is
039:         * made subject to such option by the copyright holder.
040:         */
041:        package org.netbeans.modules.jmx.configwizard;
042:
043:        import java.awt.Component;
044:        import java.util.Iterator;
045:        import java.util.Vector;
046:        import java.util.ResourceBundle;
047:        import java.io.File;
048:
049:        import javax.swing.event.DocumentEvent;
050:        import javax.swing.event.DocumentListener;
051:        import javax.swing.JComponent;
052:        import javax.swing.JFileChooser;
053:
054:        import org.openide.WizardDescriptor;
055:        import org.openide.util.NbBundle;
056:        import org.openide.awt.Mnemonics;
057:
058:        import org.netbeans.modules.jmx.WizardConstants;
059:        import org.netbeans.modules.jmx.GenericWizardPanel;
060:        import java.awt.event.KeyEvent;
061:        import java.awt.event.KeyListener;
062:        import org.openide.util.HelpCtx;
063:
064:        /**
065:         *
066:         * Class handling the graphical part of the standard Options wizard panel
067:         *
068:         */
069:        public class SNMPPanel extends javax.swing.JPanel {
070:
071:            private SNMPWizardPanel wiz;
072:            private ResourceBundle bundle;
073:
074:            private boolean aclSelected = false;
075:            private boolean sNMPSelected = false;
076:            private JFileChooser chooser;
077:
078:            /**
079:             * Create the wizard panel component and set up some basic properties.
080:             * @param wiz <CODE>WizardDescriptor</CODE> a wizard
081:             */
082:            public SNMPPanel(SNMPWizardPanel wiz) {
083:                this .wiz = wiz;
084:                bundle = NbBundle.getBundle(ConfigPanel.class);
085:                initComponents();
086:
087:                chooser = new JFileChooser();
088:
089:                Mnemonics.setLocalizedText(sNMPJCheckBox, bundle
090:                        .getString("LBL_SNMP"));//NOI18N
091:                Mnemonics.setLocalizedText(aclJCheckBox, bundle
092:                        .getString("LBL_SNMP_AccessList"));//NOI18N
093:                Mnemonics.setLocalizedText(sNMPPortJLabel, bundle
094:                        .getString("LBL_SNMP_Port"));//NOI18N
095:
096:                Mnemonics.setLocalizedText(customACL, bundle
097:                        .getString("LBL_SNMP_CustomACL"));//NOI18N
098:
099:                Mnemonics.setLocalizedText(aclFileJButton, bundle
100:                        .getString("LBL_SNMP_acl_File_Edit"));//NOI18N
101:
102:                Mnemonics.setLocalizedText(interfaceJLabel, bundle
103:                        .getString("LBL_SNMP_Interface"));//NOI18N
104:                Mnemonics.setLocalizedText(sNMPTrapPortJLabel, bundle
105:                        .getString("LBL_SNMP_Trap_Port"));//NOI18N
106:
107:                sNMPJCheckBox.setToolTipText(bundle.getString("TLTP_SNMP"));//NOI18N
108:                aclJCheckBox.setToolTipText(bundle.getString("TLTP_ACL"));//NOI18N
109:                customACL.setToolTipText(bundle.getString("TLTP_CUSTOM_ACL"));//NOI18N
110:                aclFileJButton.setToolTipText(bundle
111:                        .getString("TLTP_CUSTOM_ACL"));//NOI18N
112:                sNMPPortJLabel.setToolTipText(bundle
113:                        .getString("TLTP_SNMP_PORT"));//NOI18N
114:                interfaceJLabel.setToolTipText(bundle
115:                        .getString("TLTP_SNMP_Interface"));//NOI18N
116:                sNMPTrapPortJLabel.setToolTipText(bundle
117:                        .getString("TLTP_SNMP_TrapPort"));//NOI18N
118:
119:                updateSelected();
120:                setSNMPPanelEnabled(false);
121:                updateSelected();
122:
123:                // Provide a name in the title bar.
124:                //setName(NbBundle.getMessage(ConfigPanel.class, "LBL_SNMP_Panel"));   // NOI18N   
125:                setName(bundle.getString("LBL_SNMP_Panel"));// NOI18N
126:                //agentNameField.getDocument().addDocumentListener(this);   
127:                sNMPPortJTextField.addKeyListener(new KeyListener() {
128:                    public void keyTyped(KeyEvent e) {
129:                        char c = e.getKeyChar();
130:                        if (!(Character.isDigit(c)
131:                                || c == KeyEvent.VK_BACK_SPACE || c == KeyEvent.VK_DELETE)) {
132:                            sNMPTrapPortJLabel.getToolkit().beep();
133:                            e.consume();
134:                        }
135:                    }
136:
137:                    public void keyPressed(KeyEvent e) {
138:                    }
139:
140:                    public void keyReleased(KeyEvent e) {
141:
142:                    }
143:                });
144:
145:                trapPortJTextField.addKeyListener(new KeyListener() {
146:                    public void keyTyped(KeyEvent e) {
147:                        char c = e.getKeyChar();
148:                        if (!(Character.isDigit(c)
149:                                || c == KeyEvent.VK_BACK_SPACE || c == KeyEvent.VK_DELETE)) {
150:                            sNMPTrapPortJLabel.getToolkit().beep();
151:                            e.consume();
152:                        }
153:                    }
154:
155:                    public void keyPressed(KeyEvent e) {
156:                    }
157:
158:                    public void keyReleased(KeyEvent e) {
159:
160:                    }
161:                });
162:                //Accessibility       
163:                sNMPJCheckBox.getAccessibleContext().setAccessibleName(
164:                        bundle.getString("ACCESS_SNMP")); // NOI18N
165:                sNMPJCheckBox.getAccessibleContext().setAccessibleDescription(
166:                        bundle.getString("ACCESS_SNMP_DESCRIPTION")); // NOI18N
167:
168:                sNMPPortJTextField.getAccessibleContext().setAccessibleName(
169:                        bundle.getString("ACCESS_SNMP_PORT")); // NOI18N
170:                sNMPPortJTextField
171:                        .getAccessibleContext()
172:                        .setAccessibleDescription(
173:                                bundle
174:                                        .getString("ACCESS_SNMP_PORT_DESCRIPTION")); // NOI18N
175:
176:                sNMPPortJLabel.setLabelFor(sNMPPortJTextField);
177:
178:                interfaceJTextField.getAccessibleContext().setAccessibleName(
179:                        bundle.getString("ACCESS_SNMP_INTERFACE")); // NOI18N
180:                interfaceJTextField
181:                        .getAccessibleContext()
182:                        .setAccessibleDescription(
183:                                bundle
184:                                        .getString("ACCESS_SNMP_INTERFACE_DESCRIPTION")); // NOI18N
185:
186:                interfaceJLabel.setLabelFor(interfaceJTextField);
187:
188:                trapPortJTextField.getAccessibleContext().setAccessibleName(
189:                        bundle.getString("ACCESS_SNMP_TRAP")); // NOI18N
190:                trapPortJTextField
191:                        .getAccessibleContext()
192:                        .setAccessibleDescription(
193:                                bundle
194:                                        .getString("ACCESS_SNMP_TRAP_DESCRIPTION")); // NOI18N
195:
196:                sNMPTrapPortJLabel.setLabelFor(trapPortJTextField);
197:
198:                aclJCheckBox.getAccessibleContext().setAccessibleName(
199:                        bundle.getString("ACCESS_SNMP_ACL")); // NOI18N
200:                aclJCheckBox.getAccessibleContext().setAccessibleDescription(
201:                        bundle.getString("ACCESS_SNMP_ACL_DESCRIPTION")); // NOI18N
202:
203:                aclFileJTextField.getAccessibleContext().setAccessibleName(
204:                        bundle.getString("ACCESS_SNMP_ACL_FILE")); // NOI18N
205:                aclFileJTextField
206:                        .getAccessibleContext()
207:                        .setAccessibleDescription(
208:                                bundle
209:                                        .getString("ACCESS_SNMP_ACL_FILE_DESCRIPTION")); // NOI18N
210:
211:                customACL.setLabelFor(aclFileJTextField);
212:
213:                aclFileJButton.getAccessibleContext().setAccessibleName(
214:                        bundle.getString("ACCESS_SNMP_ACL_FILE_BROWSE")); // NOI18N
215:                aclFileJButton
216:                        .getAccessibleContext()
217:                        .setAccessibleDescription(
218:                                bundle
219:                                        .getString("ACCESS_SNMP_ACL_FILE_BROWSE_DESCRIPTION")); // NOI18N
220:
221:                getAccessibleContext().setAccessibleDescription(
222:                        bundle.getString("ACCESS_PANEL"));// NOI18N
223:            }
224:
225:            /**
226:             * update all the selected flags 
227:             */
228:            private void updateSelected() {
229:                aclSelected = aclJCheckBox.isSelected();
230:                sNMPSelected = sNMPJCheckBox.isSelected();
231:            }
232:
233:            /**
234:             * calls setEnabled(enable) method of all components included in SNMPPanel
235:             */
236:            private void setSNMPPanelEnabled(boolean enable) {
237:                Vector<JComponent> jcVector = new Vector<JComponent>();
238:                jcVector.add(sNMPPortJLabel);
239:                jcVector.add(sNMPPortJTextField);
240:                jcVector.add(aclJCheckBox);
241:                jcVector.add(sNMPTrapPortJLabel);
242:                jcVector.add(trapPortJTextField);
243:                jcVector.add(interfaceJLabel);
244:                jcVector.add(interfaceJTextField);
245:                jcVector.add(customACL);
246:                for (Iterator<JComponent> it = jcVector.iterator(); it
247:                        .hasNext();) {
248:                    JComponent jc = it.next();
249:                    jc.setEnabled(enable);
250:                }
251:                if (enable && aclSelected) {
252:                    setAclFileEnabled(true);
253:                } else {
254:                    setAclFileEnabled(false);
255:                }
256:            }
257:
258:            /*
259:             * calls setEnabled(enable) method of all components for acl File option
260:             */
261:            private void setAclFileEnabled(boolean enable) {
262:                Vector<JComponent> jcVector = new Vector<JComponent>();
263:                jcVector.add(aclFileJTextField);
264:                jcVector.add(aclFileJButton);
265:                jcVector.add(customACL);
266:                for (Iterator<JComponent> it = jcVector.iterator(); it
267:                        .hasNext();) {
268:                    JComponent jc = it.next();
269:                    jc.setEnabled(enable);
270:                }
271:            }
272:
273:            private void checkPortValue(javax.swing.JTextField jt) {
274:                if (Integer.getInteger(jt.getText()) > 65536) {
275:                    jt.setText(new Integer(65536).toString());
276:                } else if (Integer.getInteger(jt.getText()) < 0) {
277:                    jt.setText(new Integer(0).toString());
278:                }
279:            }
280:
281:            /** This method is called from within the constructor to
282:             * initialize the form.
283:             * WARNING: Do NOT modify this code. The content of this method is
284:             * always regenerated by the Form Editor.
285:             */
286:            // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
287:            private void initComponents() {
288:                java.awt.GridBagConstraints gridBagConstraints;
289:
290:                managementFilesGroup = new javax.swing.ButtonGroup();
291:                jPanel1 = new javax.swing.JPanel();
292:                sNMPJCheckBox = new javax.swing.JCheckBox();
293:                sNMPPortJLabel = new javax.swing.JLabel();
294:                sNMPPortJTextField = new javax.swing.JTextField();
295:                interfaceJLabel = new javax.swing.JLabel();
296:                interfaceJTextField = new javax.swing.JTextField();
297:                sNMPTrapPortJLabel = new javax.swing.JLabel();
298:                trapPortJTextField = new javax.swing.JTextField();
299:                aclJCheckBox = new javax.swing.JCheckBox();
300:                jPanel10 = new javax.swing.JPanel();
301:                customACL = new javax.swing.JLabel();
302:                aclFileJTextField = new javax.swing.JTextField();
303:                aclFileJButton = new javax.swing.JButton();
304:
305:                setLayout(new java.awt.BorderLayout());
306:
307:                jPanel1.setLayout(new java.awt.GridBagLayout());
308:
309:                sNMPJCheckBox.setName("sNMPJCheckBox");
310:                sNMPJCheckBox
311:                        .addActionListener(new java.awt.event.ActionListener() {
312:                            public void actionPerformed(
313:                                    java.awt.event.ActionEvent evt) {
314:                                sNMPJCheckBoxActionPerformed(evt);
315:                            }
316:                        });
317:
318:                gridBagConstraints = new java.awt.GridBagConstraints();
319:                gridBagConstraints.gridx = 0;
320:                gridBagConstraints.gridy = 0;
321:                gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
322:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
323:                jPanel1.add(sNMPJCheckBox, gridBagConstraints);
324:
325:                sNMPPortJLabel.setText("port");
326:                sNMPPortJLabel.setName("sNMPPortJLabel");
327:                gridBagConstraints = new java.awt.GridBagConstraints();
328:                gridBagConstraints.gridx = 0;
329:                gridBagConstraints.gridy = 1;
330:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
331:                gridBagConstraints.insets = new java.awt.Insets(5, 12, 5, 12);
332:                jPanel1.add(sNMPPortJLabel, gridBagConstraints);
333:
334:                sNMPPortJTextField
335:                        .setMinimumSize(new java.awt.Dimension(55, 20));
336:                sNMPPortJTextField.setName("sNMPPortJTextField");
337:                sNMPPortJTextField.setPreferredSize(new java.awt.Dimension(55,
338:                        20));
339:                gridBagConstraints = new java.awt.GridBagConstraints();
340:                gridBagConstraints.gridx = 1;
341:                gridBagConstraints.gridy = 1;
342:                gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
343:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
344:                gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 0);
345:                jPanel1.add(sNMPPortJTextField, gridBagConstraints);
346:
347:                interfaceJLabel.setText("interface");
348:                interfaceJLabel.setName("interfaceJLabel");
349:                gridBagConstraints = new java.awt.GridBagConstraints();
350:                gridBagConstraints.gridx = 0;
351:                gridBagConstraints.gridy = 2;
352:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
353:                gridBagConstraints.insets = new java.awt.Insets(0, 12, 5, 12);
354:                jPanel1.add(interfaceJLabel, gridBagConstraints);
355:
356:                interfaceJTextField.setMinimumSize(new java.awt.Dimension(100,
357:                        20));
358:                interfaceJTextField.setName("interfaceJTextField");
359:                interfaceJTextField.setPreferredSize(new java.awt.Dimension(
360:                        100, 20));
361:                gridBagConstraints = new java.awt.GridBagConstraints();
362:                gridBagConstraints.gridx = 1;
363:                gridBagConstraints.gridy = 2;
364:                gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
365:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
366:                gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 0);
367:                jPanel1.add(interfaceJTextField, gridBagConstraints);
368:
369:                sNMPTrapPortJLabel.setText("trap");
370:                sNMPTrapPortJLabel.setName("sNMPTrapPortJLabel");
371:                gridBagConstraints = new java.awt.GridBagConstraints();
372:                gridBagConstraints.gridx = 0;
373:                gridBagConstraints.gridy = 3;
374:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
375:                gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 12);
376:                jPanel1.add(sNMPTrapPortJLabel, gridBagConstraints);
377:
378:                trapPortJTextField
379:                        .setMinimumSize(new java.awt.Dimension(55, 20));
380:                trapPortJTextField.setName("trapPortJTextField");
381:                trapPortJTextField.setPreferredSize(new java.awt.Dimension(55,
382:                        20));
383:                gridBagConstraints = new java.awt.GridBagConstraints();
384:                gridBagConstraints.gridx = 1;
385:                gridBagConstraints.gridy = 3;
386:                gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
387:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
388:                jPanel1.add(trapPortJTextField, gridBagConstraints);
389:
390:                aclJCheckBox.setName("aclJCheckBox");
391:                aclJCheckBox
392:                        .addActionListener(new java.awt.event.ActionListener() {
393:                            public void actionPerformed(
394:                                    java.awt.event.ActionEvent evt) {
395:                                aclJCheckBoxActionPerformed(evt);
396:                            }
397:                        });
398:
399:                gridBagConstraints = new java.awt.GridBagConstraints();
400:                gridBagConstraints.gridx = 0;
401:                gridBagConstraints.gridy = 4;
402:                gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
403:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
404:                gridBagConstraints.weightx = 1.0;
405:                gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 0);
406:                jPanel1.add(aclJCheckBox, gridBagConstraints);
407:
408:                jPanel10.setLayout(new java.awt.GridBagLayout());
409:
410:                customACL.setName("customACL");
411:                gridBagConstraints = new java.awt.GridBagConstraints();
412:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
413:                gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
414:                jPanel10.add(customACL, gridBagConstraints);
415:
416:                aclFileJTextField
417:                        .setMinimumSize(new java.awt.Dimension(200, 20));
418:                aclFileJTextField.setName("aclFileJTextField");
419:                aclFileJTextField.setPreferredSize(new java.awt.Dimension(200,
420:                        20));
421:                gridBagConstraints = new java.awt.GridBagConstraints();
422:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
423:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
424:                gridBagConstraints.weightx = 1.0;
425:                gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
426:                jPanel10.add(aclFileJTextField, gridBagConstraints);
427:
428:                aclFileJButton.setMaximumSize(new java.awt.Dimension(90, 20));
429:                aclFileJButton.setMinimumSize(new java.awt.Dimension(90, 20));
430:                aclFileJButton.setName("aclFileJButton");
431:                aclFileJButton.setPreferredSize(new java.awt.Dimension(90, 20));
432:                aclFileJButton
433:                        .addActionListener(new java.awt.event.ActionListener() {
434:                            public void actionPerformed(
435:                                    java.awt.event.ActionEvent evt) {
436:                                aclFileJButtonActionPerformed(evt);
437:                            }
438:                        });
439:
440:                gridBagConstraints = new java.awt.GridBagConstraints();
441:                gridBagConstraints.gridx = 2;
442:                gridBagConstraints.gridy = 0;
443:                gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
444:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
445:                jPanel10.add(aclFileJButton, gridBagConstraints);
446:
447:                gridBagConstraints = new java.awt.GridBagConstraints();
448:                gridBagConstraints.gridx = 0;
449:                gridBagConstraints.gridy = 5;
450:                gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
451:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
452:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
453:                gridBagConstraints.insets = new java.awt.Insets(5, 24, 0, 0);
454:                jPanel1.add(jPanel10, gridBagConstraints);
455:
456:                add(jPanel1, java.awt.BorderLayout.NORTH);
457:
458:            }
459:
460:            // </editor-fold>//GEN-END:initComponents
461:
462:            private void aclFileJButtonActionPerformed(
463:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aclFileJButtonActionPerformed
464:                int returnVal = chooser.showOpenDialog(aclFileJButton);
465:                if (returnVal == JFileChooser.APPROVE_OPTION) {
466:                    aclFileJTextField.setText(chooser.getSelectedFile()
467:                            .getAbsolutePath());
468:                }
469:            }//GEN-LAST:event_aclFileJButtonActionPerformed
470:
471:            private void aclJCheckBoxActionPerformed(
472:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aclJCheckBoxActionPerformed
473:                updateSelected();
474:                if (aclSelected) {
475:                    aclFileJTextField.setEnabled(true);
476:                    aclFileJButton.setEnabled(true);
477:                    customACL.setEnabled(true);
478:                } else {
479:                    aclFileJTextField.setEnabled(false);
480:                    aclFileJButton.setEnabled(false);
481:                    customACL.setEnabled(false);
482:                }
483:                //wiz.fireChangeEvent (); 
484:            }//GEN-LAST:event_aclJCheckBoxActionPerformed
485:
486:            private void sNMPJCheckBoxActionPerformed(
487:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sNMPJCheckBoxActionPerformed
488:                updateSelected();
489:                setSNMPPanelEnabled(sNMPSelected);
490:                //wiz.fireChangeEvent (); 
491:            }//GEN-LAST:event_sNMPJCheckBoxActionPerformed
492:
493:            // Variables declaration - do not modify//GEN-BEGIN:variables
494:            private javax.swing.JButton aclFileJButton;
495:            private javax.swing.JTextField aclFileJTextField;
496:            private javax.swing.JCheckBox aclJCheckBox;
497:            private javax.swing.JLabel customACL;
498:            private javax.swing.JLabel interfaceJLabel;
499:            private javax.swing.JTextField interfaceJTextField;
500:            private javax.swing.JPanel jPanel1;
501:            private javax.swing.JPanel jPanel10;
502:            private javax.swing.ButtonGroup managementFilesGroup;
503:            private javax.swing.JCheckBox sNMPJCheckBox;
504:            private javax.swing.JLabel sNMPPortJLabel;
505:            private javax.swing.JTextField sNMPPortJTextField;
506:            private javax.swing.JLabel sNMPTrapPortJLabel;
507:            private javax.swing.JTextField trapPortJTextField;
508:
509:            // End of variables declaration//GEN-END:variables
510:
511:            /**
512:             *
513:             * Class handling the standard Agent wizard panel
514:             *
515:             */
516:            public static class SNMPWizardPanel extends GenericWizardPanel
517:                    implements  org.openide.WizardDescriptor.FinishablePanel {
518:                private SNMPPanel panel = null;
519:                private String projectLocation = null;
520:
521:                public Component getComponent() {
522:                    return getPanel();
523:                }
524:
525:                private SNMPPanel getPanel() {
526:                    if (panel == null) {
527:                        panel = new SNMPPanel(this );
528:                    }
529:                    return panel;
530:                }
531:
532:                public boolean isFinishPanel() {
533:                    return false;
534:                }
535:
536:                //=====================================================================
537:                // Called to read information from the wizard map in order to populate
538:                // the GUI correctly.
539:                //=====================================================================
540:                public void readSettings(Object settings) {
541:                    WizardDescriptor wiz = (WizardDescriptor) settings;
542:
543:                    getPanel().sNMPPortJTextField.setText(wiz.getProperty(
544:                            WizardConstants.SNMP_PORT).toString());
545:                    getPanel().trapPortJTextField.setText(wiz.getProperty(
546:                            WizardConstants.SNMP_TRAP_PORT).toString());
547:                    getPanel().interfaceJTextField.setText((String) wiz
548:                            .getProperty(WizardConstants.SNMP_INTERFACES));
549:                }
550:
551:                //=====================================================================
552:                // Called to store information from the GUI into the wizard map.
553:                //=====================================================================
554:                public void storeSettings(Object settings) {
555:                    getPanel().updateSelected();
556:                    WizardDescriptor wiz = (WizardDescriptor) settings;
557:
558:                    wiz.putProperty(WizardConstants.SNMP_SELECTED, new Boolean(
559:                            getPanel().sNMPSelected));
560:                    wiz.putProperty(WizardConstants.SNMP_TRAP_PORT, Integer
561:                            .valueOf(getPanel().trapPortJTextField.getText()));
562:                    wiz.putProperty(WizardConstants.SNMP_PORT, Integer
563:                            .valueOf(getPanel().sNMPPortJTextField.getText()));
564:                    wiz.putProperty(WizardConstants.SNMP_INTERFACES,
565:                            getPanel().interfaceJTextField.getText());
566:                    wiz.putProperty(WizardConstants.SNMP_ACL, new Boolean(
567:                            getPanel().aclSelected));
568:                    wiz.putProperty(WizardConstants.SNMP_ACL_FILE,
569:                            getPanel().aclFileJTextField.getText());
570:                }
571:
572:                public HelpCtx getHelp() {
573:                    return new HelpCtx("mgt_properties"); // NOI18N
574:                }
575:            }
576:
577:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.