Source Code Cross Referenced for AddServerVisualPanel.java in  » EJB-Server-resin-3.1.5 » netbeans-plugin » com » caucho » netbeans » ide » ui » 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 » EJB Server resin 3.1.5 » netbeans plugin » com.caucho.netbeans.ide.ui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * To change this template, choose Tools | Templates
003:         * and open the template in the editor.
004:         */
005:
006:        package com.caucho.netbeans.ide.ui;
007:
008:        import com.caucho.netbeans.ide.AddInstanceIterator;
009:        import java.io.File;
010:        import javax.swing.JFileChooser;
011:        import javax.swing.JPanel;
012:        import javax.swing.SwingUtilities;
013:        import javax.swing.event.ChangeEvent;
014:        import javax.swing.event.DocumentEvent;
015:        import javax.swing.event.DocumentListener;
016:
017:        public final class AddServerVisualPanel extends JPanel {
018:            private AddInstanceIterator _addServer;
019:            private AddServerLocationPanel _wizardPanel;
020:
021:            AddServerVisualPanel(AddInstanceIterator addServer,
022:                    AddServerLocationPanel wizardPanel) {
023:                initComponents();
024:
025:                _addServer = addServer;
026:                _wizardPanel = wizardPanel;
027:
028:                this .jResinHome.setText(addServer.getResinHome());
029:                this .jSpinner1.setValue(addServer.getPort());
030:
031:                this .jResinHome.getDocument().addDocumentListener(
032:                        new DocumentListener() {
033:                            public void changedUpdate(DocumentEvent e) {
034:                                _wizardPanel
035:                                        .stateChanged(new ChangeEvent(this ));
036:                            }
037:
038:                            public void insertUpdate(DocumentEvent e) {
039:                                _wizardPanel
040:                                        .stateChanged(new ChangeEvent(this ));
041:                            }
042:
043:                            public void removeUpdate(DocumentEvent e) {
044:                                _wizardPanel
045:                                        .stateChanged(new ChangeEvent(this ));
046:                            }
047:                        });
048:            }
049:
050:            public String getResinHome() {
051:                return this .jResinHome.getText().trim();
052:            }
053:
054:            public int getPort() {
055:                return Integer.valueOf(this .jSpinner1.getValue().toString());
056:            }
057:
058:            @Override
059:            public String getName() {
060:                return "Set Resin Home";
061:            }
062:
063:            /** This method is called from within the constructor to
064:             * initialize the form.
065:             * WARNING: Do NOT modify this code. The content of this method is
066:             * always regenerated by the Form Editor.
067:             */
068:            // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
069:            private void initComponents() {
070:
071:                jLabel1 = new javax.swing.JLabel();
072:                jResinHome = new javax.swing.JTextField();
073:                jButton1 = new javax.swing.JButton();
074:                jLabel2 = new javax.swing.JLabel();
075:                jLabel3 = new javax.swing.JLabel();
076:                jSpinner1 = new javax.swing.JSpinner();
077:
078:                org.openide.awt.Mnemonics.setLocalizedText(jLabel1,
079:                        "Resin Home");
080:
081:                jResinHome.setText("jResinHome");
082:
083:                org.openide.awt.Mnemonics.setLocalizedText(jButton1, "Browse");
084:                jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
085:                    public void mouseClicked(java.awt.event.MouseEvent evt) {
086:                        jButton1MouseClicked(evt);
087:                    }
088:                });
089:
090:                org.openide.awt.Mnemonics.setLocalizedText(jLabel2,
091:                        "Resin Home Location");
092:
093:                org.openide.awt.Mnemonics.setLocalizedText(jLabel3, "Port");
094:
095:                jSpinner1.setEditor(new javax.swing.JSpinner.NumberEditor(
096:                        jSpinner1, ""));
097:                jSpinner1
098:                        .addChangeListener(new javax.swing.event.ChangeListener() {
099:                            public void stateChanged(
100:                                    javax.swing.event.ChangeEvent evt) {
101:                                jSpinner1StateChanged(evt);
102:                            }
103:                        });
104:                jSpinner1
105:                        .addPropertyChangeListener(new java.beans.PropertyChangeListener() {
106:                            public void propertyChange(
107:                                    java.beans.PropertyChangeEvent evt) {
108:                                jSpinner1PropertyChange(evt);
109:                            }
110:                        });
111:
112:                org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
113:                        this );
114:                this .setLayout(layout);
115:                layout
116:                        .setHorizontalGroup(layout
117:                                .createParallelGroup(
118:                                        org.jdesktop.layout.GroupLayout.LEADING)
119:                                .add(
120:                                        layout
121:                                                .createSequentialGroup()
122:                                                .addContainerGap()
123:                                                .add(
124:                                                        layout
125:                                                                .createParallelGroup(
126:                                                                        org.jdesktop.layout.GroupLayout.LEADING)
127:                                                                .add(jLabel2)
128:                                                                .add(
129:                                                                        layout
130:                                                                                .createSequentialGroup()
131:                                                                                .add(
132:                                                                                        layout
133:                                                                                                .createParallelGroup(
134:                                                                                                        org.jdesktop.layout.GroupLayout.LEADING)
135:                                                                                                .add(
136:                                                                                                        jLabel1)
137:                                                                                                .add(
138:                                                                                                        jLabel3))
139:                                                                                .add(
140:                                                                                        28,
141:                                                                                        28,
142:                                                                                        28)
143:                                                                                .add(
144:                                                                                        layout
145:                                                                                                .createParallelGroup(
146:                                                                                                        org.jdesktop.layout.GroupLayout.LEADING)
147:                                                                                                .add(
148:                                                                                                        layout
149:                                                                                                                .createSequentialGroup()
150:                                                                                                                .add(
151:                                                                                                                        jResinHome,
152:                                                                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
153:                                                                                                                        154,
154:                                                                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
155:                                                                                                                .add(
156:                                                                                                                        18,
157:                                                                                                                        18,
158:                                                                                                                        18)
159:                                                                                                                .add(
160:                                                                                                                        jButton1))
161:                                                                                                .add(
162:                                                                                                        jSpinner1,
163:                                                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
164:                                                                                                        55,
165:                                                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
166:                                                .addContainerGap(53,
167:                                                        Short.MAX_VALUE)));
168:                layout
169:                        .setVerticalGroup(layout
170:                                .createParallelGroup(
171:                                        org.jdesktop.layout.GroupLayout.LEADING)
172:                                .add(
173:                                        layout
174:                                                .createSequentialGroup()
175:                                                .addContainerGap()
176:                                                .add(jLabel2)
177:                                                .add(31, 31, 31)
178:                                                .add(
179:                                                        layout
180:                                                                .createParallelGroup(
181:                                                                        org.jdesktop.layout.GroupLayout.BASELINE)
182:                                                                .add(
183:                                                                        jResinHome,
184:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
185:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
186:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
187:                                                                .add(jLabel1)
188:                                                                .add(jButton1))
189:                                                .addPreferredGap(
190:                                                        org.jdesktop.layout.LayoutStyle.RELATED)
191:                                                .add(
192:                                                        layout
193:                                                                .createParallelGroup(
194:                                                                        org.jdesktop.layout.GroupLayout.BASELINE)
195:                                                                .add(jLabel3)
196:                                                                .add(
197:                                                                        jSpinner1,
198:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
199:                                                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
200:                                                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
201:                                                .addContainerGap(195,
202:                                                        Short.MAX_VALUE)));
203:            }// </editor-fold>//GEN-END:initComponents
204:
205:            private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
206:                String loc = browseResinHome();
207:
208:                if (loc != null && !"".equals(loc))
209:                    this .jResinHome.setText(loc);
210:            }//GEN-LAST:event_jButton1MouseClicked
211:
212:            private void jSpinner1PropertyChange(
213:                    java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jSpinner1PropertyChange
214:                _wizardPanel.stateChanged(new ChangeEvent(this ));
215:            }//GEN-LAST:event_jSpinner1PropertyChange
216:
217:            private void jSpinner1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinner1StateChanged
218:                _wizardPanel.stateChanged(evt);
219:            }//GEN-LAST:event_jSpinner1StateChanged
220:
221:            private String browseResinHome() {
222:                JFileChooser chooser = getResinHomeChooser();
223:                int ret = chooser.showDialog(SwingUtilities
224:                        .getWindowAncestor(this ), "Choose Resin Home");
225:
226:                if (ret == JFileChooser.APPROVE_OPTION)
227:                    return chooser.getSelectedFile().getAbsolutePath();
228:                else
229:                    return null;
230:            }
231:
232:            private JFileChooser getResinHomeChooser() {
233:                JFileChooser chooser = new JFileChooser();
234:                chooser.setDialogTitle("Select Resin Home");
235:                chooser.setDialogType(JFileChooser.CUSTOM_DIALOG);
236:
237:                chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
238:                chooser.setApproveButtonMnemonic('C');
239:                chooser.setMultiSelectionEnabled(false);
240:                chooser.setApproveButtonToolTipText("Chooser");
241:
242:                chooser.getAccessibleContext().setAccessibleName("Chooser");
243:                chooser.getAccessibleContext().setAccessibleDescription(
244:                        "Chooser");
245:
246:                chooser.setSelectedFile(new File(getResinHome()));
247:
248:                return chooser;
249:            }
250:
251:            // Variables declaration - do not modify//GEN-BEGIN:variables
252:            private javax.swing.JButton jButton1;
253:            private javax.swing.JLabel jLabel1;
254:            private javax.swing.JLabel jLabel2;
255:            private javax.swing.JLabel jLabel3;
256:            private javax.swing.JTextField jResinHome;
257:            private javax.swing.JSpinner jSpinner1;
258:            // End of variables declaration//GEN-END:variables
259:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.