Source Code Cross Referenced for AntDeployInputTemplatesPanel.java in  » J2EE » enhydra-IDE-plugin » org » enhydra » kelp » ant » deployer » 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 » J2EE » enhydra IDE plugin » org.enhydra.kelp.ant.deployer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.enhydra.kelp.ant.deployer;
002:
003:        import org.enhydra.tool.swing.layout.*;
004:        import javax.swing.*;
005:        import java.util.ResourceBundle;
006:        import org.enhydra.kelp.common.node.OtterFileNode;
007:        import java.awt.event.ActionListener;
008:        import java.awt.event.ActionEvent;
009:        import java.io.File;
010:        import org.enhydra.kelp.common.node.OtterProject;
011:        import org.enhydra.kelp.ant.node.AntProject;
012:
013:        /**
014:         * <p>Title: </p>
015:         * <p>Description: </p>
016:         * <p>Copyright: Copyright (c) 2003</p>
017:         * <p>Company: </p>
018:         * @author unascribed
019:         * @version 1.0
020:         */
021:
022:        public class AntDeployInputTemplatesPanel extends JPanel {
023:            static ResourceBundle res = ResourceBundle
024:                    .getBundle("org.enhydra.kelp.common.Res");
025:
026:            XYLayout xYLayout1 = new XYLayout();
027:            JLabel jLabelAreaHeader = new JLabel();
028:            JScrollPane jScrollDocuments = new JScrollPane();
029:            JList jListDocuments = new JList();
030:            JCheckBox jCheckFullPath = new JCheckBox();
031:            JLabel jLabelRoot = new JLabel();
032:            JTextField jTextFieldRoot = new JTextField();
033:            JButton jButtonBrowse = new JButton();
034:            private LocalCheckListener checkListener = null;
035:            private DefaultListModel modelAvailable = new DefaultListModel();
036:            private OtterFileNode[] nodes = new OtterFileNode[0];
037:            private AntProject project = null;
038:
039:            public AntDeployInputTemplatesPanel() {
040:                try {
041:                    jbInit();
042:                    pmInit();
043:                } catch (Exception ex) {
044:                    ex.printStackTrace();
045:                }
046:            }
047:
048:            void jbInit() throws Exception {
049:                jLabelAreaHeader.setText(res.getString("Input_documents"));
050:                this .setLayout(xYLayout1);
051:                jCheckFullPath.setToolTipText("");
052:                jCheckFullPath.setText(res.getString("Show_full"));
053:                xYLayout1.setWidth(472);
054:                xYLayout1.setHeight(287);
055:                jLabelRoot.setText(res.getString("Input_root"));
056:                jButtonBrowse.setText(res.getString("Browse"));
057:                jButtonBrowse
058:                        .addActionListener(new java.awt.event.ActionListener() {
059:                            public void actionPerformed(ActionEvent e) {
060:                                jButtonBrowse_actionPerformed(e);
061:                            }
062:                        });
063:                this .add(jLabelAreaHeader, new XYConstraints(12, 7, 107, 22));
064:                this .add(jScrollDocuments, new XYConstraints(12, 37, 448, 119));
065:                this .add(jCheckFullPath, new XYConstraints(12, 171, 129, -1));
066:                this .add(jLabelRoot, new XYConstraints(12, 206, 65, -1));
067:                this .add(jTextFieldRoot, new XYConstraints(75, 204, 288, -1));
068:                this .add(jButtonBrowse, new XYConstraints(374, 203, 83, 23));
069:                jScrollDocuments.getViewport().add(jListDocuments, null);
070:            }
071:
072:            private void pmInit() {
073:                checkListener = new LocalCheckListener();
074:                jTextFieldRoot.setEditable(false); //Do not allow manual changes, use browse button only
075:                jCheckFullPath.addActionListener(checkListener);
076:                jCheckFullPath.setSelected(false);
077:                jListDocuments.setModel(getModelAvailable());
078:            }
079:
080:            protected DefaultListModel getModelAvailable() {
081:                return modelAvailable;
082:            }
083:
084:            protected void fillLists() {
085:                int count = getNodes().length;
086:                OtterFileNode source = null;
087:
088:                if (getModelAvailable().getSize() > 0) {
089:                    getModelAvailable().clear();
090:                }
091:
092:                for (int i = 0; i < count; i++) {
093:                    LocalListNode listNode = null;
094:                    source = getNodes()[i];
095:                    listNode = new LocalListNode(source.getFilePath());
096:                    getModelAvailable().addElement(listNode);
097:                }
098:            }
099:
100:            public OtterFileNode[] getNodes() {
101:                return nodes;
102:            }
103:
104:            public void setNodes(OtterFileNode[] n) {
105:                nodes = n;
106:                fillLists();
107:            }
108:
109:            public void setProject(OtterProject otterProject) {
110:                if (otterProject instanceof  AntProject) {
111:                    project = (AntProject) otterProject;
112:                    initOptions();
113:                } else
114:                    System.err.println("DEBUG project must be AntProject");//FIXME throw Exception
115:            }
116:
117:            private void initOptions() {
118:                this .setNodes(project.getAllInput());
119:                jTextFieldRoot.setText(project
120:                        .getProperty(AntProject.INPUT_DIR));
121:
122:                //        HashMap replacementsMap = project.getReplacements();
123:                //        Iterator replacementsIterator = replacementsMap.entrySet().iterator();
124:                //        defaultTable = new String[replacementsMap.size()][2];
125:                //        int i = 0;
126:                //        Map.Entry mapEntry = null;
127:                //        while (replacementsIterator.hasNext()) {
128:                //            mapEntry = (Map.Entry)replacementsIterator.next();
129:                //            defaultTable[i][0] = (String)mapEntry.getKey();
130:                //            defaultTable[i][1] = (String)mapEntry.getValue();
131:                //            i++;
132:                //        }
133:                //        setReplacementTable(defaultTable);
134:            }
135:
136:            void jButtonBrowse_actionPerformed(ActionEvent e) {
137:                browseForDir();
138:            }
139:
140:            private void browseForDir() {
141:                JFileChooser chooser;
142:                String fileDir = new String();
143:                File file = null;
144:                chooser = new JFileChooser();
145:                chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
146:                file = new File(project.getProperty(AntProject.INPUT_DIR));
147:                if (!file.isAbsolute()) {
148:                    file = new File(project.getWorkingPath(), file.getPath());
149:                }
150:                chooser.setCurrentDirectory(file);
151:                chooser.setDialogTitle(res
152:                        .getString("chooser_InputRoot_DialogTitle"));
153:                chooser.setApproveButtonText(res.getString("OK"));
154:                int v = chooser.showOpenDialog(this );
155:
156:                this .requestFocus();
157:                jButtonBrowse.requestFocus();
158:                if (v == JFileChooser.APPROVE_OPTION) {
159:                    if (!(chooser.getCurrentDirectory() == null)) {
160:                        fileDir = chooser.getSelectedFile().toString();
161:                        jTextFieldRoot.setText(fileDir);
162:                        project.setProperty(AntProject.INPUT_DIR, fileDir);
163:                        this .setNodes(project.getAllInput()); //Reload files from new input directory
164:                    }
165:                }
166:                chooser.removeAll();
167:                chooser = null;
168:            }
169:
170:            private class LocalCheckListener implements  ActionListener {
171:                public void actionPerformed(ActionEvent event) {
172:                    Object source = event.getSource();
173:
174:                    if (source == jCheckFullPath) {
175:
176:                        fillLists();
177:                    }
178:                }
179:
180:            }
181:
182:            private class LocalListNode {
183:                private String full = new String();
184:
185:                public LocalListNode(String fullName) {
186:                    full = fullName;
187:                }
188:
189:                public String toString() {
190:                    String s = full;
191:
192:                    if (!jCheckFullPath.isSelected()) {
193:                        File f = new File(full);
194:
195:                        s = f.getName();
196:                    }
197:                    return s;
198:                }
199:
200:                public String getFullname() {
201:                    return full;
202:                }
203:
204:            }
205:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.