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


001:        /*
002:         * Enhydra Java Application Server Project
003:         *
004:         * The contents of this file are subject to the Enhydra Public License
005:         * Version 1.1 (the "License"); you may not use this file except in
006:         * compliance with the License. You may obtain a copy of the License on
007:         * the Enhydra web site ( http://www.enhydra.org/ ).
008:         *
009:         * Software distributed under the License is distributed on an "AS IS"
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
011:         * the License for the specific terms governing rights and limitations
012:         * under the License.
013:         *
014:         * The Initial Developer of the Enhydra Application Server is Lutris
015:         * Technologies, Inc. The Enhydra Application Server and portions created
016:         * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017:         * All Rights Reserved.
018:         *
019:         * Contributor(s):
020:         * Paul Mahar
021:         *
022:         */
023:        package org.enhydra.kelp.common.xmlc;
024:
025:        // ToolBox
026:        import org.enhydra.tool.ToolBoxInfo;
027:        import org.enhydra.tool.common.DataValidationException;
028:        import org.enhydra.tool.common.SwingUtil;
029:
030:        // AddinCore
031:        import org.enhydra.kelp.KelpInfo;
032:        import org.enhydra.kelp.common.Constants;
033:        import org.enhydra.kelp.common.event.WriteEvent;
034:        import org.enhydra.kelp.common.event.WriteListener;
035:        import org.enhydra.kelp.common.node.OtterProject;
036:        import org.enhydra.kelp.common.node.OtterFileNode;
037:        import org.enhydra.kelp.common.node.OtterNode;
038:        import org.enhydra.kelp.common.swing.AddinInnerPanel;
039:        import org.enhydra.kelp.common.swing.FileNodeSelectionPanel;
040:
041:        // JDK
042:        import java.util.ArrayList;
043:        import java.util.Arrays;
044:        import java.util.ResourceBundle;
045:        import java.awt.*;
046:        import java.beans.*;
047:        import javax.swing.*;
048:
049:        //
050:        public class XMLCInnerPanel extends AddinInnerPanel {
051:
052:            //
053:            static ResourceBundle res = ResourceBundle
054:                    .getBundle("org.enhydra.kelp.common.Res"); // nores
055:
056:            //
057:            private FileNodeSelectionPanel selectionPanel = null;
058:            private boolean standalone = false;
059:            private JPanel panelOptionFiller0 = null;
060:            private JPanel panelOptionFiller1 = null;
061:            private JPanel panelOptionFiller2 = null;
062:            private GridBagLayout layoutMain = null;
063:            private JPanel propertyPanelHolder = null;
064:            private AddinInnerPanel propertyPanel = null;
065:            private XMLCOutputPanel outputPanel = null;
066:            private JTabbedPane tab = null;
067:            private WriteListener[] writeListeners = new WriteListener[0];
068:            private String progressTitle = new String();
069:
070:            public static XMLCInnerPanel XMLCfindAncestor(Component comp) {
071:                Component found = null;
072:                XMLCInnerPanel ancestor = null;
073:
074:                found = AddinInnerPanel.findAncestor(comp);
075:                if (found == null) {
076:                } else if (found instanceof  XMLCInnerPanel) {
077:                    ancestor = (XMLCInnerPanel) found;
078:                }
079:                return ancestor;
080:            }
081:
082:            public XMLCInnerPanel() {
083:                try {
084:                    jbInit();
085:                    pmInit();
086:                } catch (Exception ex) {
087:                    ex.printStackTrace();
088:                }
089:            }
090:
091:            // overwrite org.enhydra.kelp.common.swing.InnerPanel
092:            public void clearAll() {
093:                super .clearAll();
094:                layoutMain = null;
095:                writeListeners = new WriteListener[0];
096:            }
097:
098:            public FileNodeSelectionPanel getSelectionPanel() {
099:                return selectionPanel;
100:            }
101:
102:            public AddinInnerPanel getPropertyPanel() {
103:                return propertyPanel;
104:            }
105:
106:            public void selectOutputTab() {
107:                selectTab(outputPanel);
108:            }
109:
110:            public void selectOptionTab() {
111:                selectTab(panelOptionFiller0);
112:            }
113:
114:            //
115:            // PROTECTED
116:            //
117:            protected void setPropertyPanel(AddinInnerPanel p) {
118:                if (propertyPanel == null) {
119:                    propertyPanelHolder.removeAll();
120:                } else {
121:                    propertyPanelHolder.remove(propertyPanel);
122:                }
123:                propertyPanel = p;
124:                propertyPanelHolder.add(propertyPanel, BorderLayout.CENTER);
125:            }
126:
127:            protected void setSelectText(String[] s) {
128:                getSelectionPanel().setSelectText(s);
129:            }
130:
131:            protected String[] getSelectText() {
132:                return getSelectionPanel().getSelectText();
133:            }
134:
135:            protected synchronized WriteListener[] getWriteListeners() {
136:                return writeListeners;
137:            }
138:
139:            protected synchronized void addWriteListener(WriteListener l) {
140:                ArrayList list = null;
141:
142:                list = new ArrayList(Arrays.asList(writeListeners));
143:                if (!list.contains(l)) {
144:                    list.add(l);
145:                    list.trimToSize();
146:                    writeListeners = new WriteListener[list.size()];
147:                    writeListeners = (WriteListener[]) list
148:                            .toArray(writeListeners);
149:                }
150:                list.clear();
151:            }
152:
153:            protected synchronized void removeWriteListener(WriteListener l) {
154:                ArrayList list = null;
155:
156:                list = new ArrayList(Arrays.asList(writeListeners));
157:                if (list.contains(l)) {
158:                    list.remove(l);
159:                    list.trimToSize();
160:                    writeListeners = new WriteListener[list.size()];
161:                    writeListeners = (WriteListener[]) list
162:                            .toArray(writeListeners);
163:                }
164:                list.clear();
165:            }
166:
167:            /**
168:             * Get source files that can be selected for compilation.
169:             */
170:            protected OtterFileNode[] getNodes() {
171:                return selectionPanel.getNodes();
172:            }
173:
174:            /**
175:             * Set the source files that can be selected for compilation
176:             */
177:            protected void setNodes(OtterFileNode[] n) {
178:                selectionPanel.setNodes(n);
179:            }
180:
181:            // override AddinInnerPanel
182:            public void read(OtterNode node) {
183:                super .read(node);
184:                propertyPanel.read(node);
185:                outputPanel.setProject(getProject());
186:            }
187:
188:            // override AddinInnerPanel
189:            public void write(OtterNode node) throws DataValidationException {
190:                super .write(node);
191:                if (getProject() == null) {
192:                    System.err
193:                            .println("XMLCInnerPanel.write(OtterProject p) : no project set");
194:                } else {
195:                    propertyPanel.write(node);
196:                    outputPanel.setProject(getProject());
197:                }
198:            }
199:
200:            // override AddinInnerPanel
201:            protected Component[] getFirstFocusComponents() {
202:                Component[] comps = new Component[1];
203:
204:                comps[0] = tab;
205:                return comps;
206:            }
207:
208:            //
209:            // PRIVATE
210:            //
211:            // override AddinInnerPanel
212:            public void save() {
213:                super .save();
214:                propertyPanel.save();
215:            }
216:
217:            protected void clearOutput() {
218:                outputPanel.clearOutput();
219:            }
220:
221:            //
222:            // PRIVATE
223:            //
224:            private void selectTab(final JPanel goPanel) {
225:                SelectTab runSwing = null;
226:
227:                runSwing = new SelectTab(tab, goPanel);
228:                try {
229:                    if (SwingUtilities.isEventDispatchThread()) {
230:                        runSwing.run();
231:                    } else {
232:                        SwingUtilities.invokeAndWait(runSwing);
233:                    }
234:                } catch (Exception e) {
235:                    e.printStackTrace();
236:                }
237:                try {
238:                    Thread.sleep(500);
239:                } catch (InterruptedException e) {
240:
241:                    //
242:                }
243:            }
244:
245:            /**
246:             * Add listeners and other items that are not generated by
247:             * the JBuilder designer.
248:             */
249:            private void pmInit() {
250:                tab.add(res.getString("Selections"), selectionPanel);
251:                tab.add(res.getString("Options"), panelOptionFiller0);
252:                tab.add(res.getString("Output"), outputPanel);
253:                addWriteListener(outputPanel);
254:            }
255:
256:            /**
257:             * UI code generated by JBuilder.
258:             * <P><I>Do not modify the signature of this method.</I></P>
259:             */
260:            private void jbInit() throws Exception {
261:                layoutMain = (GridBagLayout) Beans.instantiate(getClass()
262:                        .getClassLoader(), GridBagLayout.class.getName());
263:                panelOptionFiller0 = (JPanel) Beans.instantiate(getClass()
264:                        .getClassLoader(), JPanel.class.getName());
265:                panelOptionFiller1 = (JPanel) Beans.instantiate(getClass()
266:                        .getClassLoader(), JPanel.class.getName());
267:                panelOptionFiller2 = (JPanel) Beans.instantiate(getClass()
268:                        .getClassLoader(), JPanel.class.getName());
269:                selectionPanel = (FileNodeSelectionPanel) Beans.instantiate(
270:                        getClass().getClassLoader(),
271:                        FileNodeSelectionPanel.class.getName());
272:                propertyPanelHolder = (JPanel) Beans.instantiate(getClass()
273:                        .getClassLoader(), JPanel.class.getName());
274:                outputPanel = (XMLCOutputPanel) Beans.instantiate(getClass()
275:                        .getClassLoader(), XMLCOutputPanel.class.getName());
276:                tab = (JTabbedPane) Beans.instantiate(getClass()
277:                        .getClassLoader(), JTabbedPane.class.getName());
278:                panelOptionFiller0.setLayout(new GridBagLayout());
279:                panelOptionFiller0.add(panelOptionFiller1,
280:                        new GridBagConstraints(0, 0, 1, 1, 0.15, 0.15,
281:                                GridBagConstraints.CENTER,
282:                                GridBagConstraints.BOTH,
283:                                new Insets(0, 0, 0, 0), 0, 0));
284:                panelOptionFiller0.add(propertyPanelHolder,
285:                        new GridBagConstraints(1, 0, 1, 4, 0.7, 0.7,
286:                                GridBagConstraints.CENTER,
287:                                GridBagConstraints.NONE,
288:                                new Insets(0, 0, 0, 0), 0, 0));
289:                panelOptionFiller0.add(panelOptionFiller2,
290:                        new GridBagConstraints(2, 0, 1, 1, 0.15, 0.15,
291:                                GridBagConstraints.CENTER,
292:                                GridBagConstraints.BOTH,
293:                                new Insets(0, 0, 0, 0), 0, 0));
294:                this .setLayout(layoutMain);
295:                this .add(tab, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
296:                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
297:                        new Insets(5, 5, 5, 5), 5, 5));
298:            }
299:
300:            //
301:            private class SelectTab implements  Runnable {
302:                private JTabbedPane tp = null;
303:                private JPanel go = null;
304:
305:                protected SelectTab(JTabbedPane t, JPanel g) {
306:                    tp = t;
307:                    go = g;
308:                }
309:
310:                synchronized public void run() {
311:                    tp.setSelectedComponent(go);
312:                    try {
313:                        SwingUtilities.windowForComponent(tp).repaint();
314:                    } catch (NullPointerException e) {
315:
316:                        // ignore for windows not yet open.
317:                    }
318:                }
319:
320:            }
321:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.