Anonymous avatar Anonymous committed a7a0fa5

Very basic support for eclipse (platform) projects in NetBeans

Comments (0)

Files changed (47)

+\.orig$
+\.orig\..*$
+\.chg\..*$
+\.rej$
+\.conflict\~$
+build/
+nbproject/private/
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
+<!-- for some information on what you could do (e.g. targets to override). -->
+<!-- If you delete this file and reopen the project it will be recreated. -->
+<project name="nb4eclipse" basedir=".">
+    <description>Builds the module suite nb4eclipse.</description>
+    <import file="nbproject/build-impl.xml"/>
+</project>

nbproject/build-impl.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+-->
+<project name="nb4eclipse-impl" basedir=".." xmlns:sproject="http://www.netbeans.org/ns/nb-module-suite-project/1">
+    <fail message="Please build using Ant 1.7.1 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.7.1"/>
+            </not>
+        </condition>
+    </fail>
+    <property file="nbproject/private/platform-private.properties"/>
+    <property file="nbproject/platform.properties"/>
+    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
+        <attribute name="name"/>
+        <attribute name="value"/>
+        <sequential>
+            <property name="@{name}" value="${@{value}}"/>
+        </sequential>
+    </macrodef>
+    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-suite-project/1">
+        <attribute name="property"/>
+        <attribute name="value"/>
+        <sequential>
+            <property name="@{property}" value="@{value}"/>
+        </sequential>
+    </macrodef>
+    <property file="${user.properties.file}"/>
+    <sproject:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir"/>
+    <sproject:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir"/>
+    <sproject:evalprops property="cluster.path.evaluated" value="${cluster.path}"/>
+    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
+        <condition>
+            <not>
+                <contains string="${cluster.path.evaluated}" substring="platform"/>
+            </not>
+        </condition>
+    </fail>
+    <ant antfile="nbproject/platform.xml"/>
+    <fail message="Cannot find NetBeans build harness. ${line.separator}Check that nbplatform.${nbplatform.active}.netbeans.dest.dir and nbplatform.${nbplatform.active}.harness.dir are defined. ${line.separator}On a developer machine these are normally defined in ${user.properties.file}=${netbeans.user}/build.properties ${line.separator}but for automated builds you should pass these properties to Ant explicitly. ${line.separator}You may instead download the harness and platform: -Dbootstrap.url=.../tasks.jar -Dautoupdate.catalog.url=.../updates.xml">
+        <condition>
+            <not>
+                <available file="${harness.dir}/suite.xml"/>
+            </not>
+        </condition>
+    </fail>
+    <import file="${harness.dir}/suite.xml"/>
+</project>

nbproject/genfiles.properties

+build.xml.data.CRC32=2fcb88e3
+build.xml.script.CRC32=38082797
+build.xml.stylesheet.CRC32=eaf9f76a@2.47
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=2fcb88e3
+nbproject/build-impl.xml.script.CRC32=6002d4ac
+nbproject/build-impl.xml.stylesheet.CRC32=0f381476@2.47
+nbproject/platform.xml.data.CRC32=2fcb88e3
+nbproject/platform.xml.script.CRC32=db9e1f43
+nbproject/platform.xml.stylesheet.CRC32=df8ac4dd@2.47

nbproject/platform.properties

+cluster.path=\
+    ${nbplatform.active.dir}/nb:\
+    ${nbplatform.active.dir}/enterprise:\
+    ${nbplatform.active.dir}/ide:\
+    ${nbplatform.active.dir}/java:\
+    ${nbplatform.active.dir}/dlight:\
+    ${nbplatform.active.dir}/websvccommon:\
+    ${nbplatform.active.dir}/apisupport:\
+    ${nbplatform.active.dir}/profiler:\
+    ${nbplatform.active.dir}/platform:\
+    ${nbplatform.active.dir}/cnd:\
+    ${nbplatform.active.dir}/harness
+nbplatform.active=default

nbproject/platform.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<project name="platform" default="download" basedir="..">
+    <condition property="download.required">
+        <and>
+            <not>
+                <available file="${harness.dir}/suite.xml"/>
+            </not>
+            <isset property="bootstrap.url"/>
+            <isset property="autoupdate.catalog.url"/>
+        </and>
+    </condition>
+    <target name="download" if="download.required">
+        <mkdir dir="${harness.dir}"/>
+        <pathconvert pathsep="|" property="download.clusters">
+            <mapper type="flatten"/>
+            <path path="${cluster.path}"/>
+        </pathconvert>
+        <property name="disabled.modules" value=""/>
+        <pathconvert property="module.includes" pathsep="">
+            <mapper type="glob" from="${basedir}${file.separator}*" to="(?!\Q*\E)"/>
+            <path>
+                <filelist files="${disabled.modules}" dir="."/>
+            </path>
+        </pathconvert>
+        <echo message="Downloading clusters ${download.clusters}"/>
+        <property name="tasks.jar" location="${java.io.tmpdir}/tasks.jar"/>
+        <get src="${bootstrap.url}" dest="${tasks.jar}" usetimestamp="true" verbose="true"/>
+        <taskdef name="autoupdate" classname="org.netbeans.nbbuild.AutoUpdate" classpath="${tasks.jar}"/>
+        <autoupdate installdir="${nbplatform.active.dir}" updatecenter="${autoupdate.catalog.url}">
+            <modules includes="${module.includes}.*" clusters="${download.clusters}"/>
+            <modules includes="org[.]netbeans[.]modules[.]apisupport[.]harness" clusters="harness"/>
+        </autoupdate>
+    </target>
+</project>

nbproject/project.properties

+modules=\
+    ${project.org.netbeans.modules.eclipse.project}
+project.org.netbeans.modules.eclipse.project=project

nbproject/project.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.apisupport.project.suite</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/nb-module-suite-project/1">
+            <name>nb4eclipse</name>
+        </data>
+    </configuration>
+</project>

project/build.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
+<!-- for some information on what you could do (e.g. targets to override). -->
+<!-- If you delete this file and reopen the project it will be recreated. -->
+<project name="org.netbeans.modules.eclipse.project" default="netbeans" basedir=".">
+    <description>Builds, tests, and runs the project org.netbeans.modules.eclipse.project.</description>
+    <import file="nbproject/build-impl.xml"/>
+</project>

project/manifest.mf

+Manifest-Version: 1.0
+OpenIDE-Module: org.netbeans.modules.eclipse.project
+OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/eclipse/project/Bundle.properties
+OpenIDE-Module-Specification-Version: 1.0
+

project/nbproject/build-impl.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+-->
+<project name="org.netbeans.modules.eclipse.project-impl" basedir="..">
+    <fail message="Please build using Ant 1.7.1 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.7.1"/>
+            </not>
+        </condition>
+    </fail>
+    <property file="nbproject/private/suite-private.properties"/>
+    <property file="nbproject/suite.properties"/>
+    <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
+    <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
+    <property file="${suite.dir}/nbproject/platform.properties"/>
+    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
+        <attribute name="name"/>
+        <attribute name="value"/>
+        <sequential>
+            <property name="@{name}" value="${@{value}}"/>
+        </sequential>
+    </macrodef>
+    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
+        <attribute name="property"/>
+        <attribute name="value"/>
+        <sequential>
+            <property name="@{property}" value="@{value}"/>
+        </sequential>
+    </macrodef>
+    <property file="${user.properties.file}"/>
+    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
+    <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
+    <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
+    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
+        <condition>
+            <not>
+                <contains string="${cluster.path.evaluated}" substring="platform"/>
+            </not>
+        </condition>
+    </fail>
+    <import file="${harness.dir}/build.xml"/>
+</project>

project/nbproject/genfiles.properties

+build.xml.data.CRC32=f1a6e976
+build.xml.script.CRC32=eec96eb6
+build.xml.stylesheet.CRC32=a56c6a5b@2.47
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=f1a6e976
+nbproject/build-impl.xml.script.CRC32=9c0b9652
+nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.47

project/nbproject/project.properties

+javac.source=1.6
+javac.compilerargs=-Xlint -Xlint:-serial

project/nbproject/project.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.apisupport.project</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
+            <code-name-base>org.netbeans.modules.eclipse.project</code-name-base>
+            <suite-component/>
+            <module-dependencies>
+                <dependency>
+                    <code-name-base>org.netbeans.api.annotations.common</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.11</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.api.java.classpath</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.31</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.java.platform</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.23</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.java.project</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.42</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.options.api</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.24</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.project.ant</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.44</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.projectapi</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.39</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.projectuiapi</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.53.0.8</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.awt</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>7.39</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.filesystems</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>7.53</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.loaders</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>7.32</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.nodes</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>7.25</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.util</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>8.19</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.util.lookup</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>8.11</specification-version>
+                    </run-dependency>
+                </dependency>
+            </module-dependencies>
+            <public-packages/>
+        </data>
+    </configuration>
+</project>

project/nbproject/suite.properties

+suite.dir=${basedir}/..

project/release/scripts/debug-eclipse-rcp-application.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+
+Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+Other names may be trademarks of their respective owners.
+
+
+The contents of this file are subject to the terms of either the GNU
+General Public License Version 2 only ("GPL") or the Common
+Development and Distribution License("CDDL") (collectively, the
+"License"). You may not use this file except in compliance with the
+License. You can obtain a copy of the License at
+http://www.netbeans.org/cddl-gplv2.html
+or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+specific language governing permissions and limitations under the
+License.  When distributing the software, include this License Header
+Notice in each file and include the License file at
+nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the GPL Version 2 section of the License file that
+accompanied this code. If applicable, add the following below the
+License Header, with the fields enclosed by brackets [] replaced by
+your own identifying information:
+"Portions Copyrighted [year] [name of copyright owner]"
+
+Contributor(s):
+
+The Original Software is NetBeans. The Initial Developer of the Original
+Software is Sun Microsystems, Inc. Portions Copyright 2008 Sun
+Microsystems, Inc. All Rights Reserved.
+
+If you wish your version of this file to be governed by only the CDDL
+or only the GPL Version 2, indicate your decision by adding
+"[Contributor] elects to include this software in this distribution
+under the [CDDL or GPL Version 2] license." If you do not indicate a
+single choice of license, a recipient has the option to distribute
+your version of this file under either the CDDL, the GPL Version 2 or
+to extend the choice of license to its licensees as provided above.
+However, if you add GPL Version 2 code and therefore, elected the GPL
+Version 2 license, then the option applies only if the new code is
+made subject to such option by the copyright holder.
+-->
+<project name="{0} (debug)" default="debug" basedir=".">
+    <target name="-init-debug-args">
+        <property name="version-output" value="java version &quot;${ant.java.version}"/>
+        <condition property="have-jdk-older-than-1.4">
+            <or>
+                <contains string="${version-output}" substring="java version &quot;1.0"/>
+                <contains string="${version-output}" substring="java version &quot;1.1"/>
+                <contains string="${version-output}" substring="java version &quot;1.2"/>
+                <contains string="${version-output}" substring="java version &quot;1.3"/>
+            </or>
+        </condition>
+        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+            <istrue value="${have-jdk-older-than-1.4}"/>
+        </condition>
+        <condition property="debug-transport-by-os" value="dt_shmem" else="dt_socket">
+            <os family="windows"/>
+        </condition>
+        <condition property="debug-transport" value="${debug.transport}" else="${debug-transport-by-os}">
+            <isset property="debug.transport"/>
+        </condition>
+    </target>
+
+    <target name="debug" depends="-init-debug-args">
+        <translate-classpath classpath="${classpath}" targetProperty="classpath-translated" />
+        <property name="run.jvmargs" value="" />
+        <property name="work.dir" value="${basedir}"/>
+        <property name="application.args" value="" />
+        <property name="stopclassname" value="" />
+        <nbjpdastart addressproperty="jpda.address" name="${classname}" transport="${debug-transport}" listeningcp="${classpath}" stopclassname="${stopclassname}">
+            <classpath>
+                <path path="${classpath-translated}"/>
+            </classpath>
+            <bootclasspath>
+                <path path="${platform.bootcp}"/>
+            </bootclasspath>
+        </nbjpdastart>
+        <java classpath="${classpath-translated}" classname="${classname}" dir="${work.dir}" jvm="${platform.java}" fork="true">
+            <jvmarg line="${debug-args-line}"/>
+            <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+            <jvmarg value="-Dfile.encoding=${encoding}"/>
+            <redirector inputencoding="${encoding}" outputencoding="${encoding}" errorencoding="${encoding}"/>
+            <jvmarg line="${run.jvmargs}" />
+            <arg line="${application.args}" />
+            <syspropertyset>
+                <propertyref prefix="run-sys-prop."/>
+                <mapper from="run-sys-prop.*" to="*" type="glob"/>
+            </syspropertyset>
+        </java>
+    </target>
+</project>

project/release/scripts/run-eclipse-rcp-application.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+
+Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+Other names may be trademarks of their respective owners.
+
+
+The contents of this file are subject to the terms of either the GNU
+General Public License Version 2 only ("GPL") or the Common
+Development and Distribution License("CDDL") (collectively, the
+"License"). You may not use this file except in compliance with the
+License. You can obtain a copy of the License at
+http://www.netbeans.org/cddl-gplv2.html
+or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+specific language governing permissions and limitations under the
+License.  When distributing the software, include this License Header
+Notice in each file and include the License file at
+nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the GPL Version 2 section of the License file that
+accompanied this code. If applicable, add the following below the
+License Header, with the fields enclosed by brackets [] replaced by
+your own identifying information:
+"Portions Copyrighted [year] [name of copyright owner]"
+
+Contributor(s):
+
+The Original Software is NetBeans. The Initial Developer of the Original
+Software is Sun Microsystems, Inc. Portions Copyright 2008 Sun
+Microsystems, Inc. All Rights Reserved.
+
+If you wish your version of this file to be governed by only the CDDL
+or only the GPL Version 2, indicate your decision by adding
+"[Contributor] elects to include this software in this distribution
+under the [CDDL or GPL Version 2] license." If you do not indicate a
+single choice of license, a recipient has the option to distribute
+your version of this file under either the CDDL, the GPL Version 2 or
+to extend the choice of license to its licensees as provided above.
+However, if you add GPL Version 2 code and therefore, elected the GPL
+Version 2 license, then the option applies only if the new code is
+made subject to such option by the copyright holder.
+-->
+<project name="{0} (run)" default="run" basedir=".">
+    <target name="run">        
+        <translate-classpath classpath="${classpath}" targetProperty="classpath-translated" />
+        <property name="run.jvmargs" value="" />
+        <property name="work.dir" value="${basedir}"/>
+        <property name="application.args" value="" />
+        <java classpath="${classpath-translated}" classname="${classname}" dir="${work.dir}" jvm="${platform.java}" fork="true">
+            <jvmarg value="-Dfile.encoding=${encoding}"/>
+            <redirector inputencoding="${encoding}" outputencoding="${encoding}" errorencoding="${encoding}"/>
+            <jvmarg line="${run.jvmargs}" />
+            <arg line="${application.args}" />
+            <syspropertyset>
+                <propertyref prefix="run-sys-prop."/>
+                <mapper from="run-sys-prop.*" to="*" type="glob"/>
+            </syspropertyset>
+        </java>
+    </target>
+</project>
+/usr/lib/jvm/java-6-openjdk/bin/java -Xms40m -Xmx384m -Declipse.pde.launch=true -Dfile.encoding=UTF-8 -classpath /usr/local/home/lahvac/eclipse/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar org.eclipse.equinox.launcher.Main -launcher /usr/local/home/lahvac/eclipse/eclipse -name Eclipse -showsplash 600 -product org.eclipse.sdk.ide -data /media/karta/space/src/jackpot30/eclipse/../runtime-EclipseApplication -configuration file:/media/karta/space/src/jackpot30/eclipse/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/ -dev file:/media/karta/space/src/jackpot30/eclipse/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os linux -ws gtk -arch x86_64 -nl en_US -consoleLog

project/src/org/netbeans/modules/eclipse/project/Bundle.properties

+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+#
+# Copyright 1997-2011 Oracle and/or its affiliates. All rights reserved.
+#
+# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+# Other names may be trademarks of their respective owners.
+#
+# The contents of this file are subject to the terms of either the GNU
+# General Public License Version 2 only ("GPL") or the Common
+# Development and Distribution License("CDDL") (collectively, the
+# "License"). You may not use this file except in compliance with the
+# License. You can obtain a copy of the License at
+# http://www.netbeans.org/cddl-gplv2.html
+# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+# specific language governing permissions and limitations under the
+# License.  When distributing the software, include this License Header
+# Notice in each file and include the License file at
+# nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the GPL Version 2 section of the License file that
+# accompanied this code. If applicable, add the following below the
+# License Header, with the fields enclosed by brackets [] replaced by
+# your own identifying information:
+# "Portions Copyrighted [year] [name of copyright owner]"
+#
+# Contributor(s):
+#
+# The Original Software is NetBeans. The Initial Developer of the Original
+# Software is Sun Microsystems, Inc. Portions Copyright 1997-2011 Sun
+# Microsystems, Inc. All Rights Reserved.
+#
+# If you wish your version of this file to be governed by only the CDDL
+# or only the GPL Version 2, indicate your decision by adding
+# "[Contributor] elects to include this software in this distribution
+# under the [CDDL or GPL Version 2] license." If you do not indicate a
+# single choice of license, a recipient has the option to distribute
+# your version of this file under either the CDDL, the GPL Version 2 or
+# to extend the choice of license to its licensees as provided above.
+# However, if you add GPL Version 2 code and therefore, elected the GPL
+# Version 2 license, then the option applies only if the new code is
+# made subject to such option by the copyright holder.
+#
+OpenIDE-Module-Name=Eclipse Projects for NetBeans

project/src/org/netbeans/modules/eclipse/project/EclipsePlatform.java

+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2011 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * The Original Software is NetBeans. The Initial Developer of the Original
+ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2011 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ */
+package org.netbeans.modules.eclipse.project;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.jar.Manifest;
+import java.util.prefs.PreferenceChangeEvent;
+import java.util.prefs.PreferenceChangeListener;
+import javax.swing.event.ChangeListener;
+import org.netbeans.api.java.queries.SourceForBinaryQuery;
+import org.netbeans.spi.java.queries.SourceForBinaryQueryImplementation;
+import org.netbeans.spi.java.queries.SourceForBinaryQueryImplementation2;
+import org.netbeans.spi.java.queries.SourceForBinaryQueryImplementation2.Result;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileStateInvalidException;
+import org.openide.filesystems.FileUtil;
+import org.openide.filesystems.URLMapper;
+import org.openide.util.Exceptions;
+import org.openide.util.NbPreferences;
+import org.openide.util.lookup.ServiceProvider;
+
+/**
+ *
+ * @author lahvac
+ */
+public class EclipsePlatform {
+
+    public static final String KEY_DEFAULT_PLATFORM_LOCATION = "default-eclipse-platform";
+    private static Property<EclipsePlatform> INSTANCE;
+
+    public static synchronized Property<EclipsePlatform> getDefault() {
+        if (INSTANCE == null) {
+            INSTANCE = new Property<EclipsePlatform>();
+            NbPreferences.forModule(EclipsePlatform.class).addPreferenceChangeListener(new PreferenceChangeListener() {
+                @Override public void preferenceChange(PreferenceChangeEvent evt) {
+                    if (KEY_DEFAULT_PLATFORM_LOCATION.equals(evt.getKey())) {
+                        defaultPlatformUpdated();
+                    }
+                }
+            });
+            defaultPlatformUpdated();
+        }
+        return INSTANCE;
+    }
+
+    private static synchronized void defaultPlatformUpdated() {
+        String location = NbPreferences.forModule(EclipsePlatform.class).get(KEY_DEFAULT_PLATFORM_LOCATION, "");
+        File locationFile = !location.isEmpty() ? new File(location) : null;
+
+        if (locationFile != null && locationFile.isDirectory()) {
+            INSTANCE.setValue(new EclipsePlatform(locationFile));
+        } else {
+            INSTANCE.setValue(null);
+        }
+    }
+
+    private final FileObject platformRoot;
+    private final Map<String, Collection<URL>> bundleName2BundleJars;
+    private final Map<String, URL> exportedPackage2BundleJars;
+    private final Map<URL, Result> binary2SourceResult;
+
+    private EclipsePlatform(File locationFile) {
+        platformRoot = FileUtil.toFileObject(locationFile);
+        bundleName2BundleJars = new HashMap<String, Collection<URL>>();
+        exportedPackage2BundleJars = new HashMap<String, URL>();
+        binary2SourceResult = new HashMap<URL, Result>();
+
+        FileObject plugins = platformRoot.getFileObject("plugins");
+
+        if (plugins != null) {
+            for (FileObject c : plugins.getChildren()) {
+                URL cURL;
+
+                try {
+                    cURL = c.getURL();
+                } catch (FileStateInvalidException ex) {
+                    Exceptions.printStackTrace(ex);
+                    continue;
+                }
+
+                Manifest m = readManifest(c);
+
+                if (m == null) {
+                    continue;
+                }
+
+                if (FileUtil.isArchiveFile(cURL)) {
+                    cURL = FileUtil.getArchiveRoot(cURL);
+                }
+
+                String exported = m.getMainAttributes().getValue("Export-Package");
+
+                if (exported != null) {
+                    for (String p : exported.split(",")) {
+                        p = p.trim();
+
+                        int semicolon = p.indexOf(";");
+                        if (semicolon != (-1)) {
+                            p = p.substring(0, semicolon);
+                        }
+
+                        exportedPackage2BundleJars.put(p, cURL);
+                    }
+                }
+
+                String bundleSymbolicName = m.getMainAttributes().getValue("Bundle-SymbolicName");
+
+                if (bundleSymbolicName != null) {
+                    addBundle(bundleSymbolicName, cURL);
+                }
+
+                String fragmentHost = m.getMainAttributes().getValue("Fragment-Host");
+
+                if (fragmentHost != null) {
+                    addBundle(fragmentHost, cURL);
+                }
+
+                String plugin = c.getNameExt();
+                String sourcePluginName = plugin.replaceFirst("_", ".source_");
+
+                FileObject sourcePlugin = c.getParent().getFileObject(sourcePluginName);
+
+                if (sourcePlugin != null) {
+                    if (FileUtil.isArchiveFile(sourcePlugin)) sourcePlugin = FileUtil.getArchiveRoot(sourcePlugin);
+                    if (FileUtil.isArchiveFile(c)) c = FileUtil.getArchiveRoot(c);
+                    try {
+                        binary2SourceResult.put(c.getURL(), new SFBQIResult(sourcePlugin));
+                    } catch (FileStateInvalidException ex) {
+                        Exceptions.printStackTrace(ex);
+                    }
+                }
+            }
+        }
+
+    }
+
+    private void addBundle(String name, URL url) {
+        int semicolon = name.indexOf(";");
+
+        if (semicolon != (-1)) {
+            name = name.substring(0, semicolon);
+        }
+
+        Collection<URL> jars = bundleName2BundleJars.get(name);
+
+        if (jars == null) {
+            bundleName2BundleJars.put(name, jars = new ArrayList<URL>());
+        }
+
+        jars.add(url);
+    }
+
+    public Collection<? extends URL> findBundleJarsForBundleSymbolicName(String id) {
+        return bundleName2BundleJars.get(id);
+    }
+
+    public URL findBundleForExportedPackage(String pack) {
+        return exportedPackage2BundleJars.get(pack);
+    }
+
+    public Collection<URL> dependencies(FileObject bundle) throws IOException {
+        return dependencies(bundle, new HashSet<FileObject>());
+    }
+
+    private Collection<URL> dependencies(FileObject bundle, Set<FileObject> seen) throws IOException {
+        if (!seen.add(bundle)) return Collections.emptyList();//cycle protection
+
+        Manifest man = readManifest(bundle);
+
+        if (man == null) return Collections.emptyList();
+
+        List<URL> deps = new ArrayList<URL>();
+        String value = man.getMainAttributes().getValue("Require-Bundle");
+        
+        if (value != null) {
+            for (String dep : value.split(",")) {
+                String originalDependency = dep;
+                dep = dep.trim();
+                if (dep.isEmpty()) continue;
+                int semicolon = dep.indexOf(";");
+                if (semicolon != (-1)) dep = dep.substring(0, semicolon);
+                Collection<? extends URL> depURLs = findBundleJarsForBundleSymbolicName(dep);
+
+                if (depURLs == null) {
+                    System.err.println("Cannot find dependency: " + dep + ", full original dependency: " + originalDependency);
+                    continue;
+                }
+
+
+                deps.addAll(depURLs);
+
+                for (URL depURL : depURLs) {
+                    FileObject fo = URLMapper.findFileObject(depURL);
+
+                    if (fo != null) {
+                        deps.addAll(dependencies(fo, seen));
+                    }
+                }
+            }
+        }
+
+        String importedPackage = man.getMainAttributes().getValue("Import-Package");
+
+        if (importedPackage != null) {
+            for (String dep : importedPackage.split(",")) {
+                String originalDependency = dep;
+                dep = dep.trim();
+                if (dep.isEmpty()) continue;
+                int semicolon = dep.indexOf(";");
+                if (semicolon != (-1)) dep = dep.substring(0, semicolon);
+                URL depURL = findBundleForExportedPackage(dep);
+
+                if (depURL == null) {
+                    System.err.println("Cannot find dependency: " + dep + ", full original dependency: " + originalDependency);
+                    continue;
+                }
+
+                deps.add(depURL);
+
+                FileObject fo = URLMapper.findFileObject(depURL);
+
+                if (fo != null) {
+                    deps.addAll(dependencies(fo, seen));
+                }
+            }
+        }
+
+        return deps;
+    }
+
+    private Manifest readManifest(FileObject bundle) {
+        if (FileUtil.isArchiveFile(bundle)) {
+            bundle = FileUtil.getArchiveRoot(bundle);
+        }
+        
+        FileObject manFile = bundle.getFileObject("META-INF/MANIFEST.MF");
+
+        if (manFile == null) {
+            return null;
+        }
+
+        InputStream in = null;
+
+        try {
+            in = manFile.getInputStream();
+            return new Manifest(in);
+        } catch (IOException ex) {
+            Exceptions.printStackTrace(ex);
+            return null;
+        } finally {
+            try {
+                if (in != null)
+                    in.close();
+            } catch (IOException ex) {
+                Exceptions.printStackTrace(ex);
+            }
+        }
+    }
+
+    @ServiceProvider(service=SourceForBinaryQueryImplementation.class)
+    public static final class SourceForBinaryQueryImpl implements SourceForBinaryQueryImplementation2 {
+
+        public SourceForBinaryQueryImpl() {
+        }
+
+        @Override
+        public Result findSourceRoots2(URL binaryRoot) {
+            EclipsePlatform platform = EclipsePlatform.getDefault().getValue();
+
+            if (platform == null) return null;
+            
+            return platform.binary2SourceResult.get(binaryRoot);
+        }
+
+        @Override
+        public SourceForBinaryQuery.Result findSourceRoots(URL binaryRoot) {
+            return findSourceRoots2(binaryRoot);
+        }
+
+    }
+
+    private static final class SFBQIResult implements Result {
+
+        private final FileObject[] sources;
+
+        public SFBQIResult(FileObject... sources) {
+            this.sources = sources;
+        }
+
+        @Override
+        public boolean preferSources() {
+            return false;
+        }
+
+        @Override
+        public FileObject[] getRoots() {
+            return sources;
+        }
+
+        @Override
+        public void addChangeListener(ChangeListener l) {}
+
+        @Override
+        public void removeChangeListener(ChangeListener l) {}
+
+    }
+}

project/src/org/netbeans/modules/eclipse/project/EclipseProjectImpl.java

+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2011 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * The Original Software is NetBeans. The Initial Developer of the Original
+ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2011 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ */
+package org.netbeans.modules.eclipse.project;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import org.netbeans.api.java.classpath.ClassPath;
+import org.netbeans.api.java.classpath.GlobalPathRegistry;
+import org.netbeans.api.java.platform.JavaPlatform;
+import org.netbeans.api.java.project.JavaProjectConstants;
+import org.netbeans.api.java.queries.SourceForBinaryQuery;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ProjectUtils;
+import org.netbeans.api.project.SourceGroup;
+import org.netbeans.api.project.Sources;
+import org.netbeans.modules.eclipse.project.borrowed.ClassPathContainerResolver;
+import org.netbeans.modules.eclipse.project.borrowed.DotClassPathEntry;
+import org.netbeans.modules.eclipse.project.borrowed.EclipseProject;
+import org.netbeans.spi.java.classpath.ClassPathFactory;
+import org.netbeans.spi.java.classpath.ClassPathProvider;
+import org.netbeans.spi.java.classpath.support.ClassPathSupport;
+import org.netbeans.spi.java.project.support.ui.PackageView;
+import org.netbeans.spi.java.queries.SourceForBinaryQueryImplementation2;
+import org.netbeans.spi.java.queries.SourceForBinaryQueryImplementation2.Result;
+import org.netbeans.spi.project.support.GenericSources;
+import org.netbeans.spi.project.ui.LogicalViewProvider;
+import org.netbeans.spi.project.ui.ProjectOpenedHook;
+import org.openide.filesystems.FileObject;
+import org.openide.nodes.AbstractNode;
+import org.openide.nodes.ChildFactory;
+import org.openide.nodes.Children;
+import org.openide.nodes.Node;
+import org.openide.util.Lookup;
+import org.openide.util.WeakListeners;
+import org.openide.util.lookup.Lookups;
+
+/**
+ *
+ * @author lahvac
+ */
+public class EclipseProjectImpl implements Project {
+
+    private final EclipseProject imported;
+    private final FileObject projectDir;
+    private final Lookup lookup;
+    private final Property<EclipsePlatform> platform;
+
+    public EclipseProjectImpl(EclipseProject imported, FileObject projectDir) throws MalformedURLException {
+        this.imported = imported;
+        this.projectDir = projectDir;
+        this.platform = EclipsePlatform.getDefault();
+        ClassPath source = computeCP(projectDir, platform, imported.getSourceRoots());
+        ClassPath compile = computeCP(projectDir, platform, imported.getClassPathEntries());
+        File output = new File(imported.getOutput().getAbsolutePath());
+        URL outputURL = output.toURI().toURL();
+        if (!outputURL.getPath().endsWith("/")) {
+            outputURL = new URL(outputURL.toExternalForm() + "/");
+        }
+        ClassPath execute = ClassPathSupport.createProxyClassPath(compile, ClassPathSupport.createClassPath(outputURL));
+        this.lookup = Lookups.fixed(new ClassPathProviderImpl(compile, source, execute),
+                                    new ProjectOpenedHookImpl(source),
+                                    new SourceForBinaryQueryImpl(outputURL, source),
+                                    new SourcesImpl(this, source),
+                                    new LogicalViewProviderImpl(this));
+    }
+
+    @Override
+    public FileObject getProjectDirectory() {
+        return projectDir;
+    }
+
+    @Override
+    public Lookup getLookup() {
+        return lookup;
+    }
+
+    private static final ClassPath computeCP(FileObject project, Property<EclipsePlatform> platform, List<DotClassPathEntry> entries) {
+        List<ClassPath> cp = new ArrayList<ClassPath>();
+
+        for (DotClassPathEntry e : entries) {
+            String mapping = e.getContainerMapping();
+
+            if (mapping == ClassPathContainerResolver.REQUIRED_PLUGIN_MARKER) {
+                cp.add(ClassPathFactory.createClassPath(new PlatformBasedClassPathImpl(project, platform)));
+                continue;
+            }
+            
+            if (mapping == null) mapping = e.getAbsolutePath();
+            if (mapping == null) continue;
+            
+            cp.add(ClassPathSupport.createClassPath(mapping));
+        }
+
+        return ClassPathSupport.createProxyClassPath(cp.toArray(new ClassPath[0]));
+    }
+
+    private static final class ClassPathProviderImpl implements ClassPathProvider {
+
+        private final ClassPath bootCP;//XXX
+        private final ClassPath compileCP;
+        private final ClassPath sourceCP;
+        private final ClassPath executeCP;
+
+        public ClassPathProviderImpl(ClassPath compileCP, ClassPath sourceCP, ClassPath executeCP) {
+            this.bootCP = JavaPlatform.getDefault().getBootstrapLibraries();
+            this.compileCP = compileCP;
+            this.sourceCP = sourceCP;
+            this.executeCP = executeCP;
+        }
+
+        @Override
+        public ClassPath findClassPath(FileObject file, String type) {
+            if (ClassPath.BOOT.equals(type)) return bootCP;
+            if (ClassPath.COMPILE.equals(type)) return compileCP;
+            if (ClassPath.SOURCE.equals(type)) return sourceCP;
+            if (ClassPath.EXECUTE.equals(type)) return executeCP;
+            return null;
+        }
+    }
+
+    private static final class ProjectOpenedHookImpl extends ProjectOpenedHook {
+
+        private final ClassPath source;
+
+        public ProjectOpenedHookImpl(ClassPath source) {
+            this.source = source;
+        }
+
+        @Override
+        protected void projectOpened() {
+            GlobalPathRegistry.getDefault().register(ClassPath.SOURCE, new ClassPath[] {source});
+        }
+
+        @Override
+        protected void projectClosed() {
+            GlobalPathRegistry.getDefault().unregister(ClassPath.SOURCE, new ClassPath[] {source});
+        }
+
+    }
+
+    private static final class SourceForBinaryQueryImpl implements SourceForBinaryQueryImplementation2 {
+
+        private final Result result;
+        private final URL output;
+
+        public SourceForBinaryQueryImpl(URL output, ClassPath source) {
+            this.output = output;
+            result = new SFBQResultImpl(source);
+        }
+
+        @Override
+        public Result findSourceRoots2(URL binaryRoot) {
+            if (output.equals(binaryRoot)) {
+                return result;
+            } else {
+                return null;
+            }
+        }
+
+        @Override
+        public SourceForBinaryQuery.Result findSourceRoots(URL binaryRoot) {
+            return findSourceRoots2(binaryRoot);
+        }
+
+    }
+
+    private static final class SFBQResultImpl implements Result {
+
+        private final ClassPath cp;
+
+        public SFBQResultImpl(ClassPath cp) {
+            this.cp = cp;
+        }
+
+        @Override
+        public boolean preferSources() {
+            return true;
+        }
+
+        @Override
+        public FileObject[] getRoots() {
+            return cp.getRoots();
+        }
+
+        @Override
+        public void addChangeListener(ChangeListener l) {}
+
+        @Override
+        public void removeChangeListener(ChangeListener l) {}
+
+    }
+
+    private static final class LogicalViewProviderImpl implements LogicalViewProvider {
+
+        private final EclipseProjectImpl epi;
+
+        public LogicalViewProviderImpl(EclipseProjectImpl epi) {
+            this.epi = epi;
+        }
+
+        @Override
+        public Node createLogicalView() {
+            return new RootNode(epi);
+        }
+
+        @Override
+        public Node findPath(Node root, Object target) {
+            return null;
+        }
+
+    }
+
+    private static final class SourcesImpl implements Sources {
+
+        private final EclipseProjectImpl epi;
+        private final ClassPath sourceCP;
+
+        public SourcesImpl(EclipseProjectImpl epi, ClassPath sourceCP) {
+            this.epi = epi;
+            this.sourceCP = sourceCP;
+        }
+
+        @Override
+        public SourceGroup[] getSourceGroups(String type) {
+            if (TYPE_GENERIC.equals(type)) {
+                return GenericSources.genericOnly(epi).getSourceGroups(type);
+            }
+            if (JavaProjectConstants.SOURCES_TYPE_JAVA.equals(type)) {
+                List<SourceGroup> sourceGroups = new ArrayList<SourceGroup>();
+
+                for (FileObject src : sourceCP.getRoots()) {
+                    sourceGroups.add(GenericSources.group(epi, src, src.getNameExt(), src.getNameExt(), null, null));
+                }
+
+                return sourceGroups.toArray(new SourceGroup[0]);
+            }
+
+            return new SourceGroup[0];
+        }
+
+        @Override public void addChangeListener(ChangeListener listener) {}
+
+        @Override public void removeChangeListener(ChangeListener listener) {}
+
+    }
+
+    private static final class RootNode extends AbstractNode implements ChangeListener {
+
+        private final EclipseProjectImpl project;
+        
+        public RootNode(EclipseProjectImpl p) {
+            super(Children.create(new RootChildFactory(p), true), Lookups.fixed(p));
+            this.project = p;
+            this.project.platform.addChangeListener(WeakListeners.change(this, project.platform));
+            setDisplayName();
+            setIconBaseWithExtension("org/netbeans/modules/eclipse/project/resources/project-icon.png");
+        }
+
+        private void setDisplayName() {
+            setDisplayName(project.imported.getName() + (project.platform.getValue() != null ? "" : " - no platform"));
+        }
+
+        @Override
+        public String getHtmlDisplayName() {
+            if (project.platform.getValue() != null) return null;
+
+            return getDisplayName() + " - <font color='FF0000'>Eclipse platform location not specified";
+        }
+
+
+        @Override
+        public void stateChanged(ChangeEvent e) {
+            setDisplayName();
+        }
+    }
+
+    private static final class RootChildFactory extends ChildFactory<Object> {
+
+        private final EclipseProjectImpl epi;
+
+        public RootChildFactory(EclipseProjectImpl epi) {
+            this.epi = epi;
+        }
+
+        @Override
+        protected boolean createKeys(List<Object> toPopulate) {
+            for (SourceGroup src : ProjectUtils.getSources(epi).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA)) {
+                toPopulate.add(src);
+            }
+
+            return true;
+        }
+
+        @Override
+        protected Node createNodeForKey(Object key) {
+            if (key instanceof SourceGroup) {
+                return PackageView.createPackageView((SourceGroup) key);
+            }
+
+            throw new IllegalStateException();
+        }
+
+    }
+
+}

project/src/org/netbeans/modules/eclipse/project/PlatformBasedClassPathImpl.java

+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2011 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * The Original Software is NetBeans. The Initial Developer of the Original
+ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2011 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ */
+package org.netbeans.modules.eclipse.project;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import org.netbeans.api.annotations.common.NonNull;
+import org.netbeans.spi.java.classpath.ClassPathImplementation;
+import org.netbeans.spi.java.classpath.PathResourceImplementation;
+import org.netbeans.spi.java.classpath.support.ClassPathSupport;
+import org.openide.filesystems.FileObject;
+import org.openide.util.Exceptions;
+import org.openide.util.WeakListeners;
+
+/**
+ *
+ * @author lahvac
+ */
+public class PlatformBasedClassPathImpl implements ClassPathImplementation, ChangeListener {
+
+    private final FileObject project;
+    private final Property<EclipsePlatform> projectsPlatform;
+    private List<? extends PathResourceImplementation> roots;
+
+    public PlatformBasedClassPathImpl(@NonNull FileObject project, @NonNull Property<EclipsePlatform> projectsPlatform) {
+        this.project = project;
+        this.projectsPlatform = projectsPlatform;
+
+        this.projectsPlatform.addChangeListener(WeakListeners.change(this, projectsPlatform));
+    }
+
+    @Override
+    public List<? extends PathResourceImplementation> getResources() {
+        if (roots != null) return roots;
+
+        EclipsePlatform platform = projectsPlatform.getValue();
+
+        if (platform == null) return roots = Collections.emptyList();
+
+        try {
+            Collection<URL> deps = platform.dependencies(project);
+            List<PathResourceImplementation> result = new ArrayList<PathResourceImplementation>(deps.size());
+
+            for (URL dep : deps) {
+                result.add(ClassPathSupport.createResource(dep));
+            }
+
+            return roots = Collections.unmodifiableList(result);
+        } catch (IOException ex) {
+            Exceptions.printStackTrace(ex);
+            return roots = Collections.emptyList();
+        }
+    }
+
+    @Override
+    public void stateChanged(ChangeEvent e) {
+        synchronized (this) {
+            roots = null;
+        }
+
+        pcs.firePropertyChange(PROP_RESOURCES, null, null);
+    }
+
+    private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
+
+    @Override
+    public void addPropertyChangeListener(PropertyChangeListener listener) {
+        pcs.addPropertyChangeListener(listener);
+    }
+
+    @Override
+    public void removePropertyChangeListener(PropertyChangeListener listener) {
+        pcs.removePropertyChangeListener(listener);
+    }
+}

project/src/org/netbeans/modules/eclipse/project/ProjectFactoryImpl.java

+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2011 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * The Original Software is NetBeans. The Initial Developer of the Original
+ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2011 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ */
+package org.netbeans.modules.eclipse.project;
+
+import java.io.File;
+import java.io.IOException;
+import org.netbeans.api.project.Project;
+import org.netbeans.modules.eclipse.project.borrowed.EclipseProject;
+import org.netbeans.modules.eclipse.project.borrowed.ProjectImporterException;
+import org.netbeans.spi.project.ProjectFactory;
+import org.netbeans.spi.project.ProjectState;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.Exceptions;
+import org.openide.util.lookup.ServiceProvider;
+
+/**
+ *
+ * @author lahvac
+ */
+@ServiceProvider(service=ProjectFactory.class)
+public class ProjectFactoryImpl implements ProjectFactory {
+
+    @Override
+    public boolean isProject(FileObject projectDirectory) {
+        return projectDirectory.getFileObject(".project") != null;
+    }
+
+    @Override
+    public Project loadProject(FileObject projectDirectory, ProjectState state) throws IOException {
+        try {
+            File pd = FileUtil.toFile(projectDirectory);
+
+            if (pd == null) return null;
+
+            EclipseProject eprj = org.netbeans.modules.eclipse.project.borrowed.ProjectFactory.getInstance().load(pd);
+
+            if (eprj == null) return null;
+
+            if (eprj.getOutput() == null) return null; //XXX
+            return new EclipseProjectImpl(eprj, projectDirectory);
+        } catch (ProjectImporterException ex) {
+            Exceptions.printStackTrace(ex);
+            return null;
+        }
+    }
+
+    @Override
+    public void saveProject(Project project) throws IOException, ClassCastException {}
+
+}

project/src/org/netbeans/modules/eclipse/project/Property.java

+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2011 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * The Original Software is NetBeans. The Initial Developer of the Original
+ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2011 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ */
+package org.netbeans.modules.eclipse.project;
+
+import javax.swing.event.ChangeListener;
+import org.openide.util.ChangeSupport;
+
+/**
+ *
+ * @author lahvac
+ */
+public class Property<T> {
+
+    private T value;
+    private final ChangeSupport cs = new ChangeSupport(this);
+
+    public T getValue() {
+        return value;
+    }
+
+    public void setValue(T value) {
+        this.value = value;
+        cs.fireChange();
+    }
+
+    public void addChangeListener(ChangeListener l) {
+        cs.addChangeListener(l);
+    }
+
+    public void removeChangeListener(ChangeListener l) {
+        cs.removeChangeListener(l);
+    }
+
+}

project/src/org/netbeans/modules/eclipse/project/borrowed/Bundle.properties

+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+#
+# Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
+#
+# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+# Other names may be trademarks of their respective owners.
+#
+# The contents of this file are subject to the terms of either the GNU
+# General Public License Version 2 only ("GPL") or the Common
+# Development and Distribution License("CDDL") (collectively, the
+# "License"). You may not use this file except in compliance with the
+# License. You can obtain a copy of the License at
+# http://www.netbeans.org/cddl-gplv2.html
+# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+# specific language governing permissions and limitations under the
+# License.  When distributing the software, include this License Header
+# Notice in each file and include the License file at
+# nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the GPL Version 2 section of the License file that
+# accompanied this code. If applicable, add the following below the
+# License Header, with the fields enclosed by brackets [] replaced by
+# your own identifying information:
+# "Portions Copyrighted [year] [name of copyright owner]"
+#
+# Contributor(s):
+#
+# The Original Software is NetBeans. The Initial Developer of the Original
+# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
+# Microsystems, Inc. All Rights Reserved.
+#
+# If you wish your version of this file to be governed by only the CDDL
+# or only the GPL Version 2, indicate your decision by adding
+# "[Contributor] elects to include this software in this distribution
+# under the [CDDL or GPL Version 2] license." If you do not indicate a
+# single choice of license, a recipient has the option to distribute
+# your version of this file under either the CDDL, the GPL Version 2 or
+# to extend the choice of license to its licensees as provided above.
+# However, if you add GPL Version 2 code and therefore, elected the GPL
+# Version 2 license, then the option applies only if the new code is
+# made subject to such option by the copyright holder.
+
+### Resource bundle for package org.netbeans.modules.projectimport.eclipse.core
+
+CTL_MenuItem=&Eclipse Project...
+CTL_SynchronizeMenuItem=&Resynchronize Eclipse Projects
+
+CTL_ProgressDialogTitle=Importing Selected Projects...
+MSG_Progress_ProcessingProject=Processing "{0}" Project...
+MSG_ProblemsOccured=Some problems have occured:
+MSG_JRECannotBeUsed=Eclipse platform for project "{0}" cannot be used. It is a JRE and the NetBeans project requires a JDK. NetBeans will use the default platform.
+MSG_JDKDoesnExistUseDefault=Eclipse project "{0}" claims to use the JDK from the "{1}" directory. But this directory does not exist. NetBeans will use the default platform.
+MSG_NotValidPlatformsInNB=There are not any valid platforms found in NetBeans. Unable to continue.
+MSG_LibraryDoesnExist=Eclipse project "{0}" claims to use a library from the "{1}" directory. But this directory does not exist. To correct this Eclipse project discrepancy please find and import the library manually.
+
+UpdateProjectAction.Name=Resynchronize Eclipse Projects
+UpdateEclipseReferencePanel.jLabel1.text=Eclipse &Project:
+UpdateEclipseReferencePanel.jLabel2.text=Eclipse &Workspace:
+UpdateEclipseReferencePanel.eclipseProjectTextField.text=
+UpdateEclipseReferencePanel.eclipseWorkspaceTextField.text=
+UpdateEclipseReferencePanel.browseProjectButton.text=&Browse...
+UpdateEclipseReferencePanel.browseWorkspaceButton.text=B&rowse...
+UpdateProjectAction.already-in-synch=The projects are already in synch and there is nothing to update.
+# {0} - project directory
+UpdateProjectAction.problems-occurred=The following problems occurred during synchronization with Eclipse project {0}:
+UpdateProjectAction.problems-occurred-2=The following problems occurred during synchronization with Eclipse:
+UpdateProjectAction.update-issues=Update Issues
+UpdateProjectAction.nothing-to-synch=There are no projects to synchronize with Eclipse. Import some first and then use this action again.
+UpdateEclipseReferencePanel.jLabel3.text=<html><b>The original Eclipse project <i>{0}</i> cannot be found.</b>
+UpdateEclipseReferencePanel.jLabel4.text=<html>Specify the Eclipse project location. The Eclipse workspace is optional.
+RequiredProjectsPanel.jLabel1.text=<html>Additional Eclipse projects need to be imported to satisfy new project dependencies:
+MSG_NoSourceRootsFound=No source roots have been found and therefore no classpath will be configured.
+MSG_RequiredProjectNotFound=Required project ''{0}'' cannot be found.
+MSG_RequiredProjectHasNoArtifacts=Required project ''{0}'' does not provide any JAR artifacts.
+MSG_TransitiveExportCannotBeResolved=Transitive export ''{0}'' cannot be resolved.
+MSG_MissingClasspathEntry=Classpath entry ''{0}'' does not seems to exist.
+MSG_CannotResolveClasspathEntry=Classpath entry ''{0}'' cannot be resolved.
+MSG_ClasspathEntryDoesNotExist=Classpath entry ''{0}'' does not seem to exist.
+MSG_CannotRemoveReference=Reference to project ''{0}'' was not successfully removed.
+MSG_ReferenceToProjectNotFound=Reference to project ''{0}'' was not found and therefore could not be removed.
+MSG_ReferenceNotRemoved=Reference to JAR/Folder ''{0}'' was not successfully removed.
+MSG_VariableReferenceNotRemoved=Reference to variable based JAR/Folder ''{0}'' was not successfully removed.
+MSG_ContainerReferenceNotRemoved=Reference to container value ''{0}'' was not successfully removed.
+MSG_ExcludesWarning1=Source exclude '**/*.java' was omitted. It is recommended that you double check project excludes in the Source panel of the Project Properties dialog.
+MSG_ExcludesWarning2=NetBeans does not support source includes/excludes per source root as Eclipse does. They were merged and it is recommended that you double check them in the Source panel of the Project Properties dialog.
+MSG_UnsupportedContainer=Unsupported classpath container found. It will be ignored and you may need to update the NetBeans project classpath by hand. The internal name of this container is: ''{0}''
+MSG_UnsupportedWebContainer=There are inter-project dependencies which could not be resolved. Importing the whole workspace could prevent this problem. (''{0}'')
+MSG_CannotCreateUserLibrary=User library ''{0}'' cannot be created because the project is being imported without Eclipse workspace.
+MSG_IDEVariableMismatch=IDE variable ''{0}'' is configured with value ''{1}'' but the project expects it to be ''{2}''.
+MSG_IDEVariableNotFound=IDE variable ''{0}'' was not found in the workspace. Set the value in NetBeans.
+MSG_WorkspaceDependentProtocol=Javadoc location cannot be resolved without Eclipse workspace. It will be ignored: ''{0}''
+MSG_UnsupportedProtocol=Javadoc location contains an unsupported URL protocol which will be ignored: ''{0}''
+MSG_UnsupportedJavadocLocation=Javadoc location is not valid URL and will be ignored: ''{0}''
+MSG_JavadocCannotBeResolved=Javadoc location cannot be resolved: ''{0}''
+MSG_ImportIssues=Import Issues
+MSG_ImportFailed=Import failed due to ''{0}''. More details can be found in the IDE's log file.
+MSG_ImportResults=Project ''{0}'' import results:
+MSG_AlreadyImportedProjectFound=An existing NetBeans project was found and will be used instead.
+MSG_UnknownProject=Unknown project type - it cannot be imported.
+LABEL_Eclipse_Project=Eclipse Project
+LABEL_NetBeans_Project_Destination=NetBeans Project Destination
+TITLE_Synchronize_with_Eclipse=Synchronize with Eclipse
+MSG_ProjectUpdateIssues=Project ''{0}'' update issues:
+MSG_UpdateFailed=Update failed due to ''{0}''. More details can be found in the IDE's log file.
+MSG_SelectProject=Eclipse project must be selected.
+MSG_SelectWorkspace=Eclipse workspace must be selected.
+TITLE_Select_Eclipse_Project=Select Eclipse Project
+TITLE_Select_Eclipse_Workspace=Select Eclipse Workspace
+MSG_CannotReadMyEclipseLibs=MyEclipse installation was not found and so its internal libraries were not imported to NetBeans.
+MSG_SourceRootOwned=The Eclipse project ''{0}'' has a source root ({1}) which is already owned by an existing NetBeans project ''{2}''. \
+ The Eclipse project will not be imported and you should instead open the existing NetBeans project which manages the sources.
+MSG_CannotFindLibrarySources=Source root ''{0}'' associated with library ''{1}'' cannot be found and will be ignored.
+ACSD_UpdateEclipseReferencePanel_NA=N/A
+MSG_InvalidSourceRoot=Eclipse project source root does not seem to exist and will be ignored: ''{0}''
+
+# Usage Logging
+# {0} type: java / web
+# {1} naked(false) or workspace(true)
+# {2} imported to separate folder(false) or eclipse project folder(true)
+# {3} number of import issues
+USG_PROJECT_ECLIPSE_IMPORT=An Eclipse project was imported. NetBeans project type: {0}, \
+    workspace import: {1}, imported to Eclipse folder: {2}, \
+    number of import issues: {3}.

project/src/org/netbeans/modules/eclipse/project/borrowed/ClassPathContainerResolver.java

+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ * 
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ * 
+ * Contributor(s):
+ * 
+ * Portions Copyrighted 2008 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.eclipse.project.borrowed;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.jar.Manifest;
+import org.netbeans.modules.eclipse.project.EclipsePlatform;
+import org.netbeans.spi.project.support.ant.PropertyUtils;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+
+/**
+ * For now all well-known containers (based on Europa/Ganymede) are hardcoded here.
+ * Can be refactored into SPI if needed.
+ * 
+ */
+public class ClassPathContainerResolver {
+
+    public static final String REQUIRED_PLUGIN_MARKER = new String("org.eclipse.pde.core.requiredPlugins");
+
+    public static final String JUNIT_CONTAINER = "org.eclipse.jdt.junit.JUNIT_CONTAINER/"; //NOI18N
+    public static final String USER_LIBRARY_CONTAINER = "org.eclipse.jdt.USER_LIBRARY/"; //NOI18N
+    public static final String WEB_CONTAINER = "org.eclipse.jst.j2ee.internal.web.container"; //NOI18N
+    public static final String J2EE_MODULE_CONTAINER = "org.eclipse.jst.j2ee.internal.module.container"; //NOI18N
+    public static final String JSF_CONTAINER = "org.eclipse.jst.jsf.core.internal.jsflibrarycontainer/"; //NOI18N
+    public static final String J2EE_SERVER_CONTAINER = "org.eclipse.jst.server.core.container/"; //NOI18N
+    public static final String MYECLIPSE_CONTAINERS = "melibrary.com.genuitec.eclipse."; //NOI18N
+    public static final String REQUIRED_PLUGIN = "org.eclipse.pde.core.requiredPlugins"; //NOI18N
+    
+    /**
+     * Converts eclipse CONTAINER claspath entry to something what can be put
+     * directly to Ant based project classpath.