Source Code Cross Referenced for AssemblyInformation.java in  » IDE-Eclipse » Eclipse-plug-in-development » org » eclipse » pde » internal » build » 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 » IDE Eclipse » Eclipse plug in development » org.eclipse.pde.internal.build 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2006 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         * 
008:         * Contributors:
009:         *     IBM - Initial API and implementation
010:         *******************************************************************************/package org.eclipse.pde.internal.build;
011:
012:        import java.util.*;
013:        import org.eclipse.osgi.service.resolver.BundleDescription;
014:        import org.eclipse.pde.internal.build.site.BuildTimeFeature;
015:        import org.eclipse.update.core.IFeature;
016:
017:        public class AssemblyInformation implements  IPDEBuildConstants {
018:            // List all the features and plugins to assemble sorted on a per config basis 
019:            //	key: string[] representing the tuple of a config 
020:            // value: (AssemblyLevelConfigInfo) representing the info for the given config
021:            private Map assembleInformation = new HashMap(8);
022:
023:            public AssemblyInformation() {
024:                // Initialize the content of the assembly information with the configurations 
025:                for (Iterator iter = AbstractScriptGenerator.getConfigInfos()
026:                        .iterator(); iter.hasNext();) {
027:                    assembleInformation.put(iter.next(),
028:                            new AssemblyLevelConfigInfo());
029:                }
030:            }
031:
032:            public void addFeature(Config config, IFeature feature) {
033:                AssemblyLevelConfigInfo entry = (AssemblyLevelConfigInfo) assembleInformation
034:                        .get(config);
035:                entry.addFeature(feature);
036:            }
037:
038:            public void removeFeature(Config config, IFeature feature) {
039:                AssemblyLevelConfigInfo entry = (AssemblyLevelConfigInfo) assembleInformation
040:                        .get(config);
041:                entry.removeFeature(feature);
042:            }
043:
044:            public void addPlugin(Config config, BundleDescription plugin) {
045:                AssemblyLevelConfigInfo entry = (AssemblyLevelConfigInfo) assembleInformation
046:                        .get(config);
047:                entry.addPlugin(plugin);
048:            }
049:
050:            public Collection getPlugins(Config config) {
051:                return ((AssemblyLevelConfigInfo) assembleInformation
052:                        .get(config)).getPlugins();
053:            }
054:
055:            public Collection getBinaryPlugins(Config config) {
056:                Collection allPlugins = getPlugins(config);
057:                Set result = new HashSet(allPlugins.size());
058:                for (Iterator iter = allPlugins.iterator(); iter.hasNext();) {
059:                    BundleDescription bundle = (BundleDescription) iter.next();
060:                    Properties bundleProperties = ((Properties) bundle
061:                            .getUserObject());
062:                    if (bundleProperties == null
063:                            || bundleProperties.get(IS_COMPILED) == null
064:                            || Boolean.FALSE == bundleProperties
065:                                    .get(IS_COMPILED))
066:                        result.add(bundle);
067:                }
068:                return result;
069:            }
070:
071:            public Collection getCompiledPlugins(Config config) {
072:                Collection allPlugins = getPlugins(config);
073:                Set result = new HashSet(allPlugins.size());
074:                for (Iterator iter = allPlugins.iterator(); iter.hasNext();) {
075:                    BundleDescription bundle = (BundleDescription) iter.next();
076:                    Properties bundleProperties = ((Properties) bundle
077:                            .getUserObject());
078:                    if (bundleProperties != null
079:                            && Boolean.TRUE == bundleProperties
080:                                    .get(IS_COMPILED))
081:                        result.add(bundle);
082:                }
083:                return result;
084:            }
085:
086:            public Collection getAllCompiledPlugins() {
087:                Collection pluginsByConfig = assembleInformation.values();
088:                Set result = new HashSet();
089:                for (Iterator iter2 = pluginsByConfig.iterator(); iter2
090:                        .hasNext();) {
091:                    Collection allPlugins = ((AssemblyLevelConfigInfo) iter2
092:                            .next()).getPlugins();
093:                    for (Iterator iter = allPlugins.iterator(); iter.hasNext();) {
094:                        BundleDescription bundle = (BundleDescription) iter
095:                                .next();
096:                        if (!Utils.isBinary(bundle)) {
097:                            result.add(bundle);
098:                        }
099:                    }
100:                }
101:                return result;
102:            }
103:
104:            public Collection getCompiledFeatures(Config config) {
105:                Collection allFeatures = getFeatures(config);
106:                ArrayList result = new ArrayList(allFeatures.size());
107:                for (Iterator iter = allFeatures.iterator(); iter.hasNext();) {
108:                    Object tmp = iter.next();
109:                    if (tmp instanceof  BuildTimeFeature) {
110:                        if (!((BuildTimeFeature) tmp).isBinary())
111:                            result.add(tmp);
112:                    }
113:                }
114:                return result;
115:            }
116:
117:            public Collection getBinaryFeatures(Config config) {
118:                Collection allFeatures = getFeatures(config);
119:                ArrayList result = new ArrayList(allFeatures.size());
120:                for (Iterator iter = allFeatures.iterator(); iter.hasNext();) {
121:                    Object tmp = iter.next();
122:                    if (tmp instanceof  BuildTimeFeature) {
123:                        if (((BuildTimeFeature) tmp).isBinary())
124:                            result.add(tmp);
125:                    } else {
126:                        result.add(tmp);
127:                    }
128:                }
129:                return result;
130:            }
131:
132:            public ArrayList getFeatures(Config config) {
133:                return ((AssemblyLevelConfigInfo) assembleInformation
134:                        .get(config)).getFeatures();
135:            }
136:
137:            public boolean copyRootFile(Config config) {
138:                return ((AssemblyLevelConfigInfo) assembleInformation
139:                        .get(config)).hasRootFile();
140:            }
141:
142:            public Collection getRootFileProviders(Config config) {
143:                return ((AssemblyLevelConfigInfo) assembleInformation
144:                        .get(config)).getRootFileProvider();
145:            }
146:
147:            public void addRootFileProvider(Config config, IFeature feature) {
148:                ((AssemblyLevelConfigInfo) assembleInformation.get(config))
149:                        .addRootFileProvider(feature);
150:            }
151:
152:            // All the information that will go into the assemble file for a specific info
153:            private class AssemblyLevelConfigInfo {
154:                // the plugins that are contained into this config
155:                private Collection plugins = new HashSet(20);
156:                // the features that are contained into this config
157:                private ArrayList features = new ArrayList(7);
158:                // indicate whether root files needs to be copied and where they are coming from
159:                private LinkedList rootFileProviders = new LinkedList();
160:
161:                public void addRootFileProvider(IFeature feature) {
162:                    if (rootFileProviders.contains(feature))
163:                        return;
164:                    for (Iterator iter = rootFileProviders.iterator(); iter
165:                            .hasNext();) {
166:                        BuildTimeFeature featureDescriptor = (BuildTimeFeature) iter
167:                                .next();
168:                        if (feature == featureDescriptor)
169:                            return;
170:                        if (((BuildTimeFeature) feature).getFeatureIdentifier()
171:                                .equals(
172:                                        featureDescriptor
173:                                                .getFeatureIdentifier())
174:                                && ((BuildTimeFeature) feature)
175:                                        .getFeatureVersion().equals(
176:                                                featureDescriptor
177:                                                        .getFeatureVersion()))
178:                            return;
179:                    }
180:                    rootFileProviders.add(feature);
181:                }
182:
183:                public Collection getRootFileProvider() {
184:                    return rootFileProviders;
185:                }
186:
187:                public boolean hasRootFile() {
188:                    return rootFileProviders.size() > 0;
189:                }
190:
191:                public ArrayList getFeatures() {
192:                    return features;
193:                }
194:
195:                public Collection getPlugins() {
196:                    return plugins;
197:                }
198:
199:                public void addFeature(IFeature feature) {
200:                    for (Iterator iter = features.iterator(); iter.hasNext();) {
201:                        BuildTimeFeature featureDescriptor = (BuildTimeFeature) iter
202:                                .next();
203:                        if (((BuildTimeFeature) feature).getFeatureIdentifier()
204:                                .equals(
205:                                        featureDescriptor
206:                                                .getFeatureIdentifier())
207:                                && ((BuildTimeFeature) feature)
208:                                        .getFeatureVersion().equals(
209:                                                featureDescriptor
210:                                                        .getFeatureVersion()))
211:                            return;
212:                    }
213:                    features.add(feature);
214:                }
215:
216:                public void addPlugin(BundleDescription plugin) {
217:                    plugins.add(plugin);
218:                }
219:
220:                public void removeFeature(IFeature feature) {
221:                    for (Iterator iter = features.iterator(); iter.hasNext();) {
222:                        BuildTimeFeature featureDescriptor = (BuildTimeFeature) iter
223:                                .next();
224:                        if (((BuildTimeFeature) feature).getFeatureIdentifier()
225:                                .equals(
226:                                        featureDescriptor
227:                                                .getFeatureIdentifier())
228:                                && ((BuildTimeFeature) feature)
229:                                        .getFeatureVersion().equals(
230:                                                featureDescriptor
231:                                                        .getFeatureVersion())) {
232:                            features.remove(featureDescriptor);
233:                            return;
234:                        }
235:                    }
236:                }
237:            }
238:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.