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


001:        package org.enhydra.kelp.ant.xmlc;
002:
003:        /**
004:         * <p>Title: </p>
005:         * <p>Description: New dialog for Kelp XML Compiler based on Ant tool.</p>
006:         * <p>Copyright: Copyright (c) 2003</p>
007:         * <p>Company: </p>
008:         * @author Damir Milovic
009:         * @version 1.0
010:         */
011:
012:        // ToolBox
013:        import org.enhydra.tool.common.DataValidationException;
014:
015:        // AddinCore
016:        import org.enhydra.kelp.common.event.WriteListener;
017:        import org.enhydra.kelp.common.node.OtterFileNode;
018:        import org.enhydra.kelp.common.node.OtterNode;
019:        import org.enhydra.kelp.common.swing.AddinInnerPanel;
020:        import org.enhydra.kelp.common.swing.FileNodeSelectionPanel;
021:        import org.enhydra.kelp.ant.swing.AntOutputPanel;
022:
023:        // JDK
024:        import java.util.ArrayList;
025:        import java.util.Arrays;
026:        import java.util.ResourceBundle;
027:        import java.awt.*;
028:        import java.beans.*;
029:        import javax.swing.*;
030:
031:        //
032:        public class AntXMLCInnerPanel extends AddinInnerPanel {
033:
034:            //
035:            static ResourceBundle res = ResourceBundle
036:                    .getBundle("org.enhydra.kelp.common.Res"); // nores
037:
038:            private FileNodeSelectionPanel selectionPanel = null;
039:            private GridBagLayout layoutMain = null;
040:            private AntOutputPanel outputPanel = null;
041:            private JTabbedPane tab = null;
042:            private WriteListener[] writeListeners = new WriteListener[0];
043:            AntXMLCOptionsPanel optionsPanel = null;
044:
045:            public static AntXMLCInnerPanel XMLCfindAncestor(Component comp) {
046:                Component found = null;
047:                AntXMLCInnerPanel ancestor = null;
048:
049:                found = AddinInnerPanel.findAncestor(comp);
050:                if (found == null) {
051:                } else if (found instanceof  AntXMLCInnerPanel) {
052:                    ancestor = (AntXMLCInnerPanel) found;
053:                }
054:                return ancestor;
055:            }
056:
057:            public AntXMLCInnerPanel() {
058:                try {
059:                    jbInit();
060:                    pmInit();
061:                } catch (Exception ex) {
062:                    ex.printStackTrace();
063:                }
064:            }
065:
066:            // overwrite org.enhydra.kelp.common.swing.InnerPanel
067:            public void clearAll() {
068:                super .clearAll();
069:                layoutMain = null;
070:                writeListeners = new WriteListener[0];
071:            }
072:
073:            //7.2.2003
074:            public FileNodeSelectionPanel getSelectionPanel() {
075:                return selectionPanel;
076:            }
077:
078:            protected void setSelectText(String[] s) {
079:                getSelectionPanel().setSelectText(s);
080:            }
081:
082:            protected String[] getSelectText() {
083:                return getSelectionPanel().getSelectText();
084:            }
085:
086:            /**
087:             * Get source files that can be selected for compilation.
088:             */
089:            protected OtterFileNode[] getNodes() {
090:                return selectionPanel.getNodes();
091:            }
092:
093:            /**
094:             * Set the source files that can be selected for compilation
095:             */
096:            protected void setNodes(OtterFileNode[] n) {
097:                selectionPanel.setNodes(n);
098:            }
099:
100:            public AntXMLCOptionsPanel getOptionsPanel() {
101:                return optionsPanel;
102:            }
103:
104:            public void selectOutputTab() {
105:                selectTab(outputPanel);
106:            }
107:
108:            public void selectOptionTab() {
109:                selectTab(optionsPanel);
110:            }
111:
112:            //
113:            // PROTECTED
114:            //
115:
116:            public synchronized WriteListener[] getWriteListeners() {
117:                return writeListeners;
118:            }
119:
120:            public synchronized void addWriteListener(WriteListener l) {
121:                ArrayList list = null;
122:                list = new ArrayList(Arrays.asList(writeListeners));
123:                if (!list.contains(l)) {
124:                    list.add(l);
125:                    list.trimToSize();
126:                    writeListeners = new WriteListener[list.size()];
127:                    writeListeners = (WriteListener[]) list
128:                            .toArray(writeListeners);
129:                }
130:                list.clear();
131:            }
132:
133:            public synchronized void removeWriteListener(WriteListener l) {
134:                ArrayList list = null;
135:                list = new ArrayList(Arrays.asList(writeListeners));
136:                if (list.contains(l)) {
137:                    list.remove(l);
138:                    list.trimToSize();
139:                    writeListeners = new WriteListener[list.size()];
140:                    writeListeners = (WriteListener[]) list
141:                            .toArray(writeListeners);
142:                }
143:                list.clear();
144:            }
145:
146:            // override AddinInnerPanel
147:            public void read(OtterNode node) {
148:                super .read(node);
149:                outputPanel.setProject(getProject());
150:                optionsPanel.setProject(getProject());
151:            }
152:
153:            // override AddinInnerPanel
154:            public void write(OtterNode node) throws DataValidationException {
155:                super .write(node);
156:                if (getProject() == null) {
157:                    System.err
158:                            .println("AntXMLCInnerPanel.write(OtterProject p) : no project set");
159:                } else {
160:                    outputPanel.setProject(getProject());
161:                }
162:            }
163:
164:            // override AddinInnerPanel
165:            protected Component[] getFirstFocusComponents() {
166:                Component[] comps = new Component[1];
167:
168:                comps[0] = tab;
169:                return comps;
170:            }
171:
172:            //
173:            // PRIVATE
174:            //
175:            // override AddinInnerPanel
176:            public void save() {
177:                super .save();
178:                //       FIXME project.save()
179:            }
180:
181:            //DACHA{
182:            //protected void clearOutput() {
183:            public void clearOutput() {
184:                //}DACHA
185:                outputPanel.clearOutput();
186:            }
187:
188:            //
189:            // PRIVATE
190:            //
191:
192:            private void selectTab(final JPanel goPanel) {
193:                SelectTab runSwing = null;
194:
195:                runSwing = new SelectTab(tab, goPanel);
196:                try {
197:                    if (SwingUtilities.isEventDispatchThread()) {
198:                        runSwing.run();
199:                    } else {
200:                        SwingUtilities.invokeAndWait(runSwing);
201:                    }
202:                } catch (Exception e) {
203:                    e.printStackTrace();
204:                }
205:                try {
206:                    Thread.sleep(500);
207:                } catch (InterruptedException e) {
208:
209:                    //
210:                }
211:            }
212:
213:            /**
214:             * Add listeners and other items that are not generated by
215:             * the JBuilder designer.
216:             */
217:            private void pmInit() {
218:                tab.add(res.getString("Selections"), selectionPanel);
219:                tab.add(res.getString("Options"), optionsPanel);
220:                tab.add(res.getString("Output"), outputPanel);
221:                addWriteListener(outputPanel);
222:            }
223:
224:            /**
225:             * UI code generated by JBuilder.
226:             * <P><I>Do not modify the signature of this method.</I></P>
227:             */
228:            private void jbInit() throws Exception {
229:                layoutMain = (GridBagLayout) Beans.instantiate(getClass()
230:                        .getClassLoader(), GridBagLayout.class.getName());
231:
232:                optionsPanel = (AntXMLCOptionsPanel) Beans.instantiate(
233:                        getClass().getClassLoader(), AntXMLCOptionsPanel.class
234:                                .getName());
235:
236:                selectionPanel = (FileNodeSelectionPanel) Beans.instantiate(
237:                        getClass().getClassLoader(),
238:                        FileNodeSelectionPanel.class.getName());
239:
240:                outputPanel = (AntOutputPanel) Beans.instantiate(getClass()
241:                        .getClassLoader(), AntOutputPanel.class.getName());
242:                tab = (JTabbedPane) Beans.instantiate(getClass()
243:                        .getClassLoader(), JTabbedPane.class.getName());
244:
245:                this .setLayout(layoutMain);
246:                this .add(tab, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
247:                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
248:                        new Insets(5, 5, 5, 5), 5, 5));
249:            }
250:
251:            private class SelectTab implements  Runnable {
252:                private JTabbedPane tp = null;
253:                private JPanel go = null;
254:
255:                protected SelectTab(JTabbedPane t, JPanel g) {
256:                    tp = t;
257:                    go = g;
258:                }
259:
260:                synchronized public void run() {
261:                    tp.setSelectedComponent(go);
262:                    try {
263:                        SwingUtilities.windowForComponent(tp).repaint();
264:                    } catch (NullPointerException e) {
265:
266:                        // ignore for windows not yet open.
267:                    }
268:                }
269:
270:            }
271:
272:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.