Source Code Cross Referenced for ServiceEditor.java in  » XML-UI » xui32 » com » xoetrope » editor » netbeans » services » 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 » XML UI » xui32 » com.xoetrope.editor.netbeans.services 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.xoetrope.editor.netbeans.services;
002:
003:        //import com.baltimore.jcrypto.provider.crypto.cipher.Mode;
004:
005:        import com.xoetrope.carousel.services.*;
006:        import java.util.Enumeration;
007:        import java.util.Hashtable;
008:
009:        import java.awt.BorderLayout;
010:        import java.awt.Component;
011:        import java.awt.Container;
012:        import java.awt.Dimension;
013:        import javax.swing.BorderFactory;
014:        import javax.swing.JPanel;
015:        import javax.swing.JScrollPane;
016:        import javax.swing.JSplitPane;
017:        import javax.swing.JTree;
018:        import javax.swing.border.EmptyBorder;
019:        import javax.swing.tree.DefaultMutableTreeNode;
020:        import javax.swing.tree.TreePath;
021:
022:        import net.xoetrope.editor.project.XEditorProject;
023:        import net.xoetrope.xml.XmlElement;
024:        import net.xoetrope.xui.data.XModel;
025:        import net.xoetrope.xui.data.XBaseModel;
026:
027:        import org.openide.windows.TopComponent;
028:        import org.openide.text.CloneableEditorSupport;
029:        import org.openide.windows.Mode;
030:        import org.openide.windows.TopComponent;
031:        import org.openide.windows.WindowManager;
032:        import net.xoetrope.xui.helper.Constants;
033:
034:        /**
035:         * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
036:         * the GNU Public License (GPL), please see license.txt for more details. If
037:         * you make commercial use of this software you must purchase a commercial
038:         * license from Xoetrope.</p>
039:         * <p> $Revision: 1.6 $</p>
040:         */
041:        public class ServiceEditor extends TopComponent implements 
042:                IServiceEditor {
043:            private XEditorProject currentProject;
044:            private Container toolbar;
045:            private JTree servicesTree;
046:            private JPanel editPanel;
047:            private JSplitPane splitPane;
048:            private JScrollPane servicesPane;
049:            private DefaultMutableTreeNode topNode, clientNode, serverNode;
050:            private ServiceDataEditor serviceDataEditor;
051:
052:            public ServiceEditor(XEditorProject proj) {
053:                currentProject = proj;
054:                //setName( "Services (" + currentProject.getProjectTitle() + ")" );
055:
056:                add(createToolbar(), BorderLayout.NORTH);
057:
058:                servicesPane = new JScrollPane(servicesTree);
059:                servicesPane.setBorder(BorderFactory.createEmptyBorder());
060:                servicesPane.setViewportBorder(BorderFactory
061:                        .createEmptyBorder());
062:                int preferredWidth = 200;
063:                Mode explorerMode = WindowManager.getDefault().findMode(
064:                        "explorer");
065:                //if ( explorerMode != null )
066:                //  preferredWidth = explorerMode.getSelectedTopComponent().getWidth();
067:                servicesPane
068:                        .setPreferredSize(new Dimension(preferredWidth, 200));
069:                serviceDataEditor = new ServiceDataEditor(this , proj);
070:                getServiceManager().loadServicesFromFile(currentProject);
071:                createTree();
072:                editPanel = new JPanel(new BorderLayout());
073:                editPanel.setBorder(BorderFactory.createEmptyBorder());
074:                editPanel.add(serviceDataEditor);
075:                splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
076:                        servicesPane, editPanel);
077:                splitPane.setDividerSize(6);
078:                splitPane.setDividerLocation(0.3);
079:                splitPane.setBorder(BorderFactory.createEmptyBorder());
080:                add(splitPane, BorderLayout.CENTER);
081:            }
082:
083:            private ServiceManager getServiceManager() {
084:                return (ServiceManager) currentProject
085:                        .getObject(ProjectRouteManager.SERVICE_MGR_LOOKUP);
086:            }
087:
088:            /**
089:             * Dock this TopComponent
090:             */
091:            /*public void open()
092:            {
093:              Mode mode = WindowManager.getDefault().findMode( "output" );
094:              if ( mode != null )
095:                mode.dockInto( this );
096:              super.open();
097:            }*/
098:
099:            private Component createToolbar() {
100:                setLayout(new BorderLayout());
101:                toolbar = new JPanel(new BorderLayout());
102:                return toolbar;
103:            }
104:
105:            public void createTree() {
106:                topNode = new DefaultMutableTreeNode(Constants.SERVICES);
107:                servicesTree = new JTree(topNode);
108:                servicesTree.setEditable(true);
109:                servicesTree.setBorder(BorderFactory.createEmptyBorder());
110:
111:                servicesPane.setViewportView(servicesTree);
112:                serviceDataEditor.setServiceTree(servicesTree);
113:
114:                buildTree(topNode, null);
115:                expandRoot();
116:            }
117:
118:            private void buildTree(DefaultMutableTreeNode parent, XmlElement ele) {
119:                clientNode = new DefaultMutableTreeNode(Constants.CLIENT);
120:                serverNode = new DefaultMutableTreeNode(Constants.SERVER);
121:                parent.add(clientNode);
122:                parent.add(serverNode);
123:
124:                XBaseModel serviceMdl = getServiceManager().getServices(
125:                        ServiceManager.SIDE_CLIENT);
126:                buildServiceTree(clientNode, serviceMdl);
127:
128:                serviceMdl = getServiceManager().getServices(
129:                        ServiceManager.SIDE_SERVER);
130:                buildServiceTree(serverNode, serviceMdl);
131:            }
132:
133:            private void buildServiceTree(DefaultMutableTreeNode parentNode,
134:                    XBaseModel serviceMdl) {
135:                for (int i = 0; i < serviceMdl.getNumChildren(); i++) {
136:                    XBaseModel child = (XBaseModel) serviceMdl.get(i);
137:                    DefaultMutableTreeNode nodService = new DefaultMutableTreeNode(
138:                            child.getId());
139:                    parentNode.add(nodService);
140:                }
141:            }
142:
143:            public void save() {
144:                String filename = getModelManager().getServicesFileName();
145:                if (filename != null)
146:                    getServiceManager().saveServices(currentProject);
147:            }
148:
149:            private ModelManager getModelManager() {
150:                RouteManager routeMgr = (RouteManager) currentProject
151:                        .getObject(ProjectRouteManager.ROUTE_MGR_LOOKUP);
152:                return routeMgr.getModelMgr();
153:            }
154:
155:            private void expandRoot() {
156:                TreePath path = new TreePath(topNode);
157:                servicesTree.expandPath(path);
158:                servicesTree.repaint();
159:            }
160:
161:            /*public String preferredId()
162:            {
163:              return "XuiProServiceEditor";
164:            }*/
165:
166:            /**
167:             * @todo When the class has stabilized remove this method and retest the persistence
168:             * @return
169:             */
170:            /*public int getPersistenceType()
171:            {
172:              return PERSISTENCE_NEVER;
173:            }*/
174:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.