Source Code Cross Referenced for AbstractClasspathContainer.java in  » ESB » cbesb-1.2 » com » bostechcorp » cbesb » ui » ide » classpath » 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 » ESB » cbesb 1.2 » com.bostechcorp.cbesb.ui.ide.classpath 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ChainBuilder ESB
003:         *          Visual Enterprise Integration
004:         * 
005:         * Copyright (C) 2006 Bostech Corporation
006:         * 
007:         * This program is free software; you can redistribute it and/or modify it 
008:         * under the terms of the GNU General Public License as published by the 
009:         * Free Software Foundation; either version 2 of the License, or (at your option) 
010:         * any later version.
011:         *
012:         * This program is distributed in the hope that it will be useful, 
013:         * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
014:         * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
015:         * for more details.
016:         * 
017:         * You should have received a copy of the GNU General Public License along with 
018:         * this program; if not, write to the Free Software Foundation, Inc., 
019:         * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020:         *
021:         *
022:         * $Id$
023:         */
024:        package com.bostechcorp.cbesb.ui.ide.classpath;
025:
026:        import java.io.File;
027:        import java.io.FileFilter;
028:        import java.util.ArrayList;
029:
030:        import org.eclipse.core.runtime.IPath;
031:        import org.eclipse.core.runtime.Path;
032:        import org.eclipse.jdt.core.IClasspathContainer;
033:        import org.eclipse.jdt.core.IClasspathEntry;
034:        import org.eclipse.jdt.core.JavaCore;
035:        import org.eclipse.ui.plugin.AbstractUIPlugin;
036:
037:        import com.bostechcorp.cbesb.common.util.EsbPathHelper;
038:        import com.bostechcorp.cbesb.ui.ide.Activator;
039:
040:        public abstract class AbstractClasspathContainer implements 
041:                IClasspathContainer {
042:            /** Description of the Field */
043:            protected IClasspathEntry[] entries;
044:
045:            /** Description of the Field */
046:            protected IPath path;
047:
048:            /**
049:             *Constructor for the AbstractClasspathContainer object
050:             *
051:             * @param path  Description of the Parameter
052:             */
053:            public AbstractClasspathContainer(IPath path) {
054:                this .path = path;
055:            }
056:
057:            /**
058:             * Gets the classpathEntries attribute of the AbstractClasspathContainer object
059:             *
060:             * @return   The classpathEntries value
061:             */
062:            public IClasspathEntry[] getClasspathEntries() {
063:                if (entries == null) {
064:                    entries = computeEntries();
065:                }
066:                return entries;
067:            }
068:
069:            /**
070:             * Gets the description attribute of the AbstractClasspathContainer object
071:             *
072:             * @return   The description value
073:             */
074:            public abstract String getDescription();
075:
076:            /**
077:             * Gets the kind attribute of the AbstractClasspathContainer object
078:             *
079:             * @return   The kind value
080:             */
081:            public int getKind() {
082:                return IClasspathContainer.K_APPLICATION;
083:            }
084:
085:            /**
086:             * Gets the path attribute of the AbstractClasspathContainer object
087:             *
088:             * @return   The path value
089:             */
090:            public IPath getPath() {
091:                return this .path;
092:            }
093:
094:            /**
095:             * Description of the Method
096:             *
097:             * @return   Description of the Return Value
098:             */
099:            protected IClasspathEntry[] computeEntries() {
100:                ArrayList entries = new ArrayList();
101:
102:                String libPath = "";
103:                String libSrcPath = "";
104:
105:                String home = EsbPathHelper.getCbesbHomeDir();
106:                if (home != null) {
107:                    libPath = home + "/" + ClassPathConstants.LIB_FOLDER + "/"
108:                            + getLibFolder();
109:                    libSrcPath = home + "/"
110:                            + ClassPathConstants.LIB_SOURCE_FOLDER + "/"
111:                            + getLibFolder();
112:
113:                } else {
114:                    String baseDir = Activator.getDefault().getBaseDir();
115:                    libPath = baseDir + "/lib/" + getLibFolder();
116:                    libSrcPath = home + "/libsrc/" + getLibFolder();
117:
118:                }
119:
120:                File libDir = new File(libPath);//$NON-NLS-1$ //$NON-NLS-2$
121:                File libSrcDir = new File(libSrcPath);//$NON-NLS-1$ //$NON-NLS-2$
122:
123:                // Lists every modules in the lib dir
124:                File[] jars = libDir.listFiles(new FileFilter() {
125:                    public boolean accept(File file) {
126:                        return (file.toString().endsWith(".jar"));//$NON-NLS-1$
127:                    }
128:                });
129:
130:                if (jars != null) {
131:                    for (int i = 0; i < jars.length; i++) {
132:                        File jarFile = jars[i];
133:                        String jarFileName = jarFile.getName();
134:                        File jarSrcFile = new File(libSrcDir, jarFileName);
135:
136:                        IPath entryPath = new Path(jarFile.toString());
137:
138:                        IPath sourceAttachementPath = null;
139:                        IPath sourceAttachementRootPath = null;
140:
141:                        if (jarSrcFile.exists()) {
142:                            sourceAttachementPath = new Path(jarSrcFile
143:                                    .toString());
144:                            sourceAttachementRootPath = new Path("/");//$NON-NLS-1$
145:                        }
146:
147:                        IClasspathEntry entry = JavaCore.newLibraryEntry(
148:                                entryPath, sourceAttachementPath,
149:                                sourceAttachementRootPath, true);
150:                        entries.add(entry);
151:                    }
152:                }
153:
154:                return (IClasspathEntry[]) entries
155:                        .toArray(new IClasspathEntry[entries.size()]);
156:            }
157:
158:            /**
159:             * Gets the libFolder attribute of the AbstractClasspathContainer object
160:             *
161:             * @return   The libFolder value
162:             */
163:            protected abstract String getLibFolder();
164:
165:            /**
166:             * Gets the plugin attribute of the AbstractClasspathContainer object
167:             *
168:             * @return   The plugin value
169:             */
170:            protected abstract AbstractUIPlugin getPlugin();
171:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.