+URL_ON_IMG=http://www.jmonkeyengine.com/
diff --git a/sdk/branding/modules/org-netbeans-modules-java-j2seproject.jar/org/netbeans/modules/java/j2seproject/ui/resources/j2seProject.png b/sdk/branding/modules/org-netbeans-modules-java-j2seproject.jar/org/netbeans/modules/java/j2seproject/ui/resources/j2seProject.png
new file mode 100644
index 000000000..f67785a6e
Binary files /dev/null and b/sdk/branding/modules/org-netbeans-modules-java-j2seproject.jar/org/netbeans/modules/java/j2seproject/ui/resources/j2seProject.png differ
diff --git a/sdk/build.xml b/sdk/build.xml
new file mode 100644
index 000000000..62805dccd
--- /dev/null
+++ b/sdk/build.xml
@@ -0,0 +1,265 @@
+
+
+
+
+
+ Builds the module suite jme-gde.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Setting implementation version for ${module_dir} to revision: ${svn.LastChangedRev}
+
+
+
+ Removing implementation version for ${module_dir} from revision: ${svn.LastChangedRev}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+jMonkeyEngine 3 was rebuilt from the ground up to be a modern 3D game engine,
+compatible with OpenGL 2.0 and above.
+Its architecture is shader-based, making it fully capable of current and
+next generation graphics standards. The jMonkeyPlatform gives you a complete IDE
+for coding and for managing and creating game assets.
+
+
+
+
diff --git a/sdk/debscripts/postrm b/sdk/debscripts/postrm
new file mode 100755
index 000000000..a732bd889
--- /dev/null
+++ b/sdk/debscripts/postrm
@@ -0,0 +1,2 @@
+#!/bin/bash
+rm -rf $HOME/.jmonkeyplatform
diff --git a/sdk/harness/README b/sdk/harness/README
new file mode 100644
index 000000000..7df5c0e5d
--- /dev/null
+++ b/sdk/harness/README
@@ -0,0 +1,1284 @@
+INTRODUCTION
+------------
+
+This build harness permits modules outside of the netbeans.org CVS tree to be
+built against a NetBeans-based application: the NB platform, the NB IDE, or any
+derivative product. The semantics of configuration files is synchronized with
+the NBM project type module, so that you can open any module in the NB IDE and
+work with it naturally: build and test it using Ant, use Java code completion,
+and so on.
+
+Questions and comments should go to: dev@openide.netbeans.org
+
+BASIC FILE LAYOUT
+-----------------
+
+Within the netbeans.org CVS tree, modules are detected as projects of the "NBM"
+(NetBeans module) type. The project directory may be top-level (e.g. "beans"),
+second-level (e.g. "ant/project"), or third-level (e.g.
+"objectbrowser/navigator/javanavigation"). The project.xml for the project must
+specify
+
+ org.netbeans.modules.apisupport.project
+
+to indicate that it is an NBM project, and the configuration must be
+
+
+
+Note that this schema is a change from the /2 schema used in NetBeans 5.0.
+(/2 is still supported for compatibility.)
+NetBeans 4.0 and 4.1 use schema /1 which is no longer supported.
+
+Outside of the netbeans.org CVS tree, modules can take two forms. They may be
+marked with
+
+
+
+in which case they can build into a platform binary but not refer to any other
+source modules. Or they may be marked with
+
+
+
+in which case they are contained within a module suite. The suite enumerates
+modules it contains, and each module points back to the suite that contains it.
+
+The meaning of the project.xml elements, as well as property names in
+project.properties and other files, will be discussed later.
+
+The project directory should contain "manifest.mf" (more on this later),
+"build.xml" (more later), a directory "src" with the main package root of the
+module's classes, optionally "test/unit/src" with unit tests, and perhaps some
+other files.
+
+If there is a subdirectory "javahelp" it is used to keep JavaHelp documentation,
+which will be built automatically.
+
+If there is a file "module-auto-deps.xml" it will automatically be used to
+upgrade modules depending on you to new dependencies, as described in the
+Modules API.
+
+STANDALONE MODULES: CONFIGURATION FILES
+---------------------------------------
+
+Standalone modules may keep configuration in several properties files, in the
+following order of loading:
+
+${basedir}/nbproject/private/platform-private.properties
+${basedir}/nbproject/platform.properties
+${user.properties.file}
+[definition of 'harness.dir' and 'netbeans.dest.dir' or 'cluster.path' based on value of ${nbplatform.active}]
+${basedir}/nbproject/private/private.properties
+${basedir}/nbproject/project.properties
+
+Projects generated by NB 6.5 and earlier:
+-----------------------------------------
+The properties 'harness.dir' and 'netbeans.dest.dir' must be defined by the
+project. Usually this is accomplished by defining the property
+'nbplatform.active' in platform.properties, and ${user.properties.file}
+(normally build.properties in the user directory, usually defined in
+platform-private.properties) can define properties like
+'nbplatform.NAME.netbeans.dest.dir' (this would be used for 'netbeans.dest.dir'
+in case ${nbplatform.active} had the value 'NAME').
+
+Projects generated by NB 6.7 and later (for 6.7 platform):
+----------------------------------------------------------
+6.7 and newer projects may be distinguished by the presence of 'cluster.path'
+property in nbproject/platform.properties file or simply by the fact that an
+attempt to build a standalone module without it results in error:
+
+ 'You must specify path to 'platform' cluster in ${cluster.path} property.'
+
+In such case property 'cluster.path' must be defined by the project. It must
+contain classpath-like list of absolute or relative paths to individual clusters
+against which will be the module build. "Bare", i.e. not numbered cluster names
+can be used, which simplifies later transitions to newer version of the
+platform. Content of 'cluster.path' can also reference other properties defined
+in the project, properties file generated by the IDE e.g uses property
+'nbplatform.active.dir' pointing to root folder of specified active platform.
+'nbplatform.active' is used like before. Properties 'netbeans.dest.dir',
+'enabled.clusters' and 'disabled.clusters' *must not* be defined in the
+projects. They would be ignored anyway so there is a dedicated check that
+project is not trying to setup something that would not work anyway.
+
+For more info on uses of 'cluster.path' property and setting it in IDE, see
+http://wiki.netbeans.org/DevFaqHowToReuseModules.
+
+MODULE SUITES: CONFIGURATION FILES
+----------------------------------
+
+Modules in a suite have a slightly more complicated list of properties files in
+which they may keep configuration:
+
+${basedir}/nbproject/private/suite-private.properties
+${basedir}/nbproject/suite.properties
+${suite.dir}/nbproject/private/platform-private.properties
+${suite.dir}/nbproject/platform.properties
+${user.properties.file}
+[definition of 'harness.dir' and 'netbeans.dest.dir' or 'cluster.path' based on value of ${nbplatform.active}]
+${basedir}/nbproject/private/private.properties
+${basedir}/nbproject/project.properties
+
+'suite.dir' is normally defined in suite-private.properties (or suite.properties
+in case it is a relative path). platform-private.properties and
+platform.properties are then used to define the NB platform in the same way as
+for standalone modules.
+
+The suite itself (the project located in ${suite.dir}) can load properties from:
+
+${basedir}/nbproject/private/platform-private.properties
+${basedir}/nbproject/platform.properties
+${user.properties.file}
+[definition of 'harness.dir' and 'netbeans.dest.dir' or 'cluster.path' based on value of ${nbplatform.active}]
+${basedir}/nbproject/private/private.properties
+${basedir}/nbproject/project.properties
+
+It must define a property 'modules' enumerating modules it contains (in path
+format, with each entry being a module project directory). This is usually done
+in project.properties, perhaps also with private.properties to help with
+absolute paths.
+
+USING A RELATIVE PATH FOR THE PLATFORM WITH A MODULE SUITE
+----------------------------------------------------------
+
+Though not directly supported by the GUI, it is possible to set up a module
+suite in such a way that the path to the NetBeans platform is given as relative,
+and sharable in VCS. This may be helpfully especially for multi-developer teams
+who frequently develop against new NetBeans builds (or build NetBeans from CVS
+sources). You need to:
+
+1. Make sure that each module's suite.properties specifies 'suite.dir' as
+relative to its base directory, not as a bare relative path, e.g.
+
+ suite.dir=${basedir}/..
+
+2. Edit the suite's platform.properties to give a fallback value for 'suite.dir'
+(so the suite's own master build script can work), and define *both*
+netbeans.dest.dir and harness.dir in terms of the suite directory, e.g.:
+
+ suite.dir=${basedir}
+
+ # for platform 6.7 and later, use:
+ # 'platform.base' is only a helper property, it has no meaning in harness
+ platform.base=${suite.dir}/../nb_sources/nbbuild/netbeans
+ cluster.path=${platform.base}/platform:
+ harness.dir=${platform.base}/harness
+
+ # for platform 6.5 and earlier, use:
+ netbeans.dest.dir=${suite.dir}/../nb_sources/nbbuild/netbeans
+ harness.dir=${netbeans.dest.dir}/harness
+
+platform.properties need not define 'nbplatform.active' in this case.
+
+Relative-path source and Javadoc associations for the platform is not yet
+supported in this scenario (#70876). Each developer with a checkout of the suite
+may need to configure a platform (with an arbitrary name) in the NetBeans
+Platform Manager dialog with a binary location matching the value you gave for
+${netbeans.dest.dir}, and with source and/or Javadoc associations of their
+choice. However, as a convenience, special associations may be predefined in the
+IDE in the special case that the destination directory is the subsubdirectory
+"nbbuild/netbeans" of a netbeans.org CVS checkout (i.e. if you build NetBeans
+from sources and then build your suite against that).
+
+"CHAINING" SUITES (INTER-SUITE DEPENDENCIES HOWTO)
+--------------------------------------------------
+
+As of platform version 6.7, suite-chaining as described here is superseded by
+using 'cluster.path' property, see previous chapters and developer FAQ
+http://wiki.netbeans.org/DevFaqHowToReuseModules. For platform versions 6.5
+and older, read on.
+
+Suppose you have one platform P1, say the bare NetBeans Platform. Then you have
+a module suite S1 with modules M1a...M1z which uses P1. Now it may happen that
+you want another suite S2 with modules M2a...M2z to depend on S1 as well as P1.
+This is possible, though not yet trivial to set up. Basically, you will make a
+new platform P2 by building S1 + P1. Here's what you need to do in brief:
+
+1. Set up S1 with P1 in the normal way.
+
+2. Edit S1/build.xml to include a target to make a platform P2. For example:
+
+
+
+
+
+
+where S1/nbproject/project.properties or S1/nbproject/private/private.properties
+defines:
+
+ p2=...path.../myplatform
+
+Note that the ZIP will currently contain S1's ${app.name} as its top-level dir,
+so you can either move the unpacked files up one dir, or use the dir p2/s1name
+as the actual platform location.
+
+As of NetBeans 6.0, you may simply run the 'create-platform' target in your suite's
+build.xml, which will create a platform in ${dist.dir}/${app.name}.
+
+3. Now configure S2 to use P2 as its platform. If an absolute path, you can use
+the Platform Manager, else for relative paths see the preceding section.
+
+(Setting harness.dir to ${netbeans.dest.dir}/harness will only work if P2
+includes a harness/ subdirectory, for example if S1 was configured to include
+the harness cluster. Otherwise, try ${netbeans.home}/../harness, or any location
+you prefer to keep a standard copy of the harness in.)
+
+4. To associate sources with binaries for P2, you will need to use the Platform
+Manager. You can select multiple source associations. In this case, use a
+netbeans.org CVS checkout or source download for the P1 (NetBeans platform)
+portion of P2, and use S1 (the suite directory) for the M1a...M1z modules in P2.
+
+5. In an S2 module like M2a you should be able to depend on any module in P2,
+including both NetBeans modules and modules from S1 like M1a. Code completion,
+popup Javadoc, etc. should work if source associations have been correctly
+configured in step #5.
+
+6. In case S1 was an application module with configured branding, you might wish
+to use S1's branding in S2 rather than making a new app for S2. Or, in place of
+a suite S2 you might have a standalone module M2. In either case, you can use
+S1's branding by configuring nbproject/project.properties in S2 (or standalone
+module M2):
+
+ branding.token=s1
+ branding.dir=none
+
+where 's1' was the branding token you chose for S1. This will permit Run,
+Reload, etc. on S2 and its modules like M2a, or standalone module M2, to work
+correctly.
+
+netbeans.org MODULES: CONFIGURATION FILES
+-----------------------------------------
+
+Modules inside the netbeans.org CVS tree need not define a platform; it is
+always "nbbuild/netbeans" in the CVS tree. They also do not have an explicit
+harness; they use various files located in "nbbuild". Unlike external modules
+which by default always use the cluster "devel", netbeans.org modules usually
+specify a cluster in "nbbuild/cluster.properties" ("extra" by default).
+
+PLATFORM DEFINITIONS
+--------------------
+
+The file build.properties in the user directory is used to store all information
+about NetBeans platforms. Each platform has an ID string; the default platform's
+ID is 'default'. The available properties for each platform are:
+
+1. nbplatform.ID.netbeans.dest.dir (mandatory) - absolute path to the
+destination directory (i.e. NetBeans platform installation).
+
+2. nbplatform.ID.harness.dir (mandatory) - path to the build harness. Normally
+will be "${nbplatform.ID.netbeans.dest.dir}/harness".
+
+3. nbplatform.ID.sources (optional) - see next section.
+
+4. nbplatform.ID.javadoc (optional) - see next section.
+
+SOURCE AND JAVADOC ASSOCIATIONS
+-------------------------------
+
+Modules inside the netbeans.org CVS tree need not do anything special to
+associate sources with binaries (the module JAR files under "nbbuild/netbeans");
+it is automatic. Javadoc may be associated with an API-providing module just by
+building its Javadoc (into "nbbuild/build/javadoc"), or by downloading the
+NetBeans API Documentation module, which will cause 'nbplatform.default.javadoc'
+to be defined in build.properties in the user directory (to the location of a
+ZIP of Javadoc).
+
+For external modules, sources and Javadoc may be associated with the active
+platform by defining in build.properties in the user directory these properties:
+
+1. nbplatform.ID.sources - an Ant-style path (e.g. ':' separated) containing
+source roots you wish to associate with the binary modules in
+${nbplatform.ID.netbeans.dest.dir}. Entries may be a checkout of the
+netbeans.org CVS tree, or source roots of other module suites which are included
+in the platform in binary form. Defining a source association permits you to
+step through sources while debugging, use Go To Class, get popup Javadoc in code
+completion, etc.
+
+2. nbplatform.ID.javadoc - a path containing roots of Javadoc for API-providing
+modules in the platform. Useful in case you wish to get Javadoc in View |
+Documentation Indices; or in the code completion popup (if you do not have
+sources). Each root may be a directory or a ZIP file. Within a root, the API for
+org.netbeans.modules.foo is expected to be inside the subdir named
+"org-netbeans-modules-foo".
+
+For examples of complete and functioning "external" module suites, see
+apisupport/project/test/unit/data/example-external-projects in netbeans.org
+sources.
+
+FORMAT OF YOUR project.xml's MAIN CONFIGURATION SECTION
+-------------------------------------------------------
+
+The format of project.xml is controlled by XML Schema. For the main section of
+new modules, use:
+
+ http://www.netbeans.org/ns/nb-module-project/3.xsd
+
+If you wish to edit project.xml by hand rather than using the IDE's GUI, you
+should validate all changes against this schema. If using the IDE's XML text
+editor, just type Alt-Shift-F9 to validate the current document. (Make sure the
+file is valid BEFORE saving it, as the IDE will refuse to load a malformed
+project.xml.)
+
+You must specify the "code name base" of your module. This is the value of
+OpenIDE-Module in manifest.mf, *except* without any major release version (e.g.
+"/1"). In the future OpenIDE-Module might be generated from this, but not yet.
+
+ org.netbeans.modules.foo
+
+For external modules, you must specify either or
+; for netbeans.org modules, you must not. See above discussion of
+file layout.
+
+Specify your dependencies on other modules:
+
+
+
+
+ some.other.module
+
+
+
+
+
+
+
+
+ 1
+
+ 3.9
+
+
+
+
+
+
+In a you can also use just
+
+
+
+in place of , meaning to declare an implementation
+dependency on another module. The actual version is taken directly from that
+module's current JAR so you do not need to keep track of it. *Important*: if you
+either *export* or *import* any implementation dependencies, you should probably
+use spec.version.base (see below).
+
+Specify your test dependencies on other modules [since 5.0u2, requires /3
+schema]. The tags in project.xml are
+described below:
+
+
+
+
+
+ unit
+
+
+
+ org.netbeans.modules.java.project
+
+
+
+
+
+
+
+
+
+
+Source root for a test type:
+{project.dir}/test/${test-type.name}/src
+
+{project.dir}/test/unit/src - source root for unit test
+
+
+For example you have three modules with code name bases A,B,C. A has runtime
+dependency on B, B on C. You want to add test dependencies to unit test type
+of module D:
+
+Use case 1: Runtime dependency on module.
+
+
+ unit
+
+ A
+
+
+
+Runtime classpath is D + A.
+Compile classpath is D.
+
+Use case 2: Runtime dependency on a module and its recursive runtime classpath.
+
+
+ unit
+
+ A
+
+
+
+
+Runtime classpath is A + B + C + D.
+Compile classpath is D.
+
+Use case 3: Compile and runtime dependency on a module its recursive runtime classpath.
+
+
+ unit
+
+ A
+
+
+
+
+
+Runtime classpath is A + B + C + D.
+Compile classpath is A + B + C + D.
+Note one feature of recursive compile-time dependency: modules B and C are added
+to compile classpath as well, even if A has only runtime dependency on B and B on C.
+
+Use case 4: Compile and runtime dependency on a module, its recursive runtime classpath
+and tests.
+
+
+ unit
+
+ A
+
+
+
+
+
+
+Runtime classpath is A + B + C + D + A/test/unit.
+Compile classpath is A + B + C + D + A/test/unit.
+
+Declare any public API/SPI packages you export:
+
+
+ org.netbeans.api.foo
+ org.netbeans.spi.foo
+
+
+If you do not export any API, say so:
+
+
+
+If you export an API to selected modules only, you can use (NB 5.0+ only!):
+
+
+ org.netbeans.modules.brother
+ org.netbeans.modules.foo.spi
+
+
+If you bundle a special library which you want to expose to modules depending on
+you, you need not enumerate every package explicitly:
+
+
+ javax.foo
+
+
+Exported implementation "APIs" do not need to be declared; anyone depending on
+your module with an implementation dependency gets access to *all* your
+packages. Be careful and avoid this situation whenever possible.
+
+If your module bundles one or more third-party libraries, declare them:
+
+
+
+ ext/foolib.jar
+
+ external/foolib.jar
+
+
+You still need to separately copy the JAR to the output directory (see below).
+This just declares that Class-Path in your module's manifest should be defined,
+and adds a compile-time classpath entry for your module and modules depending on
+it.
+
+If your bundled library is built from sources, just use
+
+
+ ext/foolib.jar
+
+
+Sometimes a module will produce some extra JARs (in modules/ext/ for Class-Path,
+in ant/nblib/, etc.), or will just need to have some extra sources for
+miscellaneous purposes (e.g. custom Ant tasks). You can declare them, somewhat
+similarly to how freeform projects permit compilation units to be declared; you
+will still need to explicitly compile and JAR them in your build.xml. For
+example, for in-IDE automatic Ant tasks you might use:
+
+
+
+ antsrc
+
+ ${ant.home}/lib/ant.jar:${openide.dir}/core/openide.jar
+
+ build/antclasses
+ ${cluster}/ant/nblib/${code.name.base.dashes}.jar
+
+
+Or for a Class-Path extension built from sources, you might use:
+
+
+ libsrc
+
+ build/libclasses
+ ${cluster}/modules/ext/foolib.jar
+
+
+A custom Ant task (or set of tasks) you use only during your own build might
+look like:
+
+
+ antsrc
+ ${ant.home}/lib/ant.jar
+ build/antclasses
+ build/tasks.jar
+
+
+Note that may contain Ant property references, so for a complex
+classpath, define it once in project.properties and use that property in
+ as well as in your Ant script.
+
+In order for the IDE to recognize references to those classes defined in the
+, you may also need add/modify your module's cp.extra
+property to include the value specified in the element.
+
+AN IMPORTANT NOTE: CUSTOMIZATION OF BUILD SCRIPTS
+-------------------------------------------------
+
+Harness scripts allow a great degree of customization in your project's build
+script and properties files (see sections on properties and Ant targets
+below). Due to open nature of Ant scripts (everything is public) special
+attention must be paid to migrating customized build scripts to newer version of
+harness. In order to avoid unexpected use of newer version of harness with new
+IDE, make sure that your either define harness location explicitly via
+harness.dir property or that you use harness supplied with NB platform you are
+building against ('Harness supplied with Platform' option on Harness tab in
+NetBeans Platform Manager).
+
+Of course sometimes you want to upgrade to newer version of harness. To minimize
+the chances that it will break your (customized) build, follow these
+simple rules:
+
+ * Use only properties listed in the following sections and avoid overriding
+ those marked 'Do not override' or similarly.
+ * Depend on/override only targets listed in sections 'Targets available for
+ overriding...' below
+ * When overriding targets, use only pre- or post-hooks (described below) for
+ your code and call original target as a whole in 'depends' attribute of the
+ target.
+
+Note that even when sticking to these rules, there is always possibility that
+migration to newer version of harness will break your build, especially when you
+depend on some implementation details, like a property *not* being set in
+particular internal target, concrete calling order of targets, etc.
+
+PROPERTIES WHICH MAY BE DEFINED IN YOUR project.properties
+----------------------------------------------------------
+
+If needed, these properties may also be defined in private.properties (to make
+them applicable to only your own checkout of sources). Only selected properties
+are listed here; others may be interpreted, but see the Ant script for details.
+
+Unless otherwise noted, properties listed here *are* available for use in
+selected fields in project.xml, *are* available for use in your build.xml
+(depend on some init target to make sure), and *are not* available for use when
+defining other properties in project.properties (unless you defined them in
+private.properties).
+
+app.icon.icns [since 6.9] - "${harness.dir}/etc/applicationIcon.icns" by default,
+path to application's icon in Mac (.icns) format; used for creating ".app"
+directory hierarchy in "build-mac" target.
+
+basedir - you cannot define this; it is always the project directory of the
+module (as in any Ant script). Available in all other properties files.
+
+build.classes.dir - "build/classes", used to send compiled classes to.
+
+build.compiler.debug - default "true" to include debugging info when compiling
+(needed if you want to step through sources).
+
+build.compiler.debuglevel - default "source,lines,vars" to include all debugging info.
+
+build.compiler.deprecation - default "true" to display deprecation warnings when
+compiling. If you want to disable deprecations, it is recommended you use
+private.properties:
+
+ build.compiler.deprecation=false
+
+build.test.unit.classes.dir - "build/test/unit/classes", where unit tests are
+compiled to.
+
+buildnumber - generated timestamp for use in
+OpenIDE-Module-Implementation-Version (or OpenIDE-Module-Build-Version if
+OpenIDE-Module-Implementation-Version was explicitly defined in the manifest).
+
+catalog.base.url [since 6.9] - distribution base for the suite modules NBMs
+location for which the catalog is generated. Default is ".".
+
+cluster - cluster directory your module is to be built into. For netbeans.org
+modules, this is a subdirectory of nbbuild/netbeans/; the subdirectory name is
+defined automatically from nbbuild/cluster.properties, with a fallback to
+"extra". For suite component modules, it defaults to
+"${suite.dir}/build/cluster", though you could override it if you wanted (e.g.
+in platform.properties); similarly, for standalone modules, it defaults to
+"${basedir}/build/cluster". Available in project.properties for netbeans.org
+modules only.
+
+code.name.base - your code name base as org.netbeans.modules.foo
+
+code.name.base.dashes - your code name base as org-netbeans-modules-foo
+
+code.name.base.slashes - ditto, as org/netbeans/modules/foo
+
+cp.extra - extra JARs you have to compile module sources against. Rarely needed
+any more, but if you have defined extra source trees with ,
+it may be necessary to add/modify this value to include the value specified in
+its element.
+
+extra.module.files - list of special files you build alongside your module JAR
+which you want to register for update tracking and include in your NBM.
+*Everything* you put into your cluster should be enumerated. Paths are relative
+to the cluster directory. Ant-style patternsets (most simply a trailing slash)
+are permitted if you can be sure no other modules' files would also match.
+Example:
+
+ extra.module.files=\
+ ext/foolib.jar,\
+ docs/FooAPI.zip,\
+ SpecialThirdPartyTool1.0/
+
+(You do *not* need to include: the module JAR itself; your JavaHelp JAR if you
+build one; your module declaration file; any module-auto-deps.xml; an
+ant/nblib/*.jar corresponding to your module; or any files in ${release.dir}.
+These are all included by default.)
+
+foo/bar.dir - absolute path of cluster directory to which the netbeans.org
+module "foo/bar" is built. Only defined for netbeans.org modules, and only if
+foo/bar was *already* built before yours (specify ).
+Available in project.properties.
+
+harness.dir - location of the build harness (for external modules). Usually
+"${netbeans.dest.dir}/harness".
+
+is.autoload and is.eager - default false, but if true, make this module an
+autoload or eager module.
+
+javac.compilerargs [since 5.0u1] - default none; additional arguments to pass
+to the Java compiler, e.g. "-Xlint:unchecked".
+
+javac.source - default "1.4"; to use JDK 1.5 features like generics:
+
+ javac.source=1.5
+
+javac.target - default ${javac.source}; controls version of generated bytecode
+
+javadoc.apichanges - optional location of an API changes list. Currently for
+netbeans.org modules only.
+
+javadoc.arch - optional location of an architecture XML description. Highly
+recommended as it makes your module self-documenting.
+
+ javadoc.arch=${basedir}/arch.xml
+
+javadoc.overview - optional location of a Javadoc overview page. Discouraged
+since it disables the default content which links to various generated documents
+which you would need to manually add to your own overview.
+
+javadoc.title - title for Javadoc build. Optional for external modules.
+DEPRECATED since 5.0u1; taken from other module metadata.
+
+javahelp.base - "${code.name.base.slashes}/docs" by default; directory
+containing your help set, under "javahelp/".
+
+javahelp.excludes - optionally, list of file name patterns to exclude from
+JavaHelp search index construction.
+
+javahelp.jar - "modules/docs/${code.name.base.dashes}.jar". Do not override.
+Constructed from ${javahelp.jar.basename} and ${javahelp.jar.dir}.
+
+javahelp.search - "JavaHelpSearch" by default; name of search database
+directory, relative to your help set. Must match what your help set specifies.
+
+jhall.jar - for external modules, if you wish to build JavaHelp, you must define
+the location of jhall.jar from the JavaHelp distribution, as this is needed to
+run the search indexer. DEPRECATED since 5.0u1; the 5.0u1 harness now includes
+jsearch-*.jar so you do not need to specify this property any longer.
+
+keystore - Key store for signing NBMs. A candidate for private.properties - you
+do *not* want to share this file! Also ${nbm_alias} and ${storepass} are used in
+the NBM signing process.
+
+license.file - optional. Location of license text to use when creating an NBM.
+(External modules only.)
+
+manifest.mf - JAR manifest location. Avoid overriding.
+
+module.auto.deps.xml - "module-auto-deps.xml" in your project directory by
+default. Optional configuration file.
+
+module.classpath - your main module source's compile-time classpath, according
+to . Since 5.0u1 uses public-package-only JARs where
+appropriate.
+
+module.run.classpath [since 5.0u1] - your main module source's run-time
+classpath, according to . Similar to ${module.classpath}
+except does not use public-package-only JARs; includes run-time-only
+dependencies; and processes dependencies transitively.
+
+module.jar - location of module JAR relative to cluster directory. Do not
+override directly; override ${module.jar.basename} (default
+"${code.name.base.dashes}.jar") and/or ${module.jar.dir} (default "modules") if
+necessary (not without a good reason!).
+
+module.jar.verifylinkageignores [since 6.0] - regexp pattern for class names
+that are excluded from linkage check
+
+module.javadoc.packages - comma-separated list of packages to be included in
+Javadoc. Defaulted according to or , but if
+you used (or if you have not specified any public or friend
+packages at all) you will need to specify it explicitly.
+
+nbm.distribution - optional URL to location where your NBM can be downloaded
+from.
+
+nbm.executable.files [since 6.8] - comma- or space- separated list of patterns of
+files relative to cluster directory for which executable permissions should be set
+on Unix system when building the module and on NBM installation/update in runtime.
+
+nbm.homepage - optional URL to HTML homepage for background about the module.
+
+nbm.is.global - set to "true" if NBM cannot be installed in user directory.
+
+nbm.module.author - author info for an NBM.
+
+nbm.needs.restart - set to "true" if NBM cannot be installed (even for the first
+time) without restarting the IDE.
+
+nbm.target.cluster [since 5.0u2] - allow to declare a target cluster where
+install if NBM install globally.
+
+autoupdate.catalog.url - if you want to use module's or suite's update target
+during build, you need to specify the URL of your NBMs catalog.
+
+nbplatform.active - optional name of a NB platform to build and run against. See
+discussion above for details of how this is used.
+
+netbeans.dest.dir - [up to 6.5.1] absolute pathname of NB platform (or IDE or
+whatever) that you are building your module against, and into which your module
+will be built. Available in project.properties (and in all properties files for
+netbeans.org modules). Specified folder must exist and must contain valid NB
+platform. Do not define in suite modules if suite's platform.properties defines
+"cluster.path" property. Also do not depend on this property to be defined, it
+will not be in projects created with NB 6.7 or later.
+
+
+netbeans.home - location of "platform*" cluster of the NetBeans IDE installation
+you are running. *Only defined* when you run an Ant script *inside* the IDE.
+
+nbjdk.active [since 5.0u1] - name of a Java platform (JDK) to use when building
+and running. Will try to load (e.g. from ${userdir}/build.properties, where Java
+Platform Manager stores its information) the properties
+
+ nbjdk.home=${platforms.${nbjdk.active}.home}
+ - JDK (not JRE!) home directory
+ nbjdk.bootclasspath=${platforms.${nbjdk.active}.bootclasspath}
+ - JRE JARs, e.g. rt.jar (default: ${nbjdk.home}/jre/lib/rt.jar)
+ nbjdk.java=${platforms.${nbjdk.active}.java}
+ - java executable (default: ${nbjdk.home}/bin/java)
+ nbjdk.javac=${platforms.${nbjdk.active}.javac}
+ - javac executable (default: ${nbjdk.home}/bin/javac)
+ nbjdk.javadoc=${platforms.${nbjdk.active}.javadoc}
+ - javadoc executable (default: ${nbjdk.home}/bin/javadoc)
+
+if they are not already defined. Uses to make , ,
+, , and use this JDK. Optional; if unset (or set to
+'default'), will use the current VM's Java platform instead. Define in
+platform.properties (in a standalone module, or in the suite for a suite component
+module, or in nbbuild/user.build.properties for a netbeans.org module). You may
+also define just ${nbjdk.home} directly, without using ${nbjdk.active}, if you do
+not need to use the Java Platform Manager to set up the JDK definition.
+
+use.pack200 [since 6.9] - whether to Pack200 compress NBMs; default true.
+
+pack200.excludes [since 6.9] - comma- or space- separated list of patterns of
+files relative to cluster directory for which pack200 compression should not be used
+while creating NBMs.
+
+project.license [since 6.0] - license to use for newly created files in the project
+(applies also to suites); default is 'cddl' for modules inside netbeans.org.
+
+release.dir - "${basedir}/release"; location of a directory full of files to
+copy unmodified to the output cluster. Since 6.0 beta2 also applies to module
+suite projects. DO NOT ATTEMPT to create files in this directory during the
+build; it is ONLY for static content (versioned files present in a clean source
+project). Dynamically generated cluster content should be placed directly in
+${cluster} as part of a netbeans-extra target, and be sure to mention such files
+in ${extra.module.files}.
+
+run.app.exe - "bin\netbeans.exe"; name of Windows launcher to start (inside
+${netbeans.dest.dir}) if trying to run the application for interactive testing.
+Only relevant if ${app.name} is unset.
+
+run.app.sh - "bin/netbeans"; same but for Unix (and Mac OS X).
+
+run.args.extra - empty; any added arguments to pass to the launcher.
+
+run.jdkhome - location of JDK to run application with for interactive testing.
+Defaults to JDK the Ant script was using, or that selected by ${nbjdk.active}.
+DEPRECATED - for compatibility only. Use ${nbjdk.active} instead.
+
+spec.version.base - this is a little subtle. If you export an implementation
+dependency to other modules, *and/or* depend on one or more other modules using
+implementation dependencies, you are advised to use this property *in place of*
+writing OpenIDE-Module-Specification-Version explicitly in your manifest. It
+should be a dotted number to serve as the base of a specification version; keep
+the number of components *fixed* even if you branch the module, so e.g. in a
+development version use
+
+ spec.version.base=1.7.0
+
+and if you need to increment this in a release branch use e.g.
+
+ spec.version.base=1.7.1
+
+The harness will automatically append integers to it as follows to create the
+actual specification version:
+
+1. Your OpenIDE-Module-Implementation-Version, if specified and an integer.
+
+2. The OpenIDE-Module-Implementation-Version of modules you depend on using
+implementation dependencies, if integers; ordered by alphabetizing the
+dependencies.
+
+(Example: if you have impl version 3, and you depend on org.netbeans.modules.foo
+= 6 and org.netbeans.modules.bar = 7, your actual spec version would be
+1.7.0.3.7.6.)
+
+This is very handy for Auto Update: whenever you or anyone else makes a change
+to an implementation API, just increment the
+OpenIDE-Module-Implementation-Version of the providing module. That module and
+any modules depending on its API will get a higher
+OpenIDE-Module-Specification-Version automatically, so the whole set of
+interdependent modules can be published to users at once on an update center.
+
+src.dir - "src", module source directory. Avoid overriding.
+
+test.timeout [since 6.1] - timeout (in msec) for unit tests, default 600000 (10
+minutes). A test running longer than this will be halted.
+
+test.run.args [since 6.5] - general VM arguments to pass when running tests.
+Defaults to just "-ea".
+
+test.config [since 6.5] - name of a test configuration to run, specifying a set
+of unit and/or functional tests which should be run by the 'test' target.
+Defaults to 'default'. ${test.config.NAME.includes} specifies the includes list
+(format: classpath resources). The standard value of ${test.config.NAME.includes}
+depends on NAME. In case of 'default', it includes every test ('**/*Test.class').
+In case of any other NAME the includes list is empty.
+${test.config.NAME.excludes} (default '') specifies an excludes list.
+
+test.unit.cp.extra - any additional classpath you might need to compile your
+unit tests. If left empty, you can compile against JUnit; the NB test extensions
+in nbjunit.jar; your module; and anything your module compiled against (since
+5.0u1, ${module.run.classpath}). As of 5.0u2 you can and should include other
+modules in project.xml's but in earlier releases these must
+be listed in this property.
+
+ test.unit.cp.extra=\
+ ${tools.jar}:\
+ ${basedir}/lib/custom-junit-helpers.jar
+
+test.unit.run.cp.extra - any additional classpath you might need to *run* your
+unit tests with (beyond what they are already compiled with). As of 5.0u2 you
+can and should include other modules in project.xml's but in
+earlier releases these must be listed in this property.
+
+test.unit.lib.cp - path to some basic libraries which can be used in unit tests:
+junit.jar, nbjunit.jar, and insanelib.jar. Not needed for netbeans.org modules.
+For external modules, may be needed if you do not have the junit and testtools
+modules installed in the target platform *or* the developing IDE, and the target
+platform is not inside a netbeans.org build tree (in nbbuild/netbeans).
+DEPRECATED as of 6.5; even basic libraries should instead be declared as regular
+test dependencies (they are now included in the harness cluster).
+
+test.unit.src.dir - "test/unit/src"; avoid overriding.
+
+test-unit-sys-prop. - will set a system property when running your
+unit tests.
+
+test.dist.dir - directory with test distribution.
+
+test.unit.folder - output directory for tests of module.
+
+test.unit.out.folder - this property can be overriden when you want to change
+test.unit.folder property.
+
+continue.after.failing.tests - controls behavior of running tests on all modules
+in suite. Default value is "true", which causes suite.test target to continue
+with another module even if tests in previous module failed. Set to "false"
+in your suite's project.properties to force test target to stop after tests
+in one module failed. In module project this controls whether test target
+fails when tests fail (when set to "false" or unset) or succeeds even if
+test failed (when set to "true").
+
+extra.test.libs.dir - directory with extra libraries needed for test run.
+
+tools.jar [since 5.0u1] - set to location of tools.jar in active JDK. Useful in
+case your module needs to compile against JDK-only classes. Meaningless on Mac
+OS X.
+
+To support builds of JNLP-based applications additional properties may be used
+or redefined in JNLP-related targets:
+
+jnlp.servlet.jar - must point to jnlp-servlet.jar as provided by JDK 5 in
+ the directory sample/jnlp/servlet/jnlp-servlet.jar if one wants to build
+ a packaged war file of JNLP version of your suite
+
+jnlp.dest.dir - the location where to generate the JNLP files and signed
+ jars. By default it is your ${suite.dir}/build/jnlp
+
+jnlp.master.dir - (category='private') location of a directory in which
+ to generate pieces of master JNLP file to be included in the resources
+ section.
+
+jnlp.signjar.alias -
+jnlp.signjar.keystore -
+jnlp.signjar.password - allow you to sign your app with your own private key, if
+ unspecified then a default keystore is generated. Nice for trying things for
+ the first time, but not for production, then you very likely want to generate
+ your key and set these properties
+jnlp.signjar.vendor - you can override this to be the default dname for the keystore
+
+jnlp.platform.codebase - can point to a shared repository which can be generated
+ by ant -f nbbuild/build.xml build-jnlp. Then your WAR file will contain only
+ modules of your suite and platform modules will be referenced by the value of
+ this property. Sample values with prebuilt binaries (good for testing):
+http://bits.netbeans.org/6.5/jnlp/
+http://bits.netbeans.org/6.7/fcs/jnlp/
+http://deadlock.netbeans.org/hudson/job/ide-jnlp/lastStableBuild/artifact/nbbuild/build/jnlp/
+
+jnlp.indirect.jars [since 6.0] - optional pattern of JARs in the cluster to load
+ in JNLP mode even though they are not listed as Class-Path extensions of the
+ module JAR. The module ought not directly refer to classes in these JARs (it
+ could not do so in non-JNLP mode) but it may load them reflectively using
+ InstalledFileLocator using the same path in regular as in JNLP mode. Note that
+ the physical path on disk to the resulting JAR will not necessarily contain
+ the directory prefix that the JAR in the cluster uses, so do not expect that
+ jar.getParentFile() is meaningful. The implementation creates an empty JAR
+ entry META-INF/clusterpath/$path where $path is the ('/'-separated) path
+ within the cluster where the JAR would be found in a normal installation.
+
+jnlp.indirect.files [since 7.0M1] - optional pattern of files in the cluster to
+ load in JNLP mode. The module may load these files using InstalledFileLocator
+ using the same path in regular as in JNLP mode. Note that the physical path on
+ disk to the resulting file will not necessarily contain the directory prefix
+ that the file in the cluster uses, so do not expect that file.getParentFile()
+ is meaningful. The implementation creates a JAR entry META-INF/files/$path
+ where $path is the ('/'-separated) path within the cluster where the file
+ would be found in a normal installation.
+
+jnlp.verify.excludes - the default implementation of "jnlp" task in common.xml
+ does verification and compares that all files from module NBM are really
+ referenced from the JNLP file. Sometimes not all of them need to be, for
+ them you can put their full names (relative to your cluster root) into this
+ property and separate them by comma.
+
+jnlp.permissions - allows altering of the fragment in the resulting .jnlp file
+ that sets the permissions for individual modules. The default value is
+ <security><all-permissions/></security> when jnlp.sign.jars
+ is true, <security/> when jnlp.sign.jars is false.
+ If you want to change the default to something else please define the value
+ of the property.
+
+jnlp.sign.jars [since 6.0] - defaults to true. If set to false the jars
+ will not be signed, only the main (startup) jar. This should allow for
+ faster startup but might compromise JNLP security. Use with extreme care.
+
+jnlp.generate.versions [since 6.7] - Defaults to false, which means versioning
+ info is not generated (see
+ http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/downloadservletguide.html#resources).
+ If set true, build-jnlp target creates versioning info in jnlp descriptors and version.xml files.
+ This allows for incremental updates of Webstart applications, but requires download via
+ JnlpDownloadServlet (thus run-jnlp and debug-jnlp does not create versioning info even with this
+ property set to true).
+
+[XXX some of the above should be listed in "Suite Properties"]
+
+
+TARGETS AVAILABLE FOR OVERRIDING IN YOUR build.xml
+--------------------------------------------------
+
+Obscure or mostly internal targets are skipped here, but again examine the
+actual harness script if in doubt. If you want to keep the original
+implementation and just add a before hook, try e.g.
+
+
+
+
+
+
+(some original targets are projectized-common.* rather than harness.*). If you
+want to add an after hook, try e.g.
+
+
+
+
+
+basic-init - define some properties such as file locations; enough to do a clean
+at least.
+
+build-init - define more properties needed for compiling and other build tasks.
+
+clean - remove all build products: the "build" directory under your project
+directory, and any files left in the build cluster (including
+${extra.module.files}).
+
+compile - compile Java sources for the module.
+
+compile-single - compile selected Java sources (F9).
+
+compile-test-single - compile selected unit test classes (F9).
+
+debug - build module and then start target platform in debug mode. Use from
+within the IDE (there is a context menu item for it) to debug the app.
+
+debug-fix-nb - loads a hotfix for a module class while debugging. Run -> Apply
+Code Changes from the IDE.
+
+debug-fix-test-nb - same, for unit test classes.
+
+debug-test-single-nb - run one single unit test in the debugger (e.g. to see why
+it is failing). Available from the IDE's menus.
+
+files-init - define list of files in the NBM fileset. Use ${extra.module.files}
+rather than overriding this.
+
+init - all normal initialization.
+
+jar - build the module JAR.
+
+jar-prep - prepare to build the module JAR; define ${buildnumber}.
+
+javadoc - build module Javadoc.
+
+jnlp - generetes the JNLP component file for this module and all necessary
+ resources for it into ${jnlp.dest.dir} directory and also a fragment of
+ the master JNLP into ${jnlp.master.dir}
+
+javadoc-nb - same, and open it in a web browser (only from the IDE). Available
+as Build -> Generate Javadoc.
+
+javahelp - build JavaHelp.
+
+nbm - build the NBM. You might override this to give a complex (multipart)
+license text. Copy basic impl from common.xml and edit.
+
+netbeans - build everything needed for the NBM. Do not override; use
+netbeans-extra instead.
+
+netbeans-extra - hook target: does nothing unless overridden, but called when
+building a module. Override to insert any additional build tasks you need to do:
+copying libraries to the cluster, etc.
+
+profile - used from inside the IDE (if the NetBeans profiler is installed) to
+profile the entire application.
+
+profile-test-single-nb - run one unit test under the profiler. Available from the
+IDE's menus if the NetBeans profiler is installed.
+
+release - copies contents of ${release.dir} to ${cluster}.
+
+reload - reloads the module in the target IDE/app to try out changes interactively.
+
+reload-in-ide - reloads the module in the current IDE to try out changes
+interactively. Only available when run from inside NetBeans. Use with care.
+
+run - build module and then run application interactively. Only for external
+modules. Either way, available from context menu in Projects tab.
+
+test - run all unit tests for the module. Run -> Test... in the IDE.
+
+test-generate-html [since 6.5 M2] - can be used after test target to generate
+test reports in html.
+
+test-build - build unit tests for the module.
+
+test-init - define properties used for building and running unit tests.
+
+test-preinit - I'm not sure, actually.
+
+test-single - run a selected unit test only. Available in the IDE's menus.
+
+testuserdir-delete - deletes just the testing user directory (if not currently in use).
+
+verify-class-linkage [since 5.0u1] - checks for possible linkage errors in your module
+and its Class-Path extensions.
+
+SUITE PROPERTIES
+----------------
+
+Some properties are shared with module projects, such as ${cluster}.
+
+app.name - filename of application launchers to create, suite name to create,
+etc.
+
+app.version - version of the application, used in building the MacOS application
+bundle for example. (Since 6.0 beta2)
+
+app.conf - location of an alternative configuration file. If not specified,
+default one from harness/etc/app.conf is taken (Since 6.9)
+
+branding.dir (default "${suite.dir}/branding") - directory containing branding
+overrides.
+
+branding.token - optional token defining an application branding.
+
+enabled.clusters - comma-separated list of cluster names in the target platform
+(e.g. "platform") which should be included in the application. Should be stored
+in platform.properties, not project.properties. Available since 5.0u1. Since 6.5,
+can elide version numbers from the end, e.g. just "platform" suffices.
+
+disabled.clusters - comma-separated list of cluster names in the target platform
+(e.g. "ide") which should be completely excluded from the application.
+DEPRECATED since 5.0u1 in favor of ${enabled.clusters} and ignored if that is nonempty.
+
+disabled.modules - comma-separated list of code name bases of modules in the
+target platform (e.g. "org.netbeans.modules.autoupdate") which should be
+excluded from the application. There is no need to specify modules already
+excluded by ${disabled.clusters} (if used) or by modules from clusters not included
+in ${enabled.clusters}. Since 5.0u1, should be stored in platform.properties,
+not project.properties.
+
+dist.dir - directory (if not 'dist') to place the final application in. Since 6.1.
+
+modules - list of contained modules. Path format; entries resolved against the
+suite directory as needed.
+
+jnlp.codebase [since 5.0u1] - in case one wants to build a static repository not
+packaged in a WAR file, one needs to pass in the full URL for it. By default it
+is specified as "$$codebase" and replaced dynamically by the servlet packaged in
+the WAR file.
+
+
+TARGETS AVAILABLE FOR OVERRIDING IN YOUR SUITE build.xml
+--------------------------------------------------
+
+-init - set up properties. Most importantly, ${modules.sorted} contains a list
+of absolute path names to the base directories of the modules in the suite,
+topologically sorted by build order; suitable for use with , for
+example. Some other basic properties like ${netbeans.dest.dir} will also be
+defined.
+
+branding - building branding JARs, if applicable. Example: if ${branding.token}
+is "foo", then a file such as
+
+ ${branding.dir}/modules/org-netbeans-modules-x.jar/org/netbeans/modules/x/resources/Bundle.properties
+
+will be packed into
+
+ ${cluster}/modules/locale/org-netbeans-modules-x_foo.jar!/org/netbeans/modules/x/resources/Bundle_foo.properties
+
+build - build all suite modules.
+
+build-jnlp - builds a JNLP WAR file from your application suitable for
+publishing in a Java EE container.
+
+build-mac [since 5.0u2] - creates a Mac OS X application.
+
+build-zip - builds a ZIP file containing your application including launchers.
+
+clean - clean everything.
+
+debug - like run, but run in the JPDA debugger. (Only available from inside the
+IDE.)
+
+debug-jnlp - starts debuging of your JNLP application (works only from NetBeans IDE)
+
+nbms [since 5.0u1] - creates NBMs for all modules in the suite, and generates
+an XML descriptor listing them suitable for use from Auto Update.
+
+profile - used from inside the NetBeans IDE to profile the entire suite
+
+run - start application for testing.
+
+run-jnlp - executes your JNLP application (currently from local files)
+
+test - run all module unit tests. Since NetBeans 6.8 runs tests of all suite modules
+by default, even if some of them fails and target succeeds regardless of test status.
+When property 'continue.after.failing.tests' is set to 'false', this target fails
+immediately after tests in some module fail and does not continue testing the rest
+of the suite (this was the default up to version 6.7).
+
+testuserdir-delete - deletes just the testing user directory (if not currently in use).
+
+CONTENTS OF YOUR manifest.mf
+----------------------------
+
+This file is just a prototype of the module JAR manifest, as described in the
+Modules API. It must contain the attribute OpenIDE-Module and is strongly
+encouraged to contain also OpenIDE-Module-Localizing-Bundle; other attributes
+are generally optional.
+
+Several attributes in the main section should *not* be written into this file as
+they are automatically generated during the build:
+
+ Class-Path
+ OpenIDE-Module-Build-Version
+ OpenIDE-Module-Friends
+ OpenIDE-Module-Implementation-Version (unless you are exporting an impl API)
+ OpenIDE-Module-Module-Dependencies
+ OpenIDE-Module-Public-Packages
+ OpenIDE-Module-Specification-Version (unless you are *not* using spec.version.base)
+
+Do not forget that manifest files must begin with the magic phrase
+
+ Manifest-Version: 1.0
+
+and to be safe should end in *two* newlines.
+
+TEST COVERAGE SUPPORT SPI
+-------------------------
+
+There is a support for test coverage measurement for apisupport projects
+since 6.7. There is a general contract under which alternative
+implementations may by added (in case of multiple impls present, only
+one is used). NetBeans 6.7 and 6.8 use Cobertura implementation.
+
+A contract for test coverage implementation for module projects is to
+create Ant script testcoverage.xml in 'harness' cluster. Script
+must:
+
+ * reside directly in root folder of the cluster
+ * set property testcoverage.present to true outside of any target
+ * define target 'coverage-report' in the script
+ * set property testcoverage.report.dir in 'coverage-report' target to dir
+ with index.html file with results.
+ * As of 6.8, unit and functional tests are supported.
+
+A contract for test coverage implementation for suite projects is to
+create Ant script testcoverage-suite.xml in 'harness' cluster. Script
+must:
+
+ * reside directly in root folder of the cluster
+ * set property testcoverage.suite.present to true outside of any target
+ * define target 'coverage-report' in the script
+ * set property testcoverage.report.dir in 'coverage-report' target to dir
+ with index.html file with results.
+ * As of 6.8, only unit tests are supported for suite projects.
+
+Clients should make no other assumptions beyond these contracts. All
+other related files must be stored in 'testcoverage/'
+subfolder.
+
+
+----------------
+Hey Emacs!
+Local Variables:
+mode: text
+fill-column: 80
+End:
diff --git a/sdk/harness/antlib/bindex-2.2.jar b/sdk/harness/antlib/bindex-2.2.jar
new file mode 100644
index 000000000..8cdbac398
Binary files /dev/null and b/sdk/harness/antlib/bindex-2.2.jar differ
diff --git a/sdk/harness/antlib/jsearch-2.0_05.jar b/sdk/harness/antlib/jsearch-2.0_05.jar
new file mode 100644
index 000000000..9209c72ee
Binary files /dev/null and b/sdk/harness/antlib/jsearch-2.0_05.jar differ
diff --git a/sdk/harness/build.xml b/sdk/harness/build.xml
new file mode 100644
index 000000000..557ce6125
--- /dev/null
+++ b/sdk/harness/build.xml
@@ -0,0 +1,303 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [NO LICENSE SPECIFIED]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ You must set 'jhall.jar' (e.g. in private.properties) to the location of jsearch.jar from a JavaHelp distribution
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${javadoc.title}
+ ${javadoc.header}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
diff --git a/sdk/harness/common.xml b/sdk/harness/common.xml
new file mode 100644
index 000000000..2860f6882
--- /dev/null
+++ b/sdk/harness/common.xml
@@ -0,0 +1,1028 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Basic matching module files: ${module.files.toString}
+
+
+
+
+
+
+
+
+
+ You have to provide value to jnlp.dest.dir property!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Missing test dependency
+ Runtime classpath: ${test.@{test.type}.runtime.cp}
+ Compile classpath: ${test.@{test.type}.compile.cp}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Report URL: ${test.report.url}
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set test.includes
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+
+
+ Must set test.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set test.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set main.class.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set main.class.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set main.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set fix.class to e.g. org/netbeans/modules/foo/Bar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set profile.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ You must define e.g. javadoc.arch=$${basedir}/arch.xml in project.properties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Will not delete ${test.user.dir} because ${test.user.dir.lock} still exists; kill any running process and delete lock file if necessary
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Property testcoverage.unit.report.dir not set. Test coverage script may be missing in ${harness.dir}.
+
+
+
+
+
diff --git a/sdk/harness/config/Modules/org-netbeans-insane.xml b/sdk/harness/config/Modules/org-netbeans-insane.xml
new file mode 100644
index 000000000..3bbc58be0
--- /dev/null
+++ b/sdk/harness/config/Modules/org-netbeans-insane.xml
@@ -0,0 +1,9 @@
+
+
+
+ true
+ false
+ modules/org-netbeans-insane.jar
+ false
+
diff --git a/sdk/harness/config/Modules/org-netbeans-libs-nbi-ant.xml b/sdk/harness/config/Modules/org-netbeans-libs-nbi-ant.xml
new file mode 100644
index 000000000..435dabeb7
--- /dev/null
+++ b/sdk/harness/config/Modules/org-netbeans-libs-nbi-ant.xml
@@ -0,0 +1,9 @@
+
+
+
+ true
+ false
+ modules/org-netbeans-libs-nbi-ant.jar
+ false
+
diff --git a/sdk/harness/config/Modules/org-netbeans-libs-nbi-engine.xml b/sdk/harness/config/Modules/org-netbeans-libs-nbi-engine.xml
new file mode 100644
index 000000000..427a13634
--- /dev/null
+++ b/sdk/harness/config/Modules/org-netbeans-libs-nbi-engine.xml
@@ -0,0 +1,9 @@
+
+
+
+ true
+ false
+ modules/org-netbeans-libs-nbi-engine.jar
+ false
+
diff --git a/sdk/harness/config/Modules/org-netbeans-modules-apisupport-harness.xml b/sdk/harness/config/Modules/org-netbeans-modules-apisupport-harness.xml
new file mode 100644
index 000000000..b8b90ae97
--- /dev/null
+++ b/sdk/harness/config/Modules/org-netbeans-modules-apisupport-harness.xml
@@ -0,0 +1,9 @@
+
+
+
+ true
+ false
+ modules/org-netbeans-modules-apisupport-harness.jar
+ false
+
diff --git a/sdk/harness/config/Modules/org-netbeans-modules-apisupport-tc-cobertura.xml b/sdk/harness/config/Modules/org-netbeans-modules-apisupport-tc-cobertura.xml
new file mode 100644
index 000000000..c39efe8d0
--- /dev/null
+++ b/sdk/harness/config/Modules/org-netbeans-modules-apisupport-tc-cobertura.xml
@@ -0,0 +1,9 @@
+
+
+
+ true
+ false
+ modules/org-netbeans-modules-apisupport-tc-cobertura.jar
+ false
+
diff --git a/sdk/harness/config/Modules/org-netbeans-modules-jellytools-platform.xml b/sdk/harness/config/Modules/org-netbeans-modules-jellytools-platform.xml
new file mode 100644
index 000000000..eafdf5adf
--- /dev/null
+++ b/sdk/harness/config/Modules/org-netbeans-modules-jellytools-platform.xml
@@ -0,0 +1,9 @@
+
+
+
+ true
+ false
+ modules/org-netbeans-modules-jellytools-platform.jar
+ false
+
diff --git a/sdk/harness/config/Modules/org-netbeans-modules-jemmy.xml b/sdk/harness/config/Modules/org-netbeans-modules-jemmy.xml
new file mode 100644
index 000000000..5b409afce
--- /dev/null
+++ b/sdk/harness/config/Modules/org-netbeans-modules-jemmy.xml
@@ -0,0 +1,9 @@
+
+
+
+ true
+ false
+ modules/org-netbeans-modules-jemmy.jar
+ false
+
diff --git a/sdk/harness/config/Modules/org-netbeans-modules-nbjunit.xml b/sdk/harness/config/Modules/org-netbeans-modules-nbjunit.xml
new file mode 100644
index 000000000..1cd0bf6f7
--- /dev/null
+++ b/sdk/harness/config/Modules/org-netbeans-modules-nbjunit.xml
@@ -0,0 +1,9 @@
+
+
+
+ true
+ false
+ modules/org-netbeans-modules-nbjunit.jar
+ false
+
diff --git a/sdk/harness/etc/Info.plist b/sdk/harness/etc/Info.plist
new file mode 100644
index 000000000..73b9dd043
--- /dev/null
+++ b/sdk/harness/etc/Info.plist
@@ -0,0 +1,30 @@
+
+
+
+
+
+ CFBundleName
+ ${app.name}
+
+ CFBundleVersion
+ ${app.version}
+
+ CFBundleExecutable
+ ${app.name}
+
+ CFBundlePackageType
+ APPL
+
+ CFBundleShortVersionString
+ ${app.version}
+
+ CFBundleSignature
+ ????
+
+ CFBundleInfoDictionaryVersion
+ 6.0
+
+ CFBundleIconFile
+ ${app.name}.icns
+
+
\ No newline at end of file
diff --git a/sdk/harness/etc/app.conf b/sdk/harness/etc/app.conf
new file mode 100644
index 000000000..c5e2a961a
--- /dev/null
+++ b/sdk/harness/etc/app.conf
@@ -0,0 +1,14 @@
+# ${HOME} will be replaced by user home directory according to platform
+default_userdir="${HOME}/.${APPNAME}/dev"
+default_mac_userdir="${HOME}/Library/Application Support/${APPNAME}/dev"
+
+# options used by the launcher by default, can be overridden by explicit
+# command line switches
+default_options="--branding ${branding.token} -J-Xms24m -J-Xmx64m"
+# for development purposes you may wish to append: -J-Dnetbeans.logger.console=true -J-ea
+
+# default location of JDK/JRE, can be overridden by using --jdkhome switch
+#jdkhome="/path/to/jdk"
+
+# clusters' paths separated by path.separator (semicolon on Windows, colon on Unices)
+#extra_clusters=
diff --git a/sdk/harness/etc/applicationIcon.icns b/sdk/harness/etc/applicationIcon.icns
new file mode 100644
index 000000000..8ffb8d7de
Binary files /dev/null and b/sdk/harness/etc/applicationIcon.icns differ
diff --git a/sdk/harness/jdk.xml b/sdk/harness/jdk.xml
new file mode 100644
index 000000000..1ff38c344
--- /dev/null
+++ b/sdk/harness/jdk.xml
@@ -0,0 +1,242 @@
+
+
+
+
+
+ Permits selection of a JDK to use when building and running NetBeans.
+ For details on usage, see apisupport/harness/release/README (in sources)
+ or harness/README (in binaries). Cf. issue #63541.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ nbjdk.active=${nbjdk.active} nbjdk.home=${nbjdk.home} nbjdk.java=${nbjdk.java} nbjdk.javac=${nbjdk.javac} nbjdk.javadoc=${nbjdk.javadoc} nbjdk.bootclasspath=${nbjdk.bootclasspath} nbjdk.valid=${nbjdk.valid} have-jdk-1.4=${have-jdk-1.4} have-jdk-1.5=${have-jdk-1.5} have-jdk-1.6=${have-jdk-1.6} have-jdk-1.7=${have-jdk-1.7}
+
+
+
+
+ Warning: nbjdk.active=${nbjdk.active} or nbjdk.home=${nbjdk.home} is an invalid Java platform; ignoring and using ${jdkhome.presumed}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/jnlp.xml b/sdk/harness/jnlp.xml
new file mode 100644
index 000000000..ee464c1f1
--- /dev/null
+++ b/sdk/harness/jnlp.xml
@@ -0,0 +1,454 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $${app.title}
+ $${app.title} vendor
+ $${app.name} application
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ --branding
+ $${branding.token}
+
+
+]]>
+
+
+
+
+ $${app.title}
+ $${app.title} vendor
+ $${app.name} application
+
+
+ $${jnlp.permissions}
+
+ $${jnlp.branding.jars}
+
+
+
+]]>
+
+
+
+ Must have set at least an application name ('app.name')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JnlpDownloadServlet
+ jnlp.sample.servlet.JnlpDownloadServlet
+
+
+ JnlpDownloadServlet
+ *.jnlp
+
+
+]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Your JNLP file is generated at ${jnlp.dest.dir}/master.jnlp
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/jnlp/jnlp-launcher.jar b/sdk/harness/jnlp/jnlp-launcher.jar
new file mode 100644
index 000000000..d4982703b
Binary files /dev/null and b/sdk/harness/jnlp/jnlp-launcher.jar differ
diff --git a/sdk/harness/launchers/app.exe b/sdk/harness/launchers/app.exe
new file mode 100644
index 000000000..fef9f2fc6
Binary files /dev/null and b/sdk/harness/launchers/app.exe differ
diff --git a/sdk/harness/launchers/app.sh b/sdk/harness/launchers/app.sh
new file mode 100644
index 000000000..d3982ee5c
--- /dev/null
+++ b/sdk/harness/launchers/app.sh
@@ -0,0 +1,104 @@
+#!/bin/sh
+
+#
+# resolve symlinks
+#
+
+PRG=$0
+
+while [ -h "$PRG" ]; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null`
+ if expr "$link" : '^/' 2> /dev/null >/dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+done
+
+progdir=`dirname "$PRG"`
+APPNAME=`basename "$0"`
+
+if [ -f "$progdir/../etc/$APPNAME".conf ] ; then
+ . "$progdir/../etc/$APPNAME".conf
+fi
+
+# XXX does not correctly deal with spaces in non-userdir params
+args=""
+
+case "`uname`" in
+ Darwin*)
+ userdir="${default_mac_userdir}"
+ ;;
+ *)
+ userdir="${default_userdir}"
+ ;;
+esac
+while [ $# -gt 0 ] ; do
+ case "$1" in
+ --userdir) shift; if [ $# -gt 0 ] ; then userdir="$1"; fi
+ ;;
+ *) args="$args \"$1\""
+ ;;
+ esac
+ shift
+done
+
+if [ -f "${userdir}/etc/$APPNAME".conf ] ; then
+ . "${userdir}/etc/$APPNAME".conf
+fi
+
+if [ -n "$jdkhome" -a \! -d "$jdkhome" -a -d "$progdir/../$jdkhome" ]; then
+ # #74333: permit jdkhome to be defined as relative to app dir
+ jdkhome="$progdir/../$jdkhome"
+fi
+
+readClusters() {
+ if [ -x /usr/ucb/echo ]; then
+ echo=/usr/ucb/echo
+ else
+ echo=echo
+ fi
+ while read X; do
+ if [ "$X" \!= "" ]; then
+ $echo "$progdir/../$X"
+ fi
+ done
+}
+
+clusters=`(cat "$progdir/../etc/$APPNAME".clusters; echo) | readClusters | tr '\012' ':'`
+
+if [ ! -z "$extra_clusters" ] ; then
+ clusters="$clusters:$extra_clusters"
+fi
+
+nbexec=`echo "$progdir"/../platform*/lib/nbexec`
+
+case "`uname`" in
+ Darwin*)
+ eval exec sh '"$nbexec"' \
+ --jdkhome '"$jdkhome"' \
+ -J-Dcom.apple.mrj.application.apple.menu.about.name='"$APPNAME"' \
+ -J-Xdock:name='"$APPNAME"' \
+ '"-J-Xdock:icon=$progdir/../../$APPNAME.icns"' \
+ --clusters '"$clusters"' \
+ --userdir '"${userdir}"' \
+ ${default_options} \
+ "$args"
+ ;;
+ *)
+ sh=sh
+ # #73162: Ubuntu uses the ancient Bourne shell, which does not implement trap well.
+ if [ -x /bin/bash ]
+ then
+ sh=/bin/bash
+ fi
+ eval exec $sh '"$nbexec"' \
+ --jdkhome '"$jdkhome"' \
+ --clusters '"$clusters"' \
+ --userdir '"${userdir}"' \
+ ${default_options} \
+ "$args"
+ exit 1
+ ;;
+esac
diff --git a/sdk/harness/launchers/pre7_app.exe b/sdk/harness/launchers/pre7_app.exe
new file mode 100644
index 000000000..c078faae1
Binary files /dev/null and b/sdk/harness/launchers/pre7_app.exe differ
diff --git a/sdk/harness/launchers/pre7_app_w.exe b/sdk/harness/launchers/pre7_app_w.exe
new file mode 100644
index 000000000..83d9e3ecd
Binary files /dev/null and b/sdk/harness/launchers/pre7_app_w.exe differ
diff --git a/sdk/harness/modules/ext/jemmy-2.3.0.0.jar b/sdk/harness/modules/ext/jemmy-2.3.0.0.jar
new file mode 100644
index 000000000..e02d1b50d
Binary files /dev/null and b/sdk/harness/modules/ext/jemmy-2.3.0.0.jar differ
diff --git a/sdk/harness/modules/ext/locale/nbi-engine_ja.jar b/sdk/harness/modules/ext/locale/nbi-engine_ja.jar
new file mode 100644
index 000000000..11867211d
Binary files /dev/null and b/sdk/harness/modules/ext/locale/nbi-engine_ja.jar differ
diff --git a/sdk/harness/modules/ext/locale/nbi-engine_pt_BR.jar b/sdk/harness/modules/ext/locale/nbi-engine_pt_BR.jar
new file mode 100644
index 000000000..9844c6987
Binary files /dev/null and b/sdk/harness/modules/ext/locale/nbi-engine_pt_BR.jar differ
diff --git a/sdk/harness/modules/ext/locale/nbi-engine_zh_CN.jar b/sdk/harness/modules/ext/locale/nbi-engine_zh_CN.jar
new file mode 100644
index 000000000..363b89d4e
Binary files /dev/null and b/sdk/harness/modules/ext/locale/nbi-engine_zh_CN.jar differ
diff --git a/sdk/harness/modules/ext/nbi-ant-tasks.jar b/sdk/harness/modules/ext/nbi-ant-tasks.jar
new file mode 100644
index 000000000..f3407af3e
Binary files /dev/null and b/sdk/harness/modules/ext/nbi-ant-tasks.jar differ
diff --git a/sdk/harness/modules/ext/nbi-engine.jar b/sdk/harness/modules/ext/nbi-engine.jar
new file mode 100644
index 000000000..b5c6a497d
Binary files /dev/null and b/sdk/harness/modules/ext/nbi-engine.jar differ
diff --git a/sdk/harness/modules/ext/nbi-registries-management.jar b/sdk/harness/modules/ext/nbi-registries-management.jar
new file mode 100644
index 000000000..f88cd12b0
Binary files /dev/null and b/sdk/harness/modules/ext/nbi-registries-management.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-insane_ja.jar b/sdk/harness/modules/locale/org-netbeans-insane_ja.jar
new file mode 100644
index 000000000..8bdf8e9c5
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-insane_ja.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-insane_pt_BR.jar b/sdk/harness/modules/locale/org-netbeans-insane_pt_BR.jar
new file mode 100644
index 000000000..9aab9ee04
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-insane_pt_BR.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-insane_zh_CN.jar b/sdk/harness/modules/locale/org-netbeans-insane_zh_CN.jar
new file mode 100644
index 000000000..1df98483e
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-insane_zh_CN.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-libs-nbi-ant_ja.jar b/sdk/harness/modules/locale/org-netbeans-libs-nbi-ant_ja.jar
new file mode 100644
index 000000000..86b445851
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-libs-nbi-ant_ja.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-libs-nbi-ant_pt_BR.jar b/sdk/harness/modules/locale/org-netbeans-libs-nbi-ant_pt_BR.jar
new file mode 100644
index 000000000..97f4065de
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-libs-nbi-ant_pt_BR.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-libs-nbi-ant_zh_CN.jar b/sdk/harness/modules/locale/org-netbeans-libs-nbi-ant_zh_CN.jar
new file mode 100644
index 000000000..9de8317b7
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-libs-nbi-ant_zh_CN.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-libs-nbi-engine_ja.jar b/sdk/harness/modules/locale/org-netbeans-libs-nbi-engine_ja.jar
new file mode 100644
index 000000000..5ffb941fc
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-libs-nbi-engine_ja.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-libs-nbi-engine_pt_BR.jar b/sdk/harness/modules/locale/org-netbeans-libs-nbi-engine_pt_BR.jar
new file mode 100644
index 000000000..9f0dc704f
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-libs-nbi-engine_pt_BR.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-libs-nbi-engine_zh_CN.jar b/sdk/harness/modules/locale/org-netbeans-libs-nbi-engine_zh_CN.jar
new file mode 100644
index 000000000..2285633c6
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-libs-nbi-engine_zh_CN.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-apisupport-harness_ja.jar b/sdk/harness/modules/locale/org-netbeans-modules-apisupport-harness_ja.jar
new file mode 100644
index 000000000..f3027701c
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-apisupport-harness_ja.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-apisupport-harness_pt_BR.jar b/sdk/harness/modules/locale/org-netbeans-modules-apisupport-harness_pt_BR.jar
new file mode 100644
index 000000000..8cff7dd5e
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-apisupport-harness_pt_BR.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-apisupport-harness_zh_CN.jar b/sdk/harness/modules/locale/org-netbeans-modules-apisupport-harness_zh_CN.jar
new file mode 100644
index 000000000..0bddd39e3
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-apisupport-harness_zh_CN.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-apisupport-tc-cobertura_ja.jar b/sdk/harness/modules/locale/org-netbeans-modules-apisupport-tc-cobertura_ja.jar
new file mode 100644
index 000000000..68b7901dd
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-apisupport-tc-cobertura_ja.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-apisupport-tc-cobertura_pt_BR.jar b/sdk/harness/modules/locale/org-netbeans-modules-apisupport-tc-cobertura_pt_BR.jar
new file mode 100644
index 000000000..b71ca2cd2
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-apisupport-tc-cobertura_pt_BR.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-apisupport-tc-cobertura_zh_CN.jar b/sdk/harness/modules/locale/org-netbeans-modules-apisupport-tc-cobertura_zh_CN.jar
new file mode 100644
index 000000000..ec7562b2f
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-apisupport-tc-cobertura_zh_CN.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-jellytools-platform_ja.jar b/sdk/harness/modules/locale/org-netbeans-modules-jellytools-platform_ja.jar
new file mode 100644
index 000000000..5e9a8fced
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-jellytools-platform_ja.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-jellytools-platform_pt_BR.jar b/sdk/harness/modules/locale/org-netbeans-modules-jellytools-platform_pt_BR.jar
new file mode 100644
index 000000000..af87a63be
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-jellytools-platform_pt_BR.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-jellytools-platform_zh_CN.jar b/sdk/harness/modules/locale/org-netbeans-modules-jellytools-platform_zh_CN.jar
new file mode 100644
index 000000000..30a36fee2
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-jellytools-platform_zh_CN.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-jemmy_ja.jar b/sdk/harness/modules/locale/org-netbeans-modules-jemmy_ja.jar
new file mode 100644
index 000000000..e7d292e8e
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-jemmy_ja.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-jemmy_pt_BR.jar b/sdk/harness/modules/locale/org-netbeans-modules-jemmy_pt_BR.jar
new file mode 100644
index 000000000..652c39e20
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-jemmy_pt_BR.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-jemmy_zh_CN.jar b/sdk/harness/modules/locale/org-netbeans-modules-jemmy_zh_CN.jar
new file mode 100644
index 000000000..be07305d7
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-jemmy_zh_CN.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-nbjunit_ja.jar b/sdk/harness/modules/locale/org-netbeans-modules-nbjunit_ja.jar
new file mode 100644
index 000000000..644fd0de3
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-nbjunit_ja.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-nbjunit_pt_BR.jar b/sdk/harness/modules/locale/org-netbeans-modules-nbjunit_pt_BR.jar
new file mode 100644
index 000000000..315495ee7
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-nbjunit_pt_BR.jar differ
diff --git a/sdk/harness/modules/locale/org-netbeans-modules-nbjunit_zh_CN.jar b/sdk/harness/modules/locale/org-netbeans-modules-nbjunit_zh_CN.jar
new file mode 100644
index 000000000..fce112b49
Binary files /dev/null and b/sdk/harness/modules/locale/org-netbeans-modules-nbjunit_zh_CN.jar differ
diff --git a/sdk/harness/modules/org-netbeans-insane.jar b/sdk/harness/modules/org-netbeans-insane.jar
new file mode 100644
index 000000000..6eabc1485
Binary files /dev/null and b/sdk/harness/modules/org-netbeans-insane.jar differ
diff --git a/sdk/harness/modules/org-netbeans-libs-nbi-ant.jar b/sdk/harness/modules/org-netbeans-libs-nbi-ant.jar
new file mode 100644
index 000000000..3f8c07337
Binary files /dev/null and b/sdk/harness/modules/org-netbeans-libs-nbi-ant.jar differ
diff --git a/sdk/harness/modules/org-netbeans-libs-nbi-engine.jar b/sdk/harness/modules/org-netbeans-libs-nbi-engine.jar
new file mode 100644
index 000000000..d20b09381
Binary files /dev/null and b/sdk/harness/modules/org-netbeans-libs-nbi-engine.jar differ
diff --git a/sdk/harness/modules/org-netbeans-modules-apisupport-harness.jar b/sdk/harness/modules/org-netbeans-modules-apisupport-harness.jar
new file mode 100644
index 000000000..9ff19c182
Binary files /dev/null and b/sdk/harness/modules/org-netbeans-modules-apisupport-harness.jar differ
diff --git a/sdk/harness/modules/org-netbeans-modules-apisupport-tc-cobertura.jar b/sdk/harness/modules/org-netbeans-modules-apisupport-tc-cobertura.jar
new file mode 100644
index 000000000..b421470cf
Binary files /dev/null and b/sdk/harness/modules/org-netbeans-modules-apisupport-tc-cobertura.jar differ
diff --git a/sdk/harness/modules/org-netbeans-modules-jellytools-platform.jar b/sdk/harness/modules/org-netbeans-modules-jellytools-platform.jar
new file mode 100644
index 000000000..bebda22cc
Binary files /dev/null and b/sdk/harness/modules/org-netbeans-modules-jellytools-platform.jar differ
diff --git a/sdk/harness/modules/org-netbeans-modules-jemmy.jar b/sdk/harness/modules/org-netbeans-modules-jemmy.jar
new file mode 100644
index 000000000..f147f3c3f
Binary files /dev/null and b/sdk/harness/modules/org-netbeans-modules-jemmy.jar differ
diff --git a/sdk/harness/modules/org-netbeans-modules-nbjunit.jar b/sdk/harness/modules/org-netbeans-modules-nbjunit.jar
new file mode 100644
index 000000000..5464ab79d
Binary files /dev/null and b/sdk/harness/modules/org-netbeans-modules-nbjunit.jar differ
diff --git a/sdk/harness/nbi/stub/build.properties b/sdk/harness/nbi/stub/build.properties
new file mode 100644
index 000000000..a0ebacdb4
--- /dev/null
+++ b/sdk/harness/nbi/stub/build.properties
@@ -0,0 +1,48 @@
+#
+# The contents of this file are subject to the terms of the Common Development and
+# Distribution License (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.html or
+# http://www.netbeans.org/cddl.txt.
+#
+# When distributing Covered Code, include this CDDL Header Notice in each file and
+# include the License file at http://www.netbeans.org/cddl.txt. If applicable, add
+# the following below the CDDL Header, with the fields enclosed by brackets []
+# replaced by your own identifying information:
+#
+# "Portions Copyrighted [year] [name of copyright owner]"
+#
+# The Original Software is NetBeans. The Initial Developer of the Original Software
+# is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun Microsystems, Inc. All
+# Rights Reserved.
+#
+
+output.dir=${basedir}/build
+jarsigner.enabled=false
+pack200.enabled={pack200.enabled}
+core.module.name=nbi
+ext.module.name=ext
+
+nbi.all.dir=${basedir}/nbi_all
+nbi.core.dir=${nbi.all.dir}/${core.module.name}
+nbi.ext.dir=${nbi.all.dir}/${ext.module.name}
+
+temp.file=${nbi.all.dir}/temp.ant.tmp
+environment.properties=${nbi.all.dir}/environment.properties
+
+context.path.token=/nbi/dev
+context.path.replacement=${context.path}
+
+context.dir.token=ROOT = new File\\(".*?"\\);
+context.dir.replacement=ROOT = new File\\("${context.dir}"\);
+
+custom.tasks.cls={nbi.ant.tasks.jar}${path.separator}{nbi.registries.management.jar}${path.separator}{nbi.engine.jar}
+nbi.engine.jar={nbi.engine.jar}
+
+jdk.home={generator-jdk-location-forward-slashes}
+bundles.release.dir={generated-installers-location-forward-slashes}
+bundle.files.prefix={generated-installers-prefix}
+
+target.platforms={product-platforms}
+main.product.uid={product-uid}
\ No newline at end of file
diff --git a/sdk/harness/nbi/stub/build.xml b/sdk/harness/nbi/stub/build.xml
new file mode 100644
index 000000000..4e99e9c37
--- /dev/null
+++ b/sdk/harness/nbi/stub/build.xml
@@ -0,0 +1,202 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+checkout.sources=false
+sources.dir=${nbi.all.dir}
+cvs.module=ext
+
+release.to.server=false
+release.registry.dir=${output.dir}/registry-temp
+
+dont.build.custom.tasks=true
+custom.tasks.cls=${custom.tasks.cls}
+
+build.engine=false
+
+engine.dist.file.name=nbi-engine.jar
+engine.dist.file=${nbi.core.dir}/infra/build/engine/dist/nbi-engine.jar
+
+packaged.data.dir=${basedir}/cache/packaged
+downloads.cache.dir=${basedir}/cache/raw
+
+jarsigner.enabled=${jarsigner.enabled}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Installer(s) for [${target.platforms}] are available at ${bundles.release.dir}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/build.xml b/sdk/harness/nbi/stub/ext/components/products/helloworld/build.xml
new file mode 100644
index 000000000..07f2eba0b
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/components/products/helloworld/build.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+ Builds, tests, and runs the project helloworld.
+
+
+
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/data/Bundle.properties b/sdk/harness/nbi/stub/ext/components/products/helloworld/data/Bundle.properties
new file mode 100644
index 000000000..9a914fa55
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/components/products/helloworld/data/Bundle.properties
@@ -0,0 +1,41 @@
+#
+# 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-2007 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.
+#
+
+product.display.name={product-name}
+product.description={product-description}
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/data/icon.png b/sdk/harness/nbi/stub/ext/components/products/helloworld/data/icon.png
new file mode 100644
index 000000000..f67785a6e
Binary files /dev/null and b/sdk/harness/nbi/stub/ext/components/products/helloworld/data/icon.png differ
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/data/icon48.png b/sdk/harness/nbi/stub/ext/components/products/helloworld/data/icon48.png
new file mode 100644
index 000000000..e8472fcaa
Binary files /dev/null and b/sdk/harness/nbi/stub/ext/components/products/helloworld/data/icon48.png differ
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/manifest.mf b/sdk/harness/nbi/stub/ext/components/products/helloworld/manifest.mf
new file mode 100644
index 000000000..7dd53f8c1
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/components/products/helloworld/manifest.mf
@@ -0,0 +1 @@
+Configuration-Logic-Class: org.mycompany.ConfigurationLogic
\ No newline at end of file
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/nbproject/build-impl.xml b/sdk/harness/nbi/stub/ext/components/products/helloworld/nbproject/build-impl.xml
new file mode 100644
index 000000000..fc868de29
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/components/products/helloworld/nbproject/build-impl.xml
@@ -0,0 +1,631 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set src.dir
+ Must set test.src.dir
+ Must set build.dir
+ Must set dist.dir
+ Must set build.classes.dir
+ Must set dist.javadoc.dir
+ Must set build.test.classes.dir
+ Must set build.test.results.dir
+ Must set build.classes.excludes
+ Must set dist.jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+
+
+
+
+
+ java -cp "${run.classpath.with.dist.jar}" ${main.class}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+ java -jar "${dist.jar.resolved}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must set fix.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+ Must select one file in the IDE or set test.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/nbproject/genfiles.properties b/sdk/harness/nbi/stub/ext/components/products/helloworld/nbproject/genfiles.properties
new file mode 100644
index 000000000..bb6d89299
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/components/products/helloworld/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=b5c7f54a
+build.xml.script.CRC32=16bbb630
+build.xml.stylesheet.CRC32=be360661
+# 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=b5c7f54a
+nbproject/build-impl.xml.script.CRC32=815f74ea
+nbproject/build-impl.xml.stylesheet.CRC32=f1d9da08
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/nbproject/project.properties b/sdk/harness/nbi/stub/ext/components/products/helloworld/nbproject/project.properties
new file mode 100644
index 000000000..28da6c464
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/components/products/helloworld/nbproject/project.properties
@@ -0,0 +1,62 @@
+application.title=helloworld
+application.vendor=dlm198383
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/helloworld.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+excludes=
+includes=**
+jar.compress=false
+javac.classpath=\
+ ${reference.Core_NBI_Engine.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.source=1.5
+javac.target=1.5
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}:\
+ ${libs.junit.classpath}:\
+ ${libs.junit_4.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+meta.inf.dir=${src.dir}/META-INF
+platform.active=default_platform
+project.Core_NBI_Engine=../../../../nbi/engine
+reference.Core_NBI_Engine.jar=${project.Core_NBI_Engine}/dist/nbi-engine.jar
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/nbproject/project.xml b/sdk/harness/nbi/stub/ext/components/products/helloworld/nbproject/project.xml
new file mode 100644
index 000000000..84d37928d
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/components/products/helloworld/nbproject/project.xml
@@ -0,0 +1,26 @@
+
+
+ org.netbeans.modules.java.j2seproject
+
+
+ helloworld
+ 1.6.5
+
+
+
+
+
+
+
+
+
+ Core_NBI_Engine
+ jar
+
+ jar
+ clean
+ jar
+
+
+
+
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/Bundle.properties b/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/Bundle.properties
new file mode 100644
index 000000000..273df84b3
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/Bundle.properties
@@ -0,0 +1,22 @@
+CL.app.name={product-simple-name}
+CL.desktop.shortcut.name={product-name}
+CL.desktop.shortcut.description=
+CL.desktop.shortcut.path=
+CL.unix.icon.name={product-icon-name}
+CL.unix.icon.resource=org/mycompany/{product-icon-name}
+
+
+CL.start.menu.shortcut.name={product-name}
+CL.start.menu.shortcut.name.macosx={product-name}
+CL.start.menu.shortcut.description=
+CL.start.menu.shortcut.path=
+
+CL.install.desktop=Creating shortcut on desktop
+CL.install.start.menu=Creating shortcut in start menu
+CL.uninstall.start.menu=Removing Start Menu entries
+CL.uninstall.desktop=Removing desktop shortcut
+CL.uninstall.remove.userdir=Removing {product-name} userdir
+
+CL.uninstall.error.start.menu=Cannot remove desktop shortcut
+CL.uninstall.error.desktop=Cannot remove Start Menu entries
+
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/ConfigurationLogic.java b/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/ConfigurationLogic.java
new file mode 100644
index 000000000..803ee8a04
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/ConfigurationLogic.java
@@ -0,0 +1,453 @@
+package org.mycompany;
+
+import java.util.List;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Locale;
+import java.util.Map;
+import org.mycompany.wizard.panels.HelloWorldPanel;
+import org.mycompany.installer.utils.applications.NetBeansRCPUtils;
+import org.netbeans.installer.product.components.ProductConfigurationLogic;
+import org.netbeans.installer.product.components.Product;
+import org.netbeans.installer.utils.FileUtils;
+import org.netbeans.installer.utils.helper.RemovalMode;
+import org.netbeans.installer.utils.exceptions.InitializationException;
+import org.netbeans.installer.utils.exceptions.InstallationException;
+import org.netbeans.installer.utils.exceptions.UninstallationException;
+import org.netbeans.installer.utils.progress.Progress;
+import org.netbeans.installer.utils.system.shortcut.FileShortcut;
+import org.netbeans.installer.utils.system.shortcut.LocationType;
+import org.netbeans.installer.utils.system.shortcut.Shortcut;
+import org.netbeans.installer.utils.SystemUtils;
+import org.netbeans.installer.utils.LogManager;
+import org.netbeans.installer.utils.ResourceUtils;
+import org.netbeans.installer.utils.StreamUtils;
+import org.netbeans.installer.utils.StringUtils;
+import org.netbeans.installer.utils.exceptions.NativeException;
+import org.netbeans.installer.wizard.Wizard;
+import org.netbeans.installer.wizard.components.WizardComponent;
+
+public class ConfigurationLogic extends ProductConfigurationLogic {
+
+ private List wizardComponents;
+
+ // constructor //////////////////////////////////////////////////////////////////
+ public ConfigurationLogic() throws InitializationException {
+ wizardComponents = Wizard.loadWizardComponents(
+ WIZARD_COMPONENTS_URI,
+ getClass().getClassLoader());
+ }
+
+ public List getWizardComponents() {
+ return wizardComponents;
+ }
+
+ @Override
+ public boolean allowModifyMode() {
+ return false;
+ }
+
+ @Override
+ public void install(Progress progress) throws InstallationException {
+ final Product product = getProduct();
+ final File installLocation = product.getInstallationLocation();
+ //final FilesList filesList = product.getInstalledFiles();
+ String appName=ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name");
+
+ if (SystemUtils.isMacOS()) {
+ //normen: use parent folder of install dir for icon
+ File f = new File(installLocation.getParentFile(), ICON_MACOSX);
+ if(!f.exists()) {
+ try {
+ FileUtils.writeFile(f,
+ ResourceUtils.getResource(ICON_MACOSX_RESOURCE,
+ getClass().getClassLoader()));
+ getProduct().getInstalledFiles().add(f);
+ } catch (IOException e) {
+ LogManager.log(
+ "... cannot handle icns icon " + f, e); // NOI18N
+ }
+ }
+
+ //normen: rename executable
+ File shortcut=new File(installLocation.getParentFile().getParent()+"/MacOS/executable");
+ if(shortcut.exists()){
+ shortcut.renameTo(new File(installLocation.getParentFile().getParent()+"/MacOS/"+appName));
+ }
+
+ //normen: replace icon + app in Info.plist
+ try {
+ File plist=new File(installLocation.getParentFile().getParentFile(),"Info.plist");
+ FileUtils.modifyFile(plist, "icon.icns", appName+".icns");
+ FileUtils.modifyFile(plist, "executable", appName);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+
+ if (Boolean.parseBoolean(getProperty(HelloWorldPanel.CREATE_DESKTOP_SHORTCUT_PROPERTY))) {
+ LogManager.logIndent(
+ "creating the desktop shortcut for the application"); // NOI18N
+ if (!SystemUtils.isMacOS()) {
+ try {
+ progress.setDetail(getString("CL.install.desktop")); // NOI18N
+
+ if (SystemUtils.isCurrentUserAdmin()) {
+ LogManager.log(
+ "... current user is an administrator " + // NOI18N
+ "-- creating the shortcut for all users"); // NOI18N
+
+ SystemUtils.createShortcut(
+ getDesktopShortcut(installLocation),
+ LocationType.ALL_USERS_DESKTOP);
+
+ product.setProperty(
+ DESKTOP_SHORTCUT_LOCATION_PROPERTY,
+ ALL_USERS_PROPERTY_VALUE);
+ } else {
+ LogManager.log(
+ "... current user is an ordinary user " + // NOI18N
+ "-- creating the shortcut for the current " + // NOI18N
+ "user only"); // NOI18N
+
+ SystemUtils.createShortcut(
+ getDesktopShortcut(installLocation),
+ LocationType.CURRENT_USER_DESKTOP);
+
+ getProduct().setProperty(
+ DESKTOP_SHORTCUT_LOCATION_PROPERTY,
+ CURRENT_USER_PROPERTY_VALUE);
+ }
+ } catch (NativeException e) {
+ LogManager.unindent();
+
+ LogManager.log(
+ getString("CL.install.error.desktop"), // NOI18N
+ e);
+ }
+ } else {
+ LogManager.log(
+ "... skipping this step as we're on Mac OS"); // NOI18N
+ }
+ }
+ LogManager.logUnindent(
+ "... done"); // NOI18N
+
+ /////////////////////////////////////////////
+ // create start menu shortcut
+ if (Boolean.parseBoolean(getProperty(HelloWorldPanel.CREATE_START_MENU_SHORTCUT_PROPERTY))) {
+ LogManager.logIndent(
+ "creating the start menu shortcut for the application"); // NOI18N
+ try {
+ progress.setDetail(getString("CL.install.start.menu")); // NOI18N
+
+ if (SystemUtils.isCurrentUserAdmin()) {
+ LogManager.log(
+ "... current user is an administrator " + // NOI18N
+ "-- creating the shortcut for all users"); // NOI18N
+
+ SystemUtils.createShortcut(
+ getStartMenuShortcut(installLocation),
+ LocationType.ALL_USERS_START_MENU);
+
+ getProduct().setProperty(
+ START_MENU_SHORTCUT_LOCATION_PROPERTY,
+ ALL_USERS_PROPERTY_VALUE);
+ } else {
+ LogManager.log(
+ "... current user is an ordinary user " + // NOI18N
+ "-- creating the shortcut for the current " + // NOI18N
+ "user only"); // NOI18N
+
+ SystemUtils.createShortcut(
+ getStartMenuShortcut(installLocation),
+ LocationType.CURRENT_USER_START_MENU);
+
+ getProduct().setProperty(
+ START_MENU_SHORTCUT_LOCATION_PROPERTY,
+ CURRENT_USER_PROPERTY_VALUE);
+ }
+ } catch (NativeException e) {
+ LogManager.log(
+ getString("CL.install.error.start.menu"), // NOI18N
+ e);
+ }
+ LogManager.logUnindent(
+ "... done"); // NOI18N
+ }
+
+ }
+
+ @Override
+ public void uninstall(Progress progress) throws UninstallationException {
+ final Product product = getProduct();
+ final File installLocation = product.getInstallationLocation();
+
+ //NetBeansUtils.warnNetbeansRunning(installLocation);
+ /////////////////////////////////////////////////////////////////////////////
+ if (Boolean.parseBoolean(getProperty(HelloWorldPanel.CREATE_START_MENU_SHORTCUT_PROPERTY))) {
+ try {
+ progress.setDetail(getString("CL.uninstall.start.menu")); // NOI18N
+
+ final String shortcutLocation =
+ getProduct().getProperty(START_MENU_SHORTCUT_LOCATION_PROPERTY);
+
+ if ((shortcutLocation == null)
+ || shortcutLocation.equals(CURRENT_USER_PROPERTY_VALUE)) {
+ SystemUtils.removeShortcut(
+ getStartMenuShortcut(installLocation),
+ LocationType.CURRENT_USER_START_MENU,
+ true);
+ } else {
+ SystemUtils.removeShortcut(
+ getStartMenuShortcut(installLocation),
+ LocationType.ALL_USERS_START_MENU,
+ true);
+ }
+ } catch (NativeException e) {
+ LogManager.log(
+ getString("CL.uninstall.error.start.menu"), // NOI18N
+ e);
+ }
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+ if (Boolean.parseBoolean(getProperty(HelloWorldPanel.CREATE_DESKTOP_SHORTCUT_PROPERTY))) {
+ if (!SystemUtils.isMacOS()) {
+ try {
+ progress.setDetail(getString("CL.uninstall.desktop")); // NOI18N
+
+ final String shortcutLocation = getProduct().getProperty(
+ DESKTOP_SHORTCUT_LOCATION_PROPERTY);
+
+ if ((shortcutLocation == null)
+ || shortcutLocation.equals(CURRENT_USER_PROPERTY_VALUE)) {
+ SystemUtils.removeShortcut(
+ getDesktopShortcut(installLocation),
+ LocationType.CURRENT_USER_DESKTOP,
+ false);
+ } else {
+ SystemUtils.removeShortcut(
+ getDesktopShortcut(installLocation),
+ LocationType.ALL_USERS_DESKTOP,
+ false);
+ }
+ } catch (NativeException e) {
+ LogManager.log(
+ getString("CL.uninstall.error.desktop"), // NOI18N
+ e);
+ }
+ }
+ }
+
+
+ if (Boolean.getBoolean("remove.app.userdir")) {
+ try {
+ progress.setDetail(getString("CL.uninstall.remove.userdir")); // NOI18N
+ LogManager.logIndent("Removing application`s userdir... ");
+ File userDir = NetBeansRCPUtils.getApplicationUserDirFile(installLocation);
+ LogManager.log("... application userdir location : " + userDir);
+ if (FileUtils.exists(userDir) && FileUtils.canWrite(userDir)) {
+ FileUtils.deleteFile(userDir, true);
+ FileUtils.deleteEmptyParents(userDir);
+ }
+ LogManager.log("... application userdir totally removed");
+ } catch (IOException e) {
+ LogManager.log("Can`t remove application userdir", e);
+ } finally {
+ LogManager.unindent();
+ }
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+ //remove cluster/update files
+ /*
+ try {
+ progress.setDetail(getString("CL.uninstall.update.files")); // NOI18N
+ for(String cluster : CLUSTERS) {
+ File updateDir = new File(installLocation, cluster + File.separator + "update");
+ if ( updateDir.exists()) {
+ FileUtils.deleteFile(updateDir, true);
+ }
+ }
+ } catch (IOException e) {
+ LogManager.log(
+ getString("CL.uninstall.error.update.files"), // NOI18N
+ e);
+ }
+ */
+ /////////////////////////////////////////////////////////////////////////////
+ progress.setPercentage(Progress.COMPLETE);
+ }
+
+ @Override
+ public String getExecutable() {
+ if (SystemUtils.isWindows()) {
+ return EXECUTABLE_WINDOWS;
+ } else {
+ return EXECUTABLE_UNIX;
+ }
+ }
+
+ @Override
+ public String getIcon() {
+ if (SystemUtils.isWindows()) {
+ return ICON_WINDOWS;
+ } else if (SystemUtils.isMacOS()) {
+ return ICON_MACOSX;
+ } else {
+ return ICON_UNIX;
+ }
+ }
+
+ public RemovalMode getRemovalMode() {
+ return RemovalMode.LIST;
+ }
+
+ @Override
+ public boolean registerInSystem() {
+ return true;
+ }
+
+ @Override
+ public boolean requireLegalArtifactSaving() {
+ return false;
+ }
+
+ @Override
+ public boolean requireDotAppForMacOs() {
+ return true;
+ }
+
+ @Override
+ public boolean wrapForMacOs() {
+ return true;
+ }
+
+
+
+ private Shortcut getDesktopShortcut(final File directory) {
+ return getShortcut(
+ getStrings("CL.desktop.shortcut.name"), // NOI18N
+ getStrings("CL.desktop.shortcut.description"), // NOI18N
+ getString("CL.desktop.shortcut.path"), // NOI18N
+ directory);
+ }
+
+ private Shortcut getStartMenuShortcut(final File directory) {
+ if (SystemUtils.isMacOS()) {
+ return getShortcut(
+ getStrings("CL.start.menu.shortcut.name.macosx"), // NOI18N
+ getStrings("CL.start.menu.shortcut.description"), // NOI18N
+ getString("CL.start.menu.shortcut.path"), // NOI18N
+ directory);
+ } else {
+ return getShortcut(
+ getStrings("CL.start.menu.shortcut.name"), // NOI18N
+ getStrings("CL.start.menu.shortcut.description"), // NOI18N
+ getString("CL.start.menu.shortcut.path"), // NOI18N
+ directory);
+ }
+ }
+
+ private Shortcut getShortcut(
+ final Map names,
+ final Map descriptions,
+ final String relativePath,
+ final File location) {
+ final File icon;
+ final File executable;
+
+ if (SystemUtils.isWindows()) {
+ icon = new File(location, ICON_WINDOWS);
+ } else if (SystemUtils.isMacOS()) {
+ icon = new File(location, ICON_MACOSX);
+ } else {
+ icon = new File(location, ICON_UNIX);
+ LogManager.log("... icon file: " + icon);
+ if(!FileUtils.exists(icon)) {
+ LogManager.log("... icon file does not exist: " + icon);
+ InputStream is = null;
+ is = ResourceUtils.getResource(ICON_UNIX_RESOURCE, this.getClass().getClassLoader());
+ if(is!=null) {
+ FileOutputStream fos =null;
+ try {
+ fos = new FileOutputStream(icon);
+ StreamUtils.transferData(is, fos);
+ is.close();
+ fos.close();
+ getProduct().getInstalledFiles().add(icon);
+ } catch (IOException e) {
+ LogManager.log(e);
+ } finally {
+ if(fos!=null) {
+ try {
+ fos.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (SystemUtils.isWindows()) {
+ executable = new File(location, EXECUTABLE_WINDOWS);
+ } else {
+ executable = new File(location, EXECUTABLE_UNIX);
+ }
+ final String name = names.get(new Locale(StringUtils.EMPTY_STRING));
+ final FileShortcut shortcut = new FileShortcut(name, executable);
+ shortcut.setNames(names);
+ shortcut.setDescriptions(descriptions);
+ shortcut.setCategories(SHORTCUT_CATEGORIES);
+ shortcut.setFileName(SHORTCUT_FILENAME);
+ shortcut.setIcon(icon);
+ shortcut.setRelativePath(relativePath);
+ shortcut.setWorkingDirectory(location);
+ shortcut.setModifyPath(true);
+
+ return shortcut;
+ }
+ public static final String SHORTCUT_FILENAME =
+ ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name") + ".desktop"; // NOI18N
+ public static final String[] SHORTCUT_CATEGORIES = new String[]{
+ "Application"
+ };
+ public static final String BIN_SUBDIR =
+ "bin/";
+ public static final String EXECUTABLE_WINDOWS =
+ BIN_SUBDIR
+ + ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name") + ".exe"; // NOI18N
+ public static final String EXECUTABLE_UNIX =
+ BIN_SUBDIR
+ + ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name"); // NOI18N
+ public static final String ICON_WINDOWS =
+ EXECUTABLE_WINDOWS;
+ public static final String ICON_UNIX =
+ ResourceUtils.getString(ConfigurationLogic.class,
+ "CL.unix.icon.name"); // NOI18N
+ public static final String ICON_UNIX_RESOURCE =
+ ResourceUtils.getString(ConfigurationLogic.class,
+ "CL.unix.icon.resource"); // NOI18N
+ public static final String ICON_MACOSX =
+ ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name") + ".icns"; // NOI18N
+ public static final String ICON_MACOSX_RESOURCE =
+ "org/mycompany/" + ResourceUtils.getString(ConfigurationLogic.class, "CL.app.name") + ".icns"; // NOI18N
+ public static final String WIZARD_COMPONENTS_URI =
+ "resource:" + // NOI18N
+ "org/mycompany/wizard.xml"; // NOI18N
+ private static final String DESKTOP_SHORTCUT_LOCATION_PROPERTY =
+ "desktop.shortcut.location"; // NOI18N
+ private static final String START_MENU_SHORTCUT_LOCATION_PROPERTY =
+ "start.menu.shortcut.location"; // NOI18N
+ private static final String ALL_USERS_PROPERTY_VALUE =
+ "all.users"; // NOI18N
+ private static final String CURRENT_USER_PROPERTY_VALUE =
+ "current.user"; // NOI18N
+}
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/wizard.xml b/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/wizard.xml
new file mode 100644
index 000000000..6ce9f158e
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/wizard.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/wizard/panels/Bundle.properties b/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/wizard/panels/Bundle.properties
new file mode 100644
index 000000000..11e94d694
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/wizard/panels/Bundle.properties
@@ -0,0 +1,51 @@
+#
+# 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-2007 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.
+#
+
+################################################################################
+# HelloWorldPanel.java
+P.title={product-name} Installation
+P.description=Choose destination folder.
+P.destination.label.text=&Install {product-name} to:
+P.destination.button.text=B&rowse.....
+
+P.create.desktop.shortcut=Create Desktop icon
+P.create.start.menu.shortcut.windows=Create Start menu entry
+P.create.start.menu.shortcut.unix=Create shortcut in Applications menu
+P.create.start.menu.shortcut.macosx=Create icon in Dock
+
diff --git a/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/wizard/panels/HelloWorldPanel.java b/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/wizard/panels/HelloWorldPanel.java
new file mode 100644
index 000000000..d4c88237f
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/components/products/helloworld/src/org/mycompany/wizard/panels/HelloWorldPanel.java
@@ -0,0 +1,184 @@
+package org.mycompany.wizard.panels;
+
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+import org.netbeans.installer.utils.ResourceUtils;
+import org.netbeans.installer.utils.StringUtils;
+import org.netbeans.installer.utils.SystemUtils;
+import org.netbeans.installer.utils.helper.swing.NbiCheckBox;
+import org.netbeans.installer.wizard.components.panels.DestinationPanel;
+import org.netbeans.installer.wizard.containers.SwingContainer;
+import org.netbeans.installer.wizard.ui.SwingUi;
+import org.netbeans.installer.wizard.ui.WizardUi;
+
+/**
+ *
+ * @author Dmitry Lipin
+ */
+public class HelloWorldPanel extends DestinationPanel {
+
+ public HelloWorldPanel() {
+ setProperty(TITLE_PROPERTY,
+ DEFAULT_TITLE);
+ setProperty(DESCRIPTION_PROPERTY,
+ DEFAULT_DESCRIPTION);
+
+ setProperty(DESTINATION_LABEL_TEXT_PROPERTY,
+ DEFAULT_DESTINATION_LABEL_TEXT);
+ setProperty(DESTINATION_BUTTON_TEXT_PROPERTY,
+ DEFAULT_DESTINATION_BUTTON_TEXT);
+ }
+
+ @Override
+ public WizardUi getWizardUi() {
+ if (wizardUi == null) {
+ wizardUi = new HelloWorldPanelUi(this);
+ }
+
+ return wizardUi;
+ }
+
+ @Override
+ public void initialize() {
+ super.initialize();
+ if(getWizard().getProperty(CREATE_DESKTOP_SHORTCUT_PROPERTY) == null) {
+ getWizard().setProperty(CREATE_DESKTOP_SHORTCUT_PROPERTY, "" + true);
+ }
+ if(getWizard().getProperty(CREATE_START_MENU_SHORTCUT_PROPERTY) == null) {
+ getWizard().setProperty(CREATE_START_MENU_SHORTCUT_PROPERTY, "" + true);
+ }
+ }
+
+
+ public static class HelloWorldPanelUi extends DestinationPanelUi {
+
+ protected HelloWorldPanel panel;
+
+ public HelloWorldPanelUi(HelloWorldPanel panel) {
+ super(panel);
+
+
+ this.panel = panel;
+ }
+
+ public SwingUi getSwingUi(SwingContainer container) {
+ if (swingUi == null) {
+ swingUi = new HelloWorldPanelSwingUi(panel, container);
+ }
+
+ return super.getSwingUi(container);
+ }
+ }
+
+ public static class HelloWorldPanelSwingUi extends DestinationPanelSwingUi {
+
+ protected HelloWorldPanel panel;
+ private NbiCheckBox desktopShortcutComboBox;
+ private NbiCheckBox startMenuShortcutComboBox;
+
+ public HelloWorldPanelSwingUi(
+ final HelloWorldPanel panel,
+ final SwingContainer container) {
+ super(panel, container);
+
+ this.panel = panel;
+
+ initComponents();
+ }
+
+ // protected ////////////////////////////////////////////////////////////////
+ @Override
+ protected void initialize() {
+ desktopShortcutComboBox.setText(CREATE_DESKTOP_SHORTCUT_NAME);
+ desktopShortcutComboBox.setSelected(false);
+ if(Boolean.parseBoolean(panel.getWizard().getProperty(CREATE_DESKTOP_SHORTCUT_PROPERTY))) {
+ desktopShortcutComboBox.doClick();
+ }
+
+ startMenuShortcutComboBox.setText(
+ SystemUtils.isWindows() ? CREATE_START_MENU_SHORTCUT_NAME_WINDOWS :
+ (SystemUtils.isMacOS() ? CREATE_START_MENU_SHORTCUT_NAME_MAC :
+ CREATE_START_MENU_SHORTCUT_NAME_UNIX));
+ startMenuShortcutComboBox.setSelected(false);
+ if(Boolean.parseBoolean(panel.getWizard().getProperty(CREATE_START_MENU_SHORTCUT_PROPERTY))) {
+ startMenuShortcutComboBox.doClick();
+ }
+
+ super.initialize();
+ }
+
+ @Override
+ protected void saveInput() {
+ super.saveInput();
+ panel.getWizard().setProperty(
+ CREATE_DESKTOP_SHORTCUT_PROPERTY,
+ StringUtils.EMPTY_STRING + desktopShortcutComboBox.isSelected());
+
+ panel.getWizard().setProperty(
+ CREATE_START_MENU_SHORTCUT_PROPERTY,
+ StringUtils.EMPTY_STRING + startMenuShortcutComboBox.isSelected());
+ }
+
+ @Override
+ protected String validateInput() {
+ String errorMessage = super.validateInput();
+ return errorMessage;
+ }
+
+ // private //////////////////////////////////////////////////////////////////
+ private void initComponents() {
+ // selectedLocationField ////////////////////////////////////////////////
+ desktopShortcutComboBox = new NbiCheckBox();
+ startMenuShortcutComboBox = new NbiCheckBox();
+
+ // this /////////////////////////////////////////////////////////////////
+ add(desktopShortcutComboBox, new GridBagConstraints(
+ 0, 2, // x, y
+ 2, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.LINE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(15, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+ add(startMenuShortcutComboBox, new GridBagConstraints(
+ 0, 3, // x, y
+ 2, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.LINE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(7, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+
+ }
+ }
+ /////////////////////////////////////////////////////////////////////////////////
+ // Constants
+ public static final String DEFAULT_TITLE =
+ ResourceUtils.getString(HelloWorldPanel.class,
+ "P.title"); // NOI18N
+ public static final String DEFAULT_DESCRIPTION =
+ ResourceUtils.getString(HelloWorldPanel.class,
+ "P.description"); // NOI18N
+ public static final String DEFAULT_DESTINATION_LABEL_TEXT =
+ ResourceUtils.getString(HelloWorldPanel.class,
+ "P.destination.label.text"); // NOI18N
+ public static final String DEFAULT_DESTINATION_BUTTON_TEXT =
+ ResourceUtils.getString(HelloWorldPanel.class,
+ "P.destination.button.text"); // NOI18N
+ public static final String CREATE_DESKTOP_SHORTCUT_NAME =
+ ResourceUtils.getString(HelloWorldPanel.class,
+ "P.create.desktop.shortcut"); // NOI18N
+ public static final String CREATE_START_MENU_SHORTCUT_NAME_WINDOWS =
+ ResourceUtils.getString(HelloWorldPanel.class,
+ "P.create.start.menu.shortcut.windows"); // NOI18N
+ public static final String CREATE_START_MENU_SHORTCUT_NAME_UNIX =
+ ResourceUtils.getString(HelloWorldPanel.class,
+ "P.create.start.menu.shortcut.unix"); // NOI18N
+ public static final String CREATE_START_MENU_SHORTCUT_NAME_MAC =
+ ResourceUtils.getString(HelloWorldPanel.class,
+ "P.create.start.menu.shortcut.macosx"); // NOI18N
+ public static final String CREATE_DESKTOP_SHORTCUT_PROPERTY =
+ "create.desktop.shortcut";
+ public static final String CREATE_START_MENU_SHORTCUT_PROPERTY =
+ "create.start.menu.shortcut";
+}
diff --git a/sdk/harness/nbi/stub/ext/engine/build.properties b/sdk/harness/nbi/stub/ext/engine/build.properties
new file mode 100644
index 000000000..bbe1e3e41
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/build.properties
@@ -0,0 +1,41 @@
+#
+# 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-2007 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.
+#
+
+jar.contents.list=data/engine.list
+jar.contents.includes=native/** org/** com/apple/** data/clioptions.list data/engine*.properties
diff --git a/sdk/harness/nbi/stub/ext/engine/build.xml b/sdk/harness/nbi/stub/ext/engine/build.xml
new file mode 100644
index 000000000..f49986b7d
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/build.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${engine.files}
+
+
+
+
+
+
diff --git a/sdk/harness/nbi/stub/ext/engine/manifest.mf b/sdk/harness/nbi/stub/ext/engine/manifest.mf
new file mode 100644
index 000000000..464ca3d3f
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/manifest.mf
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Main-Class: org.netbeans.installer.Installer
diff --git a/sdk/harness/nbi/stub/ext/engine/nbproject/build-impl.xml b/sdk/harness/nbi/stub/ext/engine/nbproject/build-impl.xml
new file mode 100644
index 000000000..78ee6da5e
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/nbproject/build-impl.xml
@@ -0,0 +1,646 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set src.dir
+ Must set test.src.dir
+ Must set build.dir
+ Must set dist.dir
+ Must set build.classes.dir
+ Must set dist.javadoc.dir
+ Must set build.test.classes.dir
+ Must set build.test.results.dir
+ Must set build.classes.excludes
+ Must set dist.jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+
+
+
+
+
+ java -cp "${run.classpath.with.dist.jar}" ${main.class}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+ java -jar "${dist.jar.resolved}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must set fix.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+ Must select one file in the IDE or set test.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/nbi/stub/ext/engine/nbproject/genfiles.properties b/sdk/harness/nbi/stub/ext/engine/nbproject/genfiles.properties
new file mode 100644
index 000000000..fa5963a15
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=8f661a73
+build.xml.script.CRC32=f2f0e306
+build.xml.stylesheet.CRC32=a12b3d02
+# 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=32036222
+nbproject/build-impl.xml.script.CRC32=ff4c3c7b
+nbproject/build-impl.xml.stylesheet.CRC32=65b8de21
diff --git a/sdk/harness/nbi/stub/ext/engine/nbproject/project.properties b/sdk/harness/nbi/stub/ext/engine/nbproject/project.properties
new file mode 100644
index 000000000..7651021fd
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/nbproject/project.properties
@@ -0,0 +1,102 @@
+#
+# 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-2007 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.
+#
+
+application.title=NetBeans Installer Engine
+application.vendor=ks152834
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/nbi-engine.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+excludes=
+file.reference.reglib-src=../../reglib/src
+includes=**
+jar.compress=false
+javac.classpath=\
+ ${reference.NBI_Engine.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.source=1.5
+javac.target=1.5
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}:\
+ ${libs.junit.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=org.netbeans.installer.Installer
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+platform.active=default_platform
+project.NBI_Engine=../../nbi/engine
+reference.NBI_Engine.jar=${project.NBI_Engine}/dist/nbi-engine.jar
+run.classpath=\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=-Dnbi.product.bundled.registry.uri=file:/D:/temp/nbi-build/dist/registry-temp/registry.xml
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/sdk/harness/nbi/stub/ext/engine/nbproject/project.xml b/sdk/harness/nbi/stub/ext/engine/nbproject/project.xml
new file mode 100644
index 000000000..3d5888d98
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/nbproject/project.xml
@@ -0,0 +1,64 @@
+
+
+
+ org.netbeans.modules.java.j2seproject
+
+
+ HelloWorld Engine
+ 1.6.5
+
+
+
+
+
+
+
+
+
+ NBI_Engine
+ jar
+
+ jar
+ clean
+ jar
+
+
+
+
diff --git a/sdk/harness/nbi/stub/ext/engine/src/data/engine.properties b/sdk/harness/nbi/stub/ext/engine/src/data/engine.properties
new file mode 100644
index 000000000..bd92d3a37
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/data/engine.properties
@@ -0,0 +1,89 @@
+
+#
+# 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-2007 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.
+#
+
+nbi.wizard.components.instance.uri=resource:org/mycompany/installer/wizard/wizard-components.xml
+nbi.wizard.ui.swing.frame.icon=resource:org/mycompany/installer/wizard/wizard-icon.png
+nbi.wizard.ui.swing.frame.title.prefix= {product-name} Installer
+nbi.wizard.ui.swing.frame.title.pattern={0}
+nbi.macosx.application.directory.name={product-name} Installer
+nbi.product.remove.corrupted.products.silently=true
+
+nbi.wizard.ui.swing.frame.head.right.image=resource:org/mycompany/installer/wizard/wizard-description-background-right.png
+nbi.wizard.ui.swing.frame.head.left.image=resource:org/mycompany/installer/wizard/wizard-description-background-left.png
+
+nbi.wizard.ui.swing.welcome.left.top.image=resource:org/mycompany/installer/wizard/components/panels/resources/welcome-left-top.png
+nbi.wizard.ui.swing.welcome.left.bottom.image=resource:org/mycompany/installer/wizard/components/panels/resources/welcome-left-bottom.png
+
+nbi.local.directory.path=$S{user.home}/.{product-uid}-installer
+
+nbi.wizard.ui.swing.frame.width.default=600
+nbi.wizard.ui.swing.frame.height.default=500
+nbi.wizard.ui.swing.frame.width.win.classic=588
+nbi.wizard.ui.swing.frame.height.win.classic=442
+nbi.wizard.ui.swing.frame.width.win.xp=600
+nbi.wizard.ui.swing.frame.height.win.xp=450
+nbi.wizard.ui.swing.frame.width.motif=624
+nbi.wizard.ui.swing.frame.height.motif=470
+nbi.wizard.ui.swing.frame.width.metal=624
+nbi.wizard.ui.swing.frame.height.metal=470
+nbi.wizard.ui.swing.frame.width.aqua=640
+nbi.wizard.ui.swing.frame.height.aqua=480
+nbi.wizard.ui.swing.frame.width.gtk=704
+nbi.wizard.ui.swing.frame.height.gtk=528
+nbi.wizard.ui.swing.frame.width.nimbus=624
+nbi.wizard.ui.swing.frame.height.nimbus=512
+
+
+nbi.wizard.ui.swing.frame.minimum.width.default=600
+nbi.wizard.ui.swing.frame.minimum.height.default=500
+nbi.wizard.ui.swing.frame.minimum.width.win.classic=588
+nbi.wizard.ui.swing.frame.minimum.height.win.classic=442
+nbi.wizard.ui.swing.frame.minimum.width.win.xp=600
+nbi.wizard.ui.swing.frame.minimum.height.win.xp=450
+nbi.wizard.ui.swing.frame.minimum.width.motif=624
+nbi.wizard.ui.swing.frame.minimum.height.motif=470
+nbi.wizard.ui.swing.frame.minimum.width.metal=624
+nbi.wizard.ui.swing.frame.minimum.height.metal=470
+nbi.wizard.ui.swing.frame.minimum.width.aqua=640
+nbi.wizard.ui.swing.frame.minimum.height.aqua=480
+nbi.wizard.ui.swing.frame.minimum.width.gtk=704
+nbi.wizard.ui.swing.frame.minimum.height.gtk=528
+nbi.wizard.ui.swing.frame.minimum.width.nimbus=624
+nbi.wizard.ui.swing.frame.minimum.height.nimbus=512
diff --git a/sdk/harness/nbi/stub/ext/engine/src/native/launcher/unix/i18n/launcher.properties b/sdk/harness/nbi/stub/ext/engine/src/native/launcher/unix/i18n/launcher.properties
new file mode 100644
index 000000000..82243321b
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/native/launcher/unix/i18n/launcher.properties
@@ -0,0 +1,71 @@
+#
+# 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-2007 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.
+#
+
+nlu.jvm.notfoundmessage=Java SE Development Kit (JDK) was not found on this computer\nJDK 6 is required for installing {product-name}. Make sure that the JDK is properly installed and run installer again.\nYou can specify valid JDK location using {0} installer argument.\n\nTo download the JDK, visit http://java.sun.com/javase/downloads
+nlu.jvm.usererror=Java Runtime Environment (JRE) was not found at the specified location {0}
+nlu.jvm.uncompatible=Unsupported JVM version at {0}.\nTry to specify another JVM location using parameter {1}
+nlu.freespace=There is not enough free disk space to extract installation data\n{0} MB of free disk space is required in a temporary folder.\nClean up the disk space and run installer again. You can specify a temporary folder with sufficient disk space using {1} installer argument
+nlu.integrity=\nInstaller file {0} seems to be corrupted
+nlu.missing.external.resource=Can`t run {product-name} Installer.\nAn external file with necessary data is required but missing:\n{0}
+nlu.cannot.create.tmpdir=Cannot create temporary directory {0}
+nlu.cannot.extract.bundled.jvm=Cannot extract bundled JVM
+nlu.cannot.unpack.jvm.file=Cannot unpack file {0}
+nlu.error.verify.bundled.jvm=Cannot verify bundled JVM, try to search JVM on the system
+
+nlu.running=Running the installer wizard...
+nlu.starting=Configuring the installer...
+nlu.extracting=Extracting installation data...
+nlu.prepare.jvm=Preparing bundled JVM ...
+nlu.jvm.search=Searching for JVM on the system...
+
+nlu.msg.usage=\nUsage:
+nlu.arg.javahome=\t{0}\t\tUsing java from for running application
+nlu.arg.verbose=\t{0}\t\tUse verbose output
+nlu.arg.output=\t{0}\t\tRedirect all output to file
+nlu.arg.disable.space.check=\t{0}\t\tDisable free space check
+nlu.arg.extract=\t{0}\t[dir]\tExtract all bundled data to .\n\t\t\t\tIf is not specified then extract to the current directory
+nlu.arg.tempdir=\t{0}\t\tUse for extracting temporary data
+nlu.arg.cpa=\t{0} \tAppend classpath with
+nlu.arg.cpp=\t{0} \tPrepend classpath with
+nlu.arg.locale=\t{0}\t\tOverride default locale with specified
+nlu.arg.silent=\t{0}\t\tRun installer silently
+nlu.arg.help=\t{0}\t\tShow this help
+
+
+nlu.java.application.name.macosx={product-name} Installer
diff --git a/sdk/harness/nbi/stub/ext/engine/src/native/launcher/windows/i18n/launcher.properties b/sdk/harness/nbi/stub/ext/engine/src/native/launcher/windows/i18n/launcher.properties
new file mode 100644
index 000000000..16b66faf3
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/native/launcher/windows/i18n/launcher.properties
@@ -0,0 +1,74 @@
+#
+# 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-2007 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.
+#
+
+nlw.jvm.notfoundmessage=Java SE Development Kit (JDK) was not found on this computer\nJDK 6 is required for installing {product-name}. Make sure that the JDK is properly installed and run installer again. You can specify valid JDK location using {0} installer argument.\n\nTo download the JDK, visit http://java.sun.com/javase/downloads
+nlw.jvm.usererror=Java Runtime Environment (JRE) was not found\nThere is no JRE at the specified location {0}
+nlw.jvm.unsupportedversion=Unsupported Java VM version\nThe Java VM at {0} has the unsupported version
+nlw.freespace=There is not enough free disk space to extract installation data\n{0} MB of free disk space is required in a temporary folder. Clean up the disk space and run installer again. You can specify a temporary folder with sufficient disk space using {1} installer argument
+nlw.tmpdir=Can't create temporary directory\nThe temporary directory for extracting data {0} was not created
+nlw.integrity=Installer file is corrupted\nInstaller file {0} seems to be corrupted
+nlw.output.error=Data extraction error\nCan't create file {0}!\nThe following error occured :\n{1}
+nlw.java.process.error=An error occured while running java process\n{0}
+nlw.missing.external.resource=Can`t run {product-name} Installer.\nAn external file with necessary data is required but missing:\n{0}
+nlw.bundled.jvm.extract.error=Cannot prepare bundled JVM to run the installer.\nMost probably the bundled JVM is not compatible with the current platform.
+nlw.bundled.jvm.verify.error=An error occured while verifying bundled JVM.\nMost probably the bundled JVM is not compatible with the current platform.
+
+nlw.arg.output={0} \n\tRedirect output to file
+nlw.arg.javahome={0} \n\tRun jar file using JVM from
+nlw.arg.verbose={0}\n\tUse verbose output
+nlw.arg.tempdir={0} \n\tUse for extracting data
+nlw.arg.extract={0} [directory]\n\tExtract all bundled data to the specific directory.\n\tIf directory is not specified then extract to the current directory
+nlw.arg.classpatha={0} \n\tAppend classpath with
+nlw.arg.classpathp={0} \n\tPrepend classpath with
+nlw.arg.disable.space.check={0}\n\tDisable free space check
+nlw.arg.locale={0} \n\tOverride system default locale with
+nlw.arg.silent={0} \n\tRun installer silently
+nlw.arg.help={0}\n\tShow help message
+
+
+nlw.msg.create.tmpdir=Creating temporary directory ...
+nlw.msg.extract=Extracting data ...
+nlw.msg.jvmsearch=Finding JVM on your system ...
+nlw.msg.setoptions=Setting command options ...
+nlw.msg.running=Running JVM ...
+nlw.msg.title=Please wait while the launcher prepares data to run the installer ...
+nlw.msg.messagebox.title={product-name} Installer
+nlw.msg.progress.title=Configuring the installer ...
+nlw.msg.button.error=Exit Installer
+nlw.msg.main.title={product-name} Installer
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/utils/applications/Bundle.properties b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/utils/applications/Bundle.properties
new file mode 100644
index 000000000..ece892d53
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/utils/applications/Bundle.properties
@@ -0,0 +1,43 @@
+#
+# 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-2007 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.
+#
+
+############################################################################
+# NetBeansRCPUtils.java
+
+NU.error.cannot.get.userdir=Can`t get application userdir from {0}
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/utils/applications/NetBeansRCPUtils.java b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/utils/applications/NetBeansRCPUtils.java
new file mode 100644
index 000000000..d0e2e0914
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/utils/applications/NetBeansRCPUtils.java
@@ -0,0 +1,191 @@
+/*
+ * 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-2007 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.mycompany.installer.utils.applications;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.netbeans.installer.utils.FileUtils;
+import org.netbeans.installer.utils.LogManager;
+import org.netbeans.installer.utils.ResourceUtils;
+import org.netbeans.installer.utils.StringUtils;
+import org.netbeans.installer.utils.SystemUtils;
+import org.netbeans.installer.utils.exceptions.NativeException;
+import org.netbeans.installer.utils.system.WindowsNativeUtils;
+import org.netbeans.installer.utils.system.WindowsNativeUtils;
+import org.netbeans.installer.utils.system.windows.WindowsRegistry;
+
+/**
+ *
+ * @author Dmitry Lipin
+ */
+public class NetBeansRCPUtils {
+
+
+ /**
+ * Get resolved application user directory
+ * @param appLocation Application home directory
+ * @throws IOException if can`t get application default userdir
+ */
+ public static File getApplicationUserDirFile(File appLocation) throws IOException {
+ String dir = getApplicationUserDir(appLocation);
+ String userHome = System.getProperty("user.home");
+ if(SystemUtils.isWindows()) {
+ WindowsNativeUtils wnu = (WindowsNativeUtils) SystemUtils.getNativeUtils();
+ WindowsRegistry reg = wnu.getWindowsRegistry();
+ String key = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
+ try {
+ if(reg.keyExists(reg.HKCU, key) &&
+ reg.valueExists(reg.HKCU, key, "AppData")) {
+ userHome = reg.getStringValue(reg.HKCU, key, "AppData", false);
+
+ }
+ } catch (NativeException e) {
+ LogManager.log(e);
+ }
+ }
+ dir = dir.replace(USER_HOME_TOKEN, userHome);
+ dir = dir.replace(APPNAME_TOKEN, getApplicationName(appLocation));
+ return new File(dir);
+ }
+
+ /**
+ * Get application user directory as it is written in application`s configuration file
+ * @param appLocation Application home directory
+ * @throws IOException if can`t get default userdir
+ */
+ public static String getApplicationUserDir(File appLocation) throws IOException {
+ File []confFiles = new File(appLocation, "etc").listFiles(new FilenameFilter() {
+
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".conf");
+ }
+ });
+ File conf = null;
+ if(confFiles.length == 1) {
+ conf = confFiles[0];
+ } else if(confFiles.length >2) {
+ for(File f : confFiles) {
+ String prefix = f.getName().substring(0, f.getName().indexOf(".conf"));
+ if((SystemUtils.isUnix() && new File(appLocation, "bin/" + prefix).exists()) ||
+ (SystemUtils.isWindows() && new File(appLocation, "bin/" + prefix + ".exe").exists())) {
+ conf = f;
+ break;
+ }
+ }
+ }
+ if(conf == null) {
+ return null;
+ }
+
+ String contents = FileUtils.readFile(conf);
+ Matcher matcher = Pattern.compile(
+ NEW_LINE_PATTERN + SPACES_PATTERN +
+ (SystemUtils.isMacOS() ? DEFAULT_USERDIR_MAC : DEFAULT_USERDIR) +
+ "\"(.*?)\"").matcher(contents);
+ if(matcher.find() && matcher.groupCount() == 1) {
+ return matcher.group(1);
+ } else {
+ throw new IOException(StringUtils.format(
+ ERROR_CANNOT_GET_USERDIR_STRING,conf));
+ }
+ }
+
+ /**
+ * Get application name - i.e. in bin/.exe and etc/.conf
+ * @param appLocation Application home directory
+ */
+ public static String getApplicationName(File appLocation) {
+ File []confFiles = new File(appLocation, "etc").listFiles(new FilenameFilter() {
+
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".conf");
+ }
+ });
+
+ if(confFiles.length == 1) {
+ String name = confFiles[0].getName();
+ return name.substring(0, name.indexOf(".conf"));
+ } else if(confFiles.length >2) {
+ for(File f : confFiles) {
+ String name = f.getName();
+ String prefix = name.substring(0, name.indexOf(".conf"));
+ if((SystemUtils.isUnix() && new File(appLocation, "bin/" + prefix).exists()) ||
+ (SystemUtils.isWindows() && new File(appLocation, "bin/" + prefix + ".exe").exists())) {
+ return prefix;
+ }
+ }
+ }
+ return null;
+ }
+
+
+ /////////////////////////////////////////////////////////////////////////////////
+ // Instance
+ private NetBeansRCPUtils() {
+ // does nothing
+ }
+
+ /////////////////////////////////////////////////////////////////////////////////
+ // Constants
+
+ public static final String NEW_LINE_PATTERN =
+ "[\r\n|\n|\r]"; // NOI18N
+ public static final String SPACES_PATTERN =
+ "\\ *"; // NOI18N
+
+ public static final String DEFAULT_USERDIR =
+ "default_userdir="; // NOI18N
+ public static final String DEFAULT_USERDIR_MAC =
+ "default_mac_userdir="; // NOI18N
+
+ public static final String USER_HOME_TOKEN =
+ "${HOME}"; // NOI18N
+ public static final String APPNAME_TOKEN =
+ "${APPNAME}"; // NOI18N
+
+ public static final String ERROR_CANNOT_GET_USERDIR_STRING =
+ ResourceUtils.getString(NetBeansRCPUtils.class,
+ "NU.error.cannot.get.userdir");//NOI18N
+
+
+}
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/actions/Bundle.properties b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/actions/Bundle.properties
new file mode 100644
index 000000000..12de891ea
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/actions/Bundle.properties
@@ -0,0 +1,3 @@
+IA.title=Installer Initialization
+IA.progress.title=Initialization in progress...
+IA.description=Please wait while initialization is completed.
\ No newline at end of file
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/actions/InitializeAction.java b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/actions/InitializeAction.java
new file mode 100644
index 000000000..be955d7d2
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/actions/InitializeAction.java
@@ -0,0 +1,112 @@
+/*
+ * 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-2007 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.mycompany.installer.wizard.components.actions;
+
+import org.netbeans.installer.product.Registry;
+import org.netbeans.installer.utils.StringUtils;
+import org.netbeans.installer.utils.helper.ErrorLevel;
+import org.netbeans.installer.utils.ErrorManager;
+import org.netbeans.installer.utils.ResourceUtils;
+import org.netbeans.installer.utils.progress.Progress;
+import org.netbeans.installer.wizard.components.WizardAction;
+import org.netbeans.installer.wizard.components.actions.*;
+
+/**
+ *
+ * @author Dmitry Lipin
+ */
+public class InitializeAction extends WizardAction {
+ /////////////////////////////////////////////////////////////////////////////////
+ // Instance
+ public InitializeAction() {
+ setProperty(TITLE_PROPERTY,
+ DEFAULT_TITLE);
+ setProperty(DESCRIPTION_PROPERTY,
+ DEFAULT_DESCRIPTION);
+
+ downloadLogic = new DownloadConfigurationLogicAction();
+ initReg = new InitializeRegistryAction();
+ }
+ private DownloadConfigurationLogicAction downloadLogic;
+ private InitializeRegistryAction initReg;
+
+ public void execute() {
+ final Progress progress = new Progress();
+
+ //getWizardUi().setProgress(progress);
+
+
+ progress.setTitle(getProperty(PROGRESS_TITLE_PROPERTY));
+
+ //progress.synchronizeDetails(false);
+
+ if (initReg.canExecuteForward()) {
+ initReg.setWizard(getWizard());
+ initReg.execute();
+ }
+
+ if (downloadLogic.canExecuteForward()) {
+ downloadLogic.setWizard(getWizard());
+ downloadLogic.execute();
+ }
+ }
+
+ @Override
+ public boolean isCancelable() {
+ return false;
+ }
+
+ public WizardActionUi getWizardUi() {
+ return null; // this action does not have a ui
+ }
+
+ /////////////////////////////////////////////////////////////////////////////////
+ // Constants
+ public static final String DEFAULT_TITLE = ResourceUtils.getString(
+ InitializeAction.class,
+ "IA.title"); // NOI18N
+ public static final String PROGRESS_TITLE_PROPERTY = ResourceUtils.getString(
+ InitializeAction.class,
+ "IA.progress.title"); // NOI18N
+ public static final String DEFAULT_DESCRIPTION = ResourceUtils.getString(
+ InitializeAction.class,
+ "IA.description"); // NOI18N
+
+}
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/Bundle.properties b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/Bundle.properties
new file mode 100644
index 000000000..a5264f3f6
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/Bundle.properties
@@ -0,0 +1,94 @@
+WP.title={product-name} Introduction
+WP.description={product-name} is a really good app
+WP.welcome.text=\
+
Hello to {product-name} Installer Wizard
\
+ This program will install {product-name} application on your computer.
\
+ Click Next to continue.
+WP.already.installed.text=\
+
Hello to {product-name} Installer Wizard
\
+{0} is already installed at {1}. It is not possible to install it again.
\
+Click Exit to close this wizard.
+WP.already.installed.next.button.text=&Exit
+WP.incompatible.platform.text=\
+
Hello to {product-name} Installer Wizard
\
+The {0} installer was not designed to run on this operating system so it is not possible to install it. \
+Please run the installer for the appropriate platform.
\
+Click Exit to close this wizard.
+
+PoISP.title=Setup Complete
+PoISP.description=Click Finish to finish {product-name} setup.
+
+PoISP.message.text.success=\
+ Installation Complete
\
+ {0} has been installed on your computer.
+#NOI18N
+PoISP.message.content.type.success=text/html
+
+PoISP.message.text.warnings=\
+Installation Complete
\
+{0} has been installed on your computer but some not critical warnings were encountered.\
+
For more details consult the installation log file: {1}
+
+PoISP.message.text.finish=Click Finish to close this wizard.
+PoISP.message.text.finish.content.type=text/html
+
+#NOI18N
+PoISP.message.content.type.warnings=text/html
+
+PoISP.message.text.errors=Installation Failed
\
+ {0} has not been installed on your computer.
\
+ Try to run installer again or consult the installation log file for more details: {1}
+#NOI18N
+PoISP.message.content.type.errors=text/html
+
+PoISP.message.text.success.uninstall=\
+ Uninstallation Complete
\
+ {0} has been uninstalled.
+#NOI18N
+PoISP.message.content.type.success.uninstall=text/html
+
+PoISP.message.text.warnings.uninstall=\
+ Uninstallation Complete
\
+ {0} has been uninstalled with warnings.
\
+ For more details consult the installation log file: {1}
+#NOI18N
+PoISP.message.content.type.warnings.uninstall=text/html
+
+PoISP.message.text.errors.uninstall=Uninstallation Failed
\
+Uninstallation of {0} was not completed.
\
+Try to run uninstaller again or consult the uninstallation log file for more details: {1}\
+
+#NOI18N
+PoISP.message.content.type.errors.uninstall=text/html
+
+PoISP.message.run.application.now=Launch {0} after the installer closes.
+
+PoISP.next.button.text=&Finish
+
+
+
+################################################################################
+# PreInstallSummaryPanel.java
+PrISP.title=Summary
+PrISP.description=Click Install to start the installation.
+PrISP.description.uninstall=Click Uninstall to start the uninstallation.
+
+PrISP.installation.folder={0} Installation Folder:
+PrISP.uninstall.list.label.text= Click Uninstall to remove {0} from the system.
+PrISP.installation.size=Total Installation Size:
+PrISP.download.size=Total Download Size:
+
+PrISP.next.button.text=&Install
+PrISP.next.button.text.uninstall=&Uninstall
+
+PrISP.error.not.enough.space=Insufficient disk space for proper installation. Additional {1} is required in {0}.
+PrISP.error.cannot.check.space=Cannot check the free disk space
+PrISP.error.logic.access=Could not access product's configuration logic
+PrISP.error.fsroots=Cannot get the list of file system roots
+PrISP.error.non.existent.root={0} is set up to be installed to {1} which does not belong to any of the file system roots.
+PrISP.error.cannot.write=The wizard does not have write access to {1}, the installation directory of {0}. Please correct the permissions before proceeding.
+
+PrISP.remove.app.userdir.text=\
+\
+If you wish to remove the application settings directory that stores user configuration data for {0}, check the following option.
+PrISP.remove.app.userdir.checkbox=Remove directory {0}
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/PostInstallSummaryPanel.java b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/PostInstallSummaryPanel.java
new file mode 100644
index 000000000..b622d68fa
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/PostInstallSummaryPanel.java
@@ -0,0 +1,457 @@
+/*
+ * 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-2007 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.mycompany.installer.wizard.components.panels;
+
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+import org.netbeans.installer.product.Registry;
+import org.netbeans.installer.product.components.Product;
+import org.netbeans.installer.product.components.ProductConfigurationLogic;
+import org.netbeans.installer.utils.LogManager;
+import org.netbeans.installer.utils.ResourceUtils;
+import org.netbeans.installer.utils.StringUtils;
+import org.netbeans.installer.utils.exceptions.InitializationException;
+import org.netbeans.installer.utils.helper.swing.NbiCheckBox;
+import org.netbeans.installer.utils.helper.swing.NbiTextPane;
+import org.netbeans.installer.wizard.components.WizardPanel;
+import org.netbeans.installer.wizard.containers.SwingContainer;
+import org.netbeans.installer.wizard.containers.SwingFrameContainer;
+import org.netbeans.installer.wizard.ui.SwingUi;
+import org.netbeans.installer.wizard.ui.WizardUi;
+import static org.netbeans.installer.utils.helper.DetailedStatus.INSTALLED_SUCCESSFULLY;
+import static org.netbeans.installer.utils.helper.DetailedStatus.INSTALLED_WITH_WARNINGS;
+import static org.netbeans.installer.utils.helper.DetailedStatus.FAILED_TO_INSTALL;
+import static org.netbeans.installer.utils.helper.DetailedStatus.UNINSTALLED_SUCCESSFULLY;
+import static org.netbeans.installer.utils.helper.DetailedStatus.UNINSTALLED_WITH_WARNINGS;
+import static org.netbeans.installer.utils.helper.DetailedStatus.FAILED_TO_UNINSTALL;
+
+/**
+ *
+ * @author Dmitry Lipin
+ */
+public class PostInstallSummaryPanel extends WizardPanel {
+ /////////////////////////////////////////////////////////////////////////////////
+ // Instance
+
+ public PostInstallSummaryPanel() {
+ setProperty(TITLE_PROPERTY,
+ DEFAULT_TITLE);
+ setProperty(DESCRIPTION_PROPERTY,
+ DEFAULT_DESCRIPTION);
+
+ setProperty(MESSAGE_TEXT_SUCCESS_PROPERTY,
+ DEFAULT_MESSAGE_TEXT_SUCCESS);
+ setProperty(MESSAGE_CONTENT_TYPE_SUCCESS_PROPERTY,
+ DEFAULT_MESSAGE_CONTENT_TYPE_SUCCESS);
+ setProperty(MESSAGE_TEXT_WARNINGS_PROPERTY,
+ DEFAULT_MESSAGE_TEXT_WARNINGS);
+ setProperty(MESSAGE_CONTENT_TYPE_WARNINGS_PROPERTY,
+ DEFAULT_MESSAGE_CONTENT_TYPE_WARNINGS);
+ setProperty(MESSAGE_TEXT_ERRORS_PROPERTY,
+ DEFAULT_MESSAGE_TEXT_ERRORS);
+ setProperty(MESSAGE_CONTENT_TYPE_ERRORS_PROPERTY,
+ DEFAULT_MESSAGE_CONTENT_TYPE_ERRORS);
+
+ setProperty(MESSAGE_TEXT_SUCCESS_UNINSTALL_PROPERTY,
+ DEFAULT_MESSAGE_TEXT_SUCCESS_UNINSTALL);
+ setProperty(MESSAGE_CONTENT_TYPE_SUCCESS_UNINSTALL_PROPERTY,
+ DEFAULT_MESSAGE_CONTENT_TYPE_SUCCESS_UNINSTALL);
+ setProperty(MESSAGE_TEXT_WARNINGS_UNINSTALL_PROPERTY,
+ DEFAULT_MESSAGE_TEXT_WARNINGS_UNINSTALL);
+ setProperty(MESSAGE_CONTENT_TYPE_WARNINGS_UNINSTALL_PROPERTY,
+ DEFAULT_MESSAGE_CONTENT_TYPE_WARNINGS_UNINSTALL);
+ setProperty(MESSAGE_TEXT_ERRORS_UNINSTALL_PROPERTY,
+ DEFAULT_MESSAGE_TEXT_ERRORS_UNINSTALL);
+ setProperty(MESSAGE_CONTENT_TYPE_ERRORS_UNINSTALL_PROPERTY,
+ DEFAULT_MESSAGE_CONTENT_TYPE_ERRORS_UNINSTALL);
+
+
+ setProperty(NEXT_BUTTON_TEXT_PROPERTY,
+ DEFAULT_NEXT_BUTTON_TEXT);
+ }
+
+ @Override
+ public boolean isPointOfNoReturn() {
+ return true;
+ }
+
+ @Override
+ public WizardUi getWizardUi() {
+ if (wizardUi == null) {
+ wizardUi = new PostInstallSummaryPanelUi(this);
+ }
+
+ return wizardUi;
+ }
+
+ /////////////////////////////////////////////////////////////////////////////////
+ // Inner Classes
+ public static class PostInstallSummaryPanelUi extends WizardPanelUi {
+
+ protected PostInstallSummaryPanel component;
+
+ public PostInstallSummaryPanelUi(PostInstallSummaryPanel component) {
+ super(component);
+
+ this.component = component;
+ }
+
+ public SwingUi getSwingUi(SwingContainer container) {
+ if (swingUi == null) {
+ swingUi = new PostInstallSummaryPanelSwingUi(component, container);
+ }
+
+ return super.getSwingUi(container);
+ }
+ }
+
+ public static class PostInstallSummaryPanelSwingUi extends WizardPanelSwingUi {
+
+ protected PostInstallSummaryPanel component;
+ private NbiTextPane messagePaneInstall;
+ private NbiTextPane messagePaneUninstall;
+
+
+ private NbiTextPane messagePaneFinish;
+ private NbiCheckBox runAppNow;
+ private Product app;
+
+ public PostInstallSummaryPanelSwingUi(
+ final PostInstallSummaryPanel component,
+ final SwingContainer container) {
+ super(component, container);
+
+ this.component = component;
+
+ initComponents();
+ }
+
+ protected void initializeContainer() {
+ super.initializeContainer();
+
+ // set up the back button
+ container.getBackButton().setVisible(false);
+ container.getBackButton().setEnabled(false);
+
+ // set up the next (or finish) button
+ container.getNextButton().setVisible(true);
+ container.getNextButton().setEnabled(true);
+
+ container.getNextButton().setText(
+ component.getProperty(NEXT_BUTTON_TEXT_PROPERTY));
+
+ // set up the cancel button
+ container.getCancelButton().setVisible(false);
+ container.getCancelButton().setEnabled(false);
+ }
+
+ @Override
+ public void evaluateNextButtonClick() {
+ container.getNextButton().setEnabled(false);
+ final Product product = app;
+ if (app != null) {
+ ProductConfigurationLogic l = null;
+ try {
+ l = app.getLogic();
+ } catch (InitializationException e) {
+ }
+ final File executable = l != null ? new File(app.getInstallationLocation(), l.getExecutable()) : null;
+
+ if (executable != null && runAppNow.isSelected()) {
+ LogManager.log("... running: " + executable.getAbsolutePath());
+ ProcessBuilder pb = new ProcessBuilder(new String[]{executable.getAbsolutePath()});
+ try {
+ pb.start();
+ } catch (IOException e) {
+ LogManager.log(e);
+ }
+
+ }
+ }
+ super.evaluateNextButtonClick();
+ }
+
+ protected void initialize() {
+ final Registry registry = Registry.getInstance();
+ final List successfulInstall = registry.getProducts(INSTALLED_SUCCESSFULLY);
+ final List warningInstall = registry.getProducts(INSTALLED_WITH_WARNINGS);
+ final List errorInstall = registry.getProducts(FAILED_TO_INSTALL);
+
+ final List successfulUninstall = registry.getProducts(UNINSTALLED_SUCCESSFULLY);
+ final List warningUninstall = registry.getProducts(UNINSTALLED_WITH_WARNINGS);
+ final List errorUninstall = registry.getProducts(FAILED_TO_UNINSTALL);
+
+ if (errorInstall.size() > 0) {
+ messagePaneInstall.setContentType(component.getProperty(MESSAGE_CONTENT_TYPE_ERRORS_PROPERTY));
+ messagePaneInstall.setText(StringUtils.format(
+ component.getProperty(MESSAGE_TEXT_ERRORS_PROPERTY),
+ errorInstall.get(0).getDisplayName(),
+ LogManager.getLogFile()));
+ } else if (warningInstall.size() > 0) {
+ messagePaneInstall.setContentType(component.getProperty(MESSAGE_CONTENT_TYPE_WARNINGS_PROPERTY));
+ messagePaneInstall.setText(StringUtils.format(
+ component.getProperty(MESSAGE_TEXT_WARNINGS_PROPERTY),
+ warningInstall.get(0).getDisplayName(),
+ LogManager.getLogFile()));
+ } else if (successfulInstall.size() > 0) {
+ messagePaneInstall.setContentType(component.getProperty(MESSAGE_CONTENT_TYPE_SUCCESS_PROPERTY));
+ messagePaneInstall.setText(StringUtils.format(
+ component.getProperty(MESSAGE_TEXT_SUCCESS_PROPERTY),
+ successfulInstall.get(0).getDisplayName(),
+ LogManager.getLogFile()));
+ } else {
+ messagePaneInstall.setVisible(false);
+ }
+
+ messagePaneFinish.setVisible(true);
+ messagePaneFinish.setContentType(DEFAULT_MESSAGE_FINISH_PROCESS_CONTENT_TYPE);
+ messagePaneFinish.setText(DEFAULT_MESSAGE_FINISH_PROCESS);
+
+ if (errorUninstall.size() > 0) {
+ messagePaneUninstall.setContentType(component.getProperty(MESSAGE_CONTENT_TYPE_ERRORS_UNINSTALL_PROPERTY));
+ messagePaneUninstall.setText(StringUtils.format(
+ component.getProperty(MESSAGE_TEXT_ERRORS_UNINSTALL_PROPERTY),
+ errorUninstall.get(0).getDisplayName(),
+ LogManager.getLogFile()));
+ } else if (warningUninstall.size() > 0) {
+ messagePaneUninstall.setContentType(component.getProperty(MESSAGE_CONTENT_TYPE_WARNINGS_UNINSTALL_PROPERTY));
+ messagePaneUninstall.setText(StringUtils.format(
+ component.getProperty(MESSAGE_TEXT_WARNINGS_UNINSTALL_PROPERTY),
+ warningUninstall.get(0).getDisplayName(),
+ LogManager.getLogFile()));
+ } else if (successfulUninstall.size() > 0) {
+ messagePaneUninstall.setContentType(component.getProperty(MESSAGE_CONTENT_TYPE_SUCCESS_UNINSTALL_PROPERTY));
+ messagePaneUninstall.setText(StringUtils.format(
+ component.getProperty(MESSAGE_TEXT_SUCCESS_UNINSTALL_PROPERTY),
+ successfulUninstall.get(0).getDisplayName(),
+ LogManager.getLogFile()));
+ } else {
+ messagePaneUninstall.setVisible(false);
+ }
+
+
+
+ final List products = new LinkedList();
+ products.addAll(successfulInstall);
+ products.addAll(warningInstall);
+ runAppNow.setSelected(false);
+ if (!products.isEmpty()) {
+ runAppNow.setText(StringUtils.format(DEFAULT_MESSAGE_LAUNCH_APPLICATION_NOW,
+ products.get(0).getDisplayName()));
+ runAppNow.doClick();
+ app = products.get(0);
+ } else {
+ runAppNow.setVisible(false);
+ }
+
+
+ }
+
+ private void initComponents() {
+ // messagePaneInstall ///////////////////////////////////////////////////
+ messagePaneInstall = new NbiTextPane();
+
+ // messagePaneUninstall /////////////////////////////////////////////////
+ messagePaneUninstall = new NbiTextPane();
+
+ // messagePaneRunApplication ///////////////////////////////////////////////////
+
+
+ messagePaneFinish = new NbiTextPane();
+
+ runAppNow = new NbiCheckBox();
+
+
+ // this /////////////////////////////////////////////////////////////////
+ add(messagePaneInstall, new GridBagConstraints(
+ 0, 0, // x, y
+ 1, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.PAGE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(31, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+ add(messagePaneUninstall, new GridBagConstraints(
+ 0, 1, // x, y
+ 1, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.PAGE_START, // anchor
+ GridBagConstraints.BOTH, // fill
+ new Insets(31, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+
+ add(messagePaneFinish, new GridBagConstraints(
+ 0, 3, // x, y
+ 1, 1, // width, height
+ 1.0, 1.0, // weight-x, weight-y
+ GridBagConstraints.PAGE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(11, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+ /*
+ add(new NbiPanel(), new GridBagConstraints(
+ 0, 4, // x, y
+ 1, 1, // width, height
+ 1.0, 1.0, // weight-x, weight-y
+ GridBagConstraints.CENTER, // anchor
+ GridBagConstraints.BOTH, // fill
+ new Insets(0, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+ */
+ add(runAppNow, new GridBagConstraints(
+ 0, 4, // x, y
+ 1, 1, // width, height
+ 1.0, 1.0, // weight-x, weight-y
+ GridBagConstraints.PAGE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(11, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+
+
+
+ if (container instanceof SwingFrameContainer) {
+ final SwingFrameContainer sfc = (SwingFrameContainer) container;
+ sfc.addWindowListener(new WindowAdapter() {
+
+ @Override
+ public void windowClosing(WindowEvent event) {
+ SwingUi currentUi = component.getWizardUi().getSwingUi(container);
+ if (currentUi != null) {
+ if (!container.getCancelButton().isEnabled() && // cancel button is disabled
+ !container.getCancelButton().isVisible() && // no cancel button at this panel
+ !container.getBackButton().isVisible() && // no back button at this panel
+ container.getNextButton().isVisible() && // next button is visible
+ container.getNextButton().isEnabled()) { // and enabled
+ currentUi.evaluateNextButtonClick();
+ sfc.removeWindowListener(this);
+ }
+ }
+ }
+ });
+ }
+ }
+ }
+ /////////////////////////////////////////////////////////////////////////////////
+ // Constants
+ public static final String MESSAGE_TEXT_SUCCESS_PROPERTY =
+ "message.text.success"; // NOI18N
+ public static final String MESSAGE_CONTENT_TYPE_SUCCESS_PROPERTY =
+ "message.content.type.success"; // NOI18N
+ public static final String MESSAGE_TEXT_WARNINGS_PROPERTY =
+ "message.text.warnings"; // NOI18N
+ public static final String MESSAGE_CONTENT_TYPE_WARNINGS_PROPERTY =
+ "message.content.type.warnings"; // NOI18N
+ public static final String MESSAGE_TEXT_ERRORS_PROPERTY =
+ "message.text.errors"; // NOI18N
+ public static final String MESSAGE_CONTENT_TYPE_ERRORS_PROPERTY =
+ "message.content.type.errors"; // NOI18N
+ public static final String MESSAGE_TEXT_SUCCESS_UNINSTALL_PROPERTY =
+ "message.text.success.uninstall"; // NOI18N
+ public static final String MESSAGE_CONTENT_TYPE_SUCCESS_UNINSTALL_PROPERTY =
+ "message.content.type.success.uninstall"; // NOI18N
+ public static final String MESSAGE_TEXT_WARNINGS_UNINSTALL_PROPERTY =
+ "message.text.warnings.uninstall"; // NOI18N
+ public static final String MESSAGE_CONTENT_TYPE_WARNINGS_UNINSTALL_PROPERTY =
+ "message.content.type.warnings.uninstall"; // NOI18N
+ public static final String MESSAGE_TEXT_ERRORS_UNINSTALL_PROPERTY =
+ "message.text.errors.uninstall"; // NOI18N
+ public static final String MESSAGE_CONTENT_TYPE_ERRORS_UNINSTALL_PROPERTY =
+ "message.content.type.errors.uninstall"; // NOI18N
+ public static final String DEFAULT_MESSAGE_TEXT_SUCCESS =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.text.success"); // NOI18N
+ public static final String DEFAULT_MESSAGE_CONTENT_TYPE_SUCCESS =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.content.type.success"); // NOI18N
+ public static final String DEFAULT_MESSAGE_TEXT_WARNINGS =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.text.warnings"); // NOI18N
+ public static final String DEFAULT_MESSAGE_CONTENT_TYPE_WARNINGS =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.content.type.warnings"); // NOI18N
+ public static final String DEFAULT_MESSAGE_TEXT_ERRORS =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.text.errors"); // NOI18N
+ public static final String DEFAULT_MESSAGE_CONTENT_TYPE_ERRORS =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.content.type.errors"); // NOI18N
+ public static final String DEFAULT_MESSAGE_TEXT_SUCCESS_UNINSTALL =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.text.success.uninstall"); // NOI18N
+ public static final String DEFAULT_MESSAGE_CONTENT_TYPE_SUCCESS_UNINSTALL =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.content.type.success.uninstall"); // NOI18N
+ public static final String DEFAULT_MESSAGE_TEXT_WARNINGS_UNINSTALL =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.text.warnings.uninstall"); // NOI18N
+ public static final String DEFAULT_MESSAGE_CONTENT_TYPE_WARNINGS_UNINSTALL =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.content.type.warnings.uninstall"); // NOI18N
+ public static final String DEFAULT_MESSAGE_TEXT_ERRORS_UNINSTALL =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.text.errors.uninstall"); // NOI18N
+ public static final String DEFAULT_MESSAGE_CONTENT_TYPE_ERRORS_UNINSTALL =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.content.type.errors.uninstall"); // NOI18N
+
+ public static final String DEFAULT_TITLE = ResourceUtils.getString(
+ PostInstallSummaryPanel.class,
+ "PoISP.title"); // NOI18N
+ public static final String DEFAULT_DESCRIPTION =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.description"); // NOI18N
+ public static final String DEFAULT_NEXT_BUTTON_TEXT =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.next.button.text"); // NOI18N
+ public static final String DEFAULT_MESSAGE_FINISH_PROCESS =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.text.finish"); // NOI18N
+ public static final String DEFAULT_MESSAGE_FINISH_PROCESS_CONTENT_TYPE =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.text.finish.content.type"); // NOI18N
+ public static final String DEFAULT_MESSAGE_LAUNCH_APPLICATION_NOW =
+ ResourceUtils.getString(PostInstallSummaryPanel.class,
+ "PoISP.message.run.application.now");//NOI18N
+}
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/PreInstallSummaryPanel.java b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/PreInstallSummaryPanel.java
new file mode 100644
index 000000000..1edaf1808
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/PreInstallSummaryPanel.java
@@ -0,0 +1,620 @@
+/*
+ * 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-2007 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.mycompany.installer.wizard.components.panels;
+
+import java.awt.ComponentOrientation;
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.swing.border.EmptyBorder;
+import org.netbeans.installer.Installer;
+import org.netbeans.installer.product.Registry;
+import org.netbeans.installer.product.RegistryNode;
+import org.netbeans.installer.product.RegistryType;
+import org.netbeans.installer.product.components.Product;
+import org.netbeans.installer.utils.ErrorManager;
+import org.netbeans.installer.utils.FileUtils;
+import org.netbeans.installer.utils.LogManager;
+import org.netbeans.installer.utils.ResourceUtils;
+import org.netbeans.installer.utils.StringUtils;
+import org.netbeans.installer.utils.SystemUtils;
+import org.mycompany.installer.utils.applications.NetBeansRCPUtils;
+import org.netbeans.installer.utils.exceptions.NativeException;
+import org.netbeans.installer.utils.helper.swing.NbiCheckBox;
+import org.netbeans.installer.utils.helper.swing.NbiLabel;
+import org.netbeans.installer.utils.helper.swing.NbiPanel;
+import org.netbeans.installer.utils.helper.swing.NbiTextPane;
+import org.netbeans.installer.wizard.components.panels.ErrorMessagePanel;
+import org.netbeans.installer.wizard.components.panels.ErrorMessagePanel.ErrorMessagePanelSwingUi;
+import org.netbeans.installer.wizard.components.panels.ErrorMessagePanel.ErrorMessagePanelUi;
+import org.netbeans.installer.wizard.containers.SwingContainer;
+import org.netbeans.installer.wizard.ui.SwingUi;
+import org.netbeans.installer.wizard.ui.WizardUi;
+
+/**
+ *
+ * @author Dmitry Lipin
+ */
+public class PreInstallSummaryPanel extends ErrorMessagePanel {
+ /////////////////////////////////////////////////////////////////////////////////
+ // Instance
+
+ public PreInstallSummaryPanel() {
+ setProperty(TITLE_PROPERTY,
+ DEFAULT_TITLE);
+ setProperty(DESCRIPTION_PROPERTY,
+ DEFAULT_DESCRIPTION);
+
+ setProperty(INSTALLATION_FOLDER_PROPERTY,
+ DEFAULT_INSTALLATION_FOLDER);
+
+ setProperty(UNINSTALL_LABEL_TEXT_PROPERTY,
+ DEFAULT_UNINSTALL_LABEL_TEXT);
+
+ setProperty(INSTALLATION_SIZE_PROPERTY,
+ DEFAULT_INSTALLATION_SIZE);
+ setProperty(DOWNLOAD_SIZE_PROPERTY,
+ DEFAULT_DOWNLOAD_SIZE);
+
+ setProperty(NEXT_BUTTON_TEXT_PROPERTY,
+ DEFAULT_NEXT_BUTTON_TEXT);
+
+ setProperty(ERROR_NOT_ENOUGH_SPACE_PROPERTY,
+ DEFAULT_ERROR_NOT_ENOUGH_SPACE);
+ setProperty(ERROR_CANNOT_CHECK_SPACE_PROPERTY,
+ DEFAULT_ERROR_CANNOT_CHECK_SPACE);
+ setProperty(ERROR_LOGIC_ACCESS_PROPERTY,
+ DEFAULT_ERROR_LOGIC_ACCESS);
+ setProperty(ERROR_FSROOTS_PROPERTY,
+ DEFAULT_ERROR_FSROOTS);
+ setProperty(ERROR_NON_EXISTENT_ROOT_PROPERTY,
+ DEFAULT_ERROR_NON_EXISTENT_ROOT);
+ setProperty(ERROR_CANNOT_WRITE_PROPERTY,
+ DEFAULT_ERROR_CANNOT_WRITE);
+ setProperty(REMOVE_APP_USERDIR_TEXT_PROPERTY,
+ DEFAULT_REMOVE_APP_USERDIR_TEXT);
+ setProperty(REMOVE_APP_USERDIR_CHECKBOX_PROPERTY,
+ DEFAULT_REMOVE_APP_USERDIR_CHECKBOX);
+
+ }
+
+ @Override
+ public WizardUi getWizardUi() {
+ if (wizardUi == null) {
+ wizardUi = new PreInstallSummaryPanelUi(this);
+ }
+
+ return wizardUi;
+ }
+
+ @Override
+ public void initialize() {
+ final List toInstall =
+ Registry.getInstance().getProductsToInstall();
+
+ if (toInstall.size() > 0) {
+ setProperty(NEXT_BUTTON_TEXT_PROPERTY, DEFAULT_NEXT_BUTTON_TEXT);
+ setProperty(DESCRIPTION_PROPERTY, DEFAULT_DESCRIPTION);
+ } else {
+ setProperty(NEXT_BUTTON_TEXT_PROPERTY, DEFAULT_NEXT_BUTTON_TEXT_UNINSTALL);
+ setProperty(DESCRIPTION_PROPERTY, DEFAULT_DESCRIPTION_UNINSTALL);
+ }
+ }
+
+ /////////////////////////////////////////////////////////////////////////////////
+ // Inner Classes
+ public static class PreInstallSummaryPanelUi extends ErrorMessagePanelUi {
+
+ protected PreInstallSummaryPanel component;
+
+ public PreInstallSummaryPanelUi(PreInstallSummaryPanel component) {
+ super(component);
+
+ this.component = component;
+ }
+
+ @Override
+ public SwingUi getSwingUi(SwingContainer container) {
+ if (swingUi == null) {
+ swingUi = new PreInstallSummaryPanelSwingUi(component, container);
+ }
+
+ return super.getSwingUi(container);
+ }
+ }
+
+ public static class PreInstallSummaryPanelSwingUi extends ErrorMessagePanelSwingUi {
+
+ protected PreInstallSummaryPanel component;
+ private NbiTextPane locationsPane;
+ private NbiLabel uninstallListLabel;
+ private NbiTextPane uninstallListPane;
+ private NbiLabel installationSizeLabel;
+ private NbiLabel installationSizeValue;
+ private NbiLabel downloadSizeLabel;
+ private NbiLabel downloadSizeValue;
+ private NbiCheckBox removeUserdirCheckbox;
+ private NbiTextPane removeUserdirPane;
+ private NbiPanel spacer;
+ private int gridy = 0;
+
+ public PreInstallSummaryPanelSwingUi(
+ final PreInstallSummaryPanel component,
+ final SwingContainer container) {
+ super(component, container);
+
+ this.component = component;
+ initComponents();
+ }
+
+ // protected ////////////////////////////////////////////////////////////////
+ @Override
+ protected void initializeContainer() {
+ super.initializeContainer();
+
+ container.getNextButton().setText(
+ panel.getProperty(NEXT_BUTTON_TEXT_PROPERTY));
+ }
+
+ @Override
+ protected void initialize() {
+ final Registry registry = Registry.getInstance();
+
+ final StringBuilder text = new StringBuilder();
+ long installationSize = 0;
+ long downloadSize = 0;
+
+ for (Product product : registry.getProductsToInstall()) {
+ installationSize += product.getRequiredDiskSpace();
+ downloadSize += product.getDownloadSize();
+
+
+ }
+
+ // add top-level components like nb-base, glassfish, tomcat, jdk
+ for (Product product : registry.getProductsToInstall()) {
+ text.append(StringUtils.LF);
+ text.append(StringUtils.format(panel.getProperty(INSTALLATION_FOLDER_PROPERTY),
+ product.getDisplayName()));
+ text.append(StringUtils.LF);
+ text.append(" " + product.getInstallationLocation());
+ text.append(StringUtils.LF);
+ }
+ locationsPane.setText(text);
+
+ List toUninstall = registry.getProductsToUninstall();
+ String uninstallLabelText = toUninstall.size() > 0 ? StringUtils.format(
+ panel.getProperty(UNINSTALL_LABEL_TEXT_PROPERTY),
+ toUninstall.get(0).getDisplayName()) : "";
+
+ uninstallListLabel.setText(uninstallLabelText);
+
+
+ installationSizeLabel.setText(
+ panel.getProperty(INSTALLATION_SIZE_PROPERTY));
+ installationSizeValue.setText(StringUtils.formatSize(
+ installationSize));
+
+ downloadSizeLabel.setText(
+ panel.getProperty(DOWNLOAD_SIZE_PROPERTY));
+ downloadSizeValue.setText(StringUtils.formatSize(
+ downloadSize));
+
+ if (registry.getProductsToInstall().size() == 0) {
+ locationsPane.setVisible(false);
+ installationSizeLabel.setVisible(false);
+ installationSizeValue.setVisible(false);
+ } else {
+ locationsPane.setVisible(true);
+ installationSizeLabel.setVisible(true);
+ installationSizeValue.setVisible(true);
+ }
+
+ if (registry.getProductsToUninstall().size() == 0) {
+ uninstallListLabel.setVisible(false);
+ uninstallListPane.setVisible(false);
+ } else {
+ uninstallListLabel.setVisible(true);
+ uninstallListPane.setVisible(true);
+ }
+
+ downloadSizeLabel.setVisible(false);
+ downloadSizeValue.setVisible(false);
+ for (RegistryNode remoteNode : registry.getNodes(RegistryType.REMOTE)) {
+ if (remoteNode.isVisible()) {
+ downloadSizeLabel.setVisible(true);
+ downloadSizeValue.setVisible(true);
+ }
+ }
+
+ if (Boolean.getBoolean(REMOVE_APP_USERDIR_PROPERTY)) {
+ removeUserdirCheckbox.doClick();
+ }
+
+ removeUserdirCheckbox.setVisible(false);
+ removeUserdirPane.setVisible(false);
+
+ for (Product product : Registry.getInstance().getProductsToUninstall()) {
+
+ try {
+ File installLocation = product.getInstallationLocation();
+ LogManager.log("... product installation directory: " + installLocation);
+ File userDir = NetBeansRCPUtils.getApplicationUserDirFile(installLocation);
+ LogManager.log("... product userdir: " + userDir);
+ if (FileUtils.exists(userDir) && FileUtils.canWrite(userDir)) {
+ removeUserdirCheckbox.setText(
+ StringUtils.format(
+ panel.getProperty(REMOVE_APP_USERDIR_CHECKBOX_PROPERTY),
+ userDir.getAbsolutePath()));
+ removeUserdirCheckbox.setBorder(new EmptyBorder(0, 0, 0, 0));
+ removeUserdirCheckbox.setVisible(true);
+
+ removeUserdirPane.setVisible(true);
+ removeUserdirPane.setContentType("text/html");
+
+ removeUserdirPane.setText(
+ StringUtils.format(
+ panel.getProperty(REMOVE_APP_USERDIR_TEXT_PROPERTY),
+ product.getDisplayName()));
+
+ }
+ break;
+ } catch (IOException e) {
+ LogManager.log(e);
+ }
+
+ }
+
+ //if(productCheckboxList!=null) {
+ // for(Pair pair : productCheckboxList) {
+ // pair.getSecond().doClick();
+ // }
+ //}
+ super.initialize();
+ }
+
+ @Override
+ protected String validateInput() {
+ try {
+ if (!Boolean.getBoolean(SystemUtils.NO_SPACE_CHECK_PROPERTY)) {
+ final List roots =
+ SystemUtils.getFileSystemRoots();
+ final List toInstall =
+ Registry.getInstance().getProductsToInstall();
+ final Map spaceMap =
+ new HashMap();
+
+ LogManager.log("Available roots : " + StringUtils.asString(roots));
+
+ File downloadDataDirRoot = FileUtils.getRoot(
+ Installer.getInstance().getLocalDirectory(), roots);
+ long downloadSize = 0;
+ for (Product product : toInstall) {
+ downloadSize += product.getDownloadSize();
+ }
+ // the critical check point - we download all the data
+ spaceMap.put(downloadDataDirRoot, new Long(downloadSize));
+ long lastDataSize = 0;
+ for (Product product : toInstall) {
+ final File installLocation = product.getInstallationLocation();
+ final File root = FileUtils.getRoot(installLocation, roots);
+ final long productSize = product.getRequiredDiskSpace();
+
+ LogManager.log(" [" + root + "] <- " + installLocation);
+
+ if (root != null) {
+ Long ddSize = spaceMap.get(downloadDataDirRoot);
+ // remove space that was freed after the remove of previos product data
+ spaceMap.put(downloadDataDirRoot,
+ Long.valueOf(ddSize - lastDataSize));
+
+ // add space required for next product installation
+ Long size = spaceMap.get(root);
+ size = Long.valueOf(
+ (size != null ? size.longValue() : 0L)
+ + productSize);
+ spaceMap.put(root, size);
+ lastDataSize = product.getDownloadSize();
+ } else {
+ return StringUtils.format(
+ panel.getProperty(ERROR_NON_EXISTENT_ROOT_PROPERTY),
+ product, installLocation);
+ }
+ }
+
+ for (File root : spaceMap.keySet()) {
+ try {
+ final long availableSpace =
+ SystemUtils.getFreeSpace(root);
+ final long requiredSpace =
+ spaceMap.get(root) + REQUIRED_SPACE_ADDITION;
+
+ if (availableSpace < requiredSpace) {
+ return StringUtils.format(
+ panel.getProperty(ERROR_NOT_ENOUGH_SPACE_PROPERTY),
+ root,
+ StringUtils.formatSize(requiredSpace - availableSpace));
+ }
+ } catch (NativeException e) {
+ ErrorManager.notifyError(
+ panel.getProperty(ERROR_CANNOT_CHECK_SPACE_PROPERTY),
+ e);
+ }
+ }
+ }
+
+ final List toUninstall =
+ Registry.getInstance().getProductsToUninstall();
+ for (Product product : toUninstall) {
+ if (!FileUtils.canWrite(product.getInstallationLocation())) {
+ return StringUtils.format(
+ panel.getProperty(ERROR_CANNOT_WRITE_PROPERTY),
+ product,
+ product.getInstallationLocation());
+ }
+ }
+
+ } catch (IOException e) {
+ ErrorManager.notifyError(
+ panel.getProperty(ERROR_FSROOTS_PROPERTY), e);
+ }
+
+ return null;
+ }
+
+ // private //////////////////////////////////////////////////////////////////
+ private void initComponents() {
+ gridy = 0;
+
+ // locationsPane ////////////////////////////////////////////////////////
+ locationsPane = new NbiTextPane();
+
+ // uninstallListPane ////////////////////////////////////////////////////
+ uninstallListPane = new NbiTextPane();
+
+ // uninstallListLabel ///////////////////////////////////////////////////
+ uninstallListLabel = new NbiLabel();
+ uninstallListLabel.setLabelFor(uninstallListPane);
+
+ // installationSizeValue ////////////////////////////////////////////////
+ installationSizeValue = new NbiLabel();
+ //installationSizeValue.setFocusable(true);
+
+ // installationSizeLabel ////////////////////////////////////////////////
+ installationSizeLabel = new NbiLabel();
+ installationSizeLabel.setLabelFor(installationSizeValue);
+
+ // downloadSizeValue ////////////////////////////////////////////////////
+ downloadSizeValue = new NbiLabel();
+ //downloadSizeValue.setFocusable(true);
+
+ // downloadSizeLabel ////////////////////////////////////////////////////
+ downloadSizeLabel = new NbiLabel();
+ downloadSizeLabel.setLabelFor(downloadSizeValue);
+
+ // spacer ///////////////////////////////////////////////////////////////
+ spacer = new NbiPanel();
+
+ // this /////////////////////////////////////////////////////////////////
+ add(locationsPane, new GridBagConstraints(
+ 0, gridy++, // x, y
+ 1, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.PAGE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(11, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+ add(uninstallListLabel, new GridBagConstraints(
+ 0, gridy++, // x, y
+ 1, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.PAGE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(11, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+ add(uninstallListPane, new GridBagConstraints(
+ 0, gridy++, // x, y
+ 1, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.PAGE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(0, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+ int gridy0 = gridy;
+ gridy++;
+
+ removeUserdirPane = new NbiTextPane();
+ add(removeUserdirPane, new GridBagConstraints(
+ 0, gridy++, // x, y
+ 1, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.PAGE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(11, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+
+ removeUserdirCheckbox = new NbiCheckBox();
+ add(removeUserdirCheckbox, new GridBagConstraints(
+ 0, gridy++, // x, y
+ 1, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.PAGE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(4, 20, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+
+ removeUserdirCheckbox.addActionListener(new ActionListener() {
+
+ public void actionPerformed(ActionEvent e) {
+ System.setProperty(REMOVE_APP_USERDIR_PROPERTY,
+ "" + removeUserdirCheckbox.isSelected());
+ }
+ });
+
+ add(installationSizeLabel, new GridBagConstraints(
+ 0, gridy++, // x, y
+ 1, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.LINE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(22, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+ add(installationSizeValue, new GridBagConstraints(
+ 0, gridy++, // x, y
+ 1, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.LINE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(4, 22, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+ add(downloadSizeLabel, new GridBagConstraints(
+ 0, gridy++, // x, y
+ 1, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.LINE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(4, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+ add(downloadSizeValue, new GridBagConstraints(
+ 0, gridy++, // x, y
+ 1, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.LINE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(4, 22, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+ add(spacer, new GridBagConstraints(
+ 0, gridy + 10, // x, y
+ 1, 1, // width, height
+ 1.0, 1.0, // weight-x, weight-y
+ GridBagConstraints.CENTER, // anchor
+ GridBagConstraints.BOTH, // fill
+ new Insets(0, 11, 0, 11), // padding
+ 0, 0)); // padx, pady - ???
+ }
+ }
+/////////////////////////////////////////////////////////////////////////////////
+// Constants
+ public static final String INSTALLATION_FOLDER_PROPERTY =
+ "installation.folder"; // NOI18N
+ public static final String UNINSTALL_LABEL_TEXT_PROPERTY =
+ "uninstall.list.label.text"; // NOI18N
+ public static final String INSTALLATION_SIZE_PROPERTY =
+ "installation.size"; // NOI18N
+ public static final String DOWNLOAD_SIZE_PROPERTY =
+ "download.size"; // NOI18N
+ public static final String ERROR_NOT_ENOUGH_SPACE_PROPERTY =
+ "error.not.enough.space"; // NOI18N
+ public static final String ERROR_CANNOT_CHECK_SPACE_PROPERTY =
+ "error.cannot.check.space"; // NOI18N
+ public static final String ERROR_LOGIC_ACCESS_PROPERTY =
+ "error.logic.access"; // NOI18N
+ public static final String ERROR_FSROOTS_PROPERTY =
+ "error.fsroots"; // NOI18N
+ public static final String ERROR_NON_EXISTENT_ROOT_PROPERTY =
+ "error.non.existent.root"; // NOI18N
+ public static final String ERROR_CANNOT_WRITE_PROPERTY =
+ "error.cannot.write"; // NOI18N
+ public static final String REMOVE_APP_USERDIR_PROPERTY =
+ "remove.app.userdir";
+ public static final String REMOVE_APP_USERDIR_TEXT_PROPERTY =
+ "remove.app.userdir.text";
+ public static final String REMOVE_APP_USERDIR_CHECKBOX_PROPERTY =
+ "remove.app.userdir.checkbox";
+ public static final String DEFAULT_TITLE =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.title"); // NOI18N
+ public static final String DEFAULT_DESCRIPTION =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.description"); // NOI18N
+ public static final String DEFAULT_DESCRIPTION_UNINSTALL =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.description.uninstall"); // NOI18N
+ public static final String DEFAULT_INSTALLATION_FOLDER =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.installation.folder"); // NOI18N
+ public static final String DEFAULT_UNINSTALL_LABEL_TEXT =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.uninstall.list.label.text"); // NOI18N
+ public static final String DEFAULT_INSTALLATION_SIZE =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.installation.size"); // NOI18N
+ public static final String DEFAULT_DOWNLOAD_SIZE =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.download.size"); // NOI18N
+ public static final String DEFAULT_NEXT_BUTTON_TEXT =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.next.button.text"); // NOI18N
+ public static final String DEFAULT_NEXT_BUTTON_TEXT_UNINSTALL =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.next.button.text.uninstall"); // NOI18N
+ public static final String DEFAULT_ERROR_NOT_ENOUGH_SPACE =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.error.not.enough.space"); // NOI18N
+ public static final String DEFAULT_ERROR_CANNOT_CHECK_SPACE =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.error.cannot.check.space");// NOI18N
+ public static final String DEFAULT_ERROR_LOGIC_ACCESS =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.error.logic.access");// NOI18N
+ public static final String DEFAULT_ERROR_FSROOTS =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.error.fsroots"); // NOI18N
+ public static final String DEFAULT_ERROR_NON_EXISTENT_ROOT =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.error.non.existent.root"); // NOI18N
+ public static final String DEFAULT_ERROR_CANNOT_WRITE =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.error.cannot.write"); // NOI18N
+ public static final String DEFAULT_REMOVE_APP_USERDIR_TEXT =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.remove.app.userdir.text"); // NOI18N
+
+ public static final String DEFAULT_REMOVE_APP_USERDIR_CHECKBOX =
+ ResourceUtils.getString(PreInstallSummaryPanel.class,
+ "PrISP.remove.app.userdir.checkbox"); // NOI18N
+ public static final long REQUIRED_SPACE_ADDITION =
+ 10L * 1024L * 1024L; // 10MB
+}
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/WelcomePanel.java b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/WelcomePanel.java
new file mode 100644
index 000000000..c1cc01575
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/WelcomePanel.java
@@ -0,0 +1,333 @@
+/*
+ * 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-2007 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.mycompany.installer.wizard.components.panels;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+import java.io.File;
+import java.util.List;
+import org.netbeans.installer.product.Registry;
+import org.netbeans.installer.product.components.Product;
+import org.netbeans.installer.utils.ErrorManager;
+import org.netbeans.installer.utils.LogManager;
+import org.netbeans.installer.utils.ResourceUtils;
+import org.netbeans.installer.utils.StringUtils;
+import org.netbeans.installer.utils.SystemUtils;
+import org.netbeans.installer.utils.exceptions.InitializationException;
+import org.netbeans.installer.utils.helper.Platform;
+import org.netbeans.installer.utils.helper.swing.NbiPanel;
+import org.netbeans.installer.utils.helper.swing.NbiTextPane;
+import org.netbeans.installer.wizard.components.panels.ErrorMessagePanel;
+import org.netbeans.installer.wizard.components.panels.ErrorMessagePanel.ErrorMessagePanelSwingUi;
+import org.netbeans.installer.wizard.components.panels.ErrorMessagePanel.ErrorMessagePanelUi;
+import org.netbeans.installer.wizard.containers.SwingContainer;
+import org.netbeans.installer.wizard.ui.SwingUi;
+import org.netbeans.installer.wizard.ui.WizardUi;
+
+/**
+ *
+ * @author Dmitry Lipin
+ */
+public class WelcomePanel extends ErrorMessagePanel {
+ /////////////////////////////////////////////////////////////////////////////////
+ private Registry bundledRegistry;
+ private Registry defaultRegistry;
+
+ public WelcomePanel() {
+ setProperty(TITLE_PROPERTY,
+ DEFAULT_TITLE);
+ setProperty(DESCRIPTION_PROPERTY,
+ DEFAULT_DESCRIPTION);
+
+ setProperty(WELCOME_TEXT_PROPERTY,
+ DEFAULT_WELCOME_TEXT);
+
+ setProperty(WELCOME_ALREADY_INSTALLED_TEXT_PROPERTY,
+ DEFAULT_WELCOME_ALREADY_INSTALLED_TEXT);
+ setProperty(WELCOME_ALREADY_INSTALLED_NEXT_BUTTON_TEXT_PROPERTY,
+ DEFAULT_WELCOME_ALREADY_INSTALLED_NEXT_BUTTON_TEXT);
+
+ try {
+ defaultRegistry = Registry.getInstance();
+ bundledRegistry = new Registry();
+
+ final String bundledRegistryUri = System.getProperty(
+ Registry.BUNDLED_PRODUCT_REGISTRY_URI_PROPERTY);
+ if (bundledRegistryUri != null) {
+ bundledRegistry.loadProductRegistry(bundledRegistryUri);
+ } else {
+ bundledRegistry.loadProductRegistry(
+ Registry.DEFAULT_BUNDLED_PRODUCT_REGISTRY_URI);
+ }
+ } catch (InitializationException e) {
+ ErrorManager.notifyError("Cannot load bundled registry", e);
+ }
+
+ }
+
+ Registry getBundledRegistry() {
+ return bundledRegistry;
+ }
+
+ @Override
+ public WizardUi getWizardUi() {
+ if (wizardUi == null) {
+ wizardUi = new WelcomePanelUi(this);
+ }
+
+ return wizardUi;
+ }
+
+ @Override
+ public boolean canExecuteForward() {
+ return canExecute();
+ }
+
+ @Override
+ public boolean canExecuteBackward() {
+ return canExecute();
+ }
+
+ // private //////////////////////////////////////////////////////////////////////
+ private boolean canExecute() {
+ return bundledRegistry.getNodes().size() > 1;
+ }
+
+ /////////////////////////////////////////////////////////////////////////////////
+ // Inner Classes
+ public static class WelcomePanelUi extends ErrorMessagePanelUi {
+
+ protected WelcomePanel component;
+
+ public WelcomePanelUi(WelcomePanel component) {
+ super(component);
+
+ this.component = component;
+ }
+
+ @Override
+ public SwingUi getSwingUi(SwingContainer container) {
+ if (swingUi == null) {
+ swingUi = new WelcomePanelSwingUi(component, container);
+ }
+
+ return super.getSwingUi(container);
+ }
+ }
+
+ public static class WelcomePanelSwingUi extends ErrorMessagePanelSwingUi {
+
+ protected WelcomePanel panel;
+ private NbiTextPane textPane;
+
+ private NbiPanel leftImagePanel;
+ ValidatingThread validatingThread;
+
+ public WelcomePanelSwingUi(
+ final WelcomePanel component,
+ final SwingContainer container) {
+ super(component, container);
+
+ this.panel = component;
+
+ initComponents();
+ }
+
+ @Override
+ public String getTitle() {
+ return null; // the welcome page does not have a title
+ }
+
+ // protected ////////////////////////////////////////////////////////////////
+ @Override
+ protected void initializeContainer() {
+ super.initializeContainer();
+
+ container.getBackButton().setVisible(false);
+ }
+
+ @Override
+ protected void initialize() {
+
+ textPane.setContentType("text/html");
+ textPane.setText(StringUtils.format(panel.getProperty(WELCOME_TEXT_PROPERTY)));
+ List toInstall = Registry.getInstance().getProductsToInstall();
+ if(toInstall.isEmpty()) {
+ List list = panel.getBundledRegistry().getProducts();
+ if(list.size() == 1) {
+ if(SystemUtils.getCurrentPlatform().isCompatibleWith(list.get(0).getPlatforms())) {
+ File installationLocation = list.get(0).getInstallationLocation();
+ textPane.setText(
+ StringUtils.format(
+ panel.getProperty(WELCOME_ALREADY_INSTALLED_TEXT_PROPERTY),
+ list.get(0).getDisplayName(),
+ installationLocation.getAbsolutePath()));
+ } else {
+ textPane.setText(
+ StringUtils.format(
+ WELCOME_INCOMPATIBLE_PLATFORM_TEXT,
+ list.get(0).getDisplayName()));
+ }
+ container.getCancelButton().setVisible(false);
+ container.getNextButton().setText(panel.getProperty(
+ WELCOME_ALREADY_INSTALLED_NEXT_BUTTON_TEXT_PROPERTY));
+ }
+ }
+
+ super.initialize();
+ }
+
+ // private //////////////////////////////////////////////////////////////////
+ private void initComponents() {
+ // textPane /////////////////////////////////////////////////////////////
+ textPane = new NbiTextPane();
+
+ leftImagePanel = new NbiPanel();
+ int width = 0;
+ int height = 0;
+ final String topLeftImage = SystemUtils.resolveString(
+ System.getProperty(
+ WELCOME_PAGE_LEFT_TOP_IMAGE_PROPERTY));
+ final String bottomLeftImage = SystemUtils.resolveString(
+ System.getProperty(
+ WELCOME_PAGE_LEFT_BOTTOM_IMAGE_PROPERTY));
+
+ int bottomAnchor = NbiPanel.ANCHOR_BOTTOM_LEFT;
+
+ if (topLeftImage != null) {
+ leftImagePanel.setBackgroundImage(topLeftImage, ANCHOR_TOP_LEFT);
+ width = leftImagePanel.getBackgroundImage(NbiPanel.ANCHOR_TOP_LEFT).getIconWidth();
+ height += leftImagePanel.getBackgroundImage(NbiPanel.ANCHOR_TOP_LEFT).getIconHeight();
+ }
+ if (bottomLeftImage != null) {
+ leftImagePanel.setBackgroundImage(bottomLeftImage, bottomAnchor);
+ width = leftImagePanel.getBackgroundImage(bottomAnchor).getIconWidth();
+ height += leftImagePanel.getBackgroundImage(bottomAnchor).getIconHeight();
+ }
+
+ leftImagePanel.setPreferredSize(new Dimension(width, height));
+ leftImagePanel.setMaximumSize(new Dimension(width, height));
+ leftImagePanel.setMinimumSize(new Dimension(width, 0));
+ leftImagePanel.setSize(new Dimension(width, height));
+
+ leftImagePanel.setOpaque(false);
+ // this /////////////////////////////////////////////////////////////////
+ int dy = 0;
+ add(leftImagePanel, new GridBagConstraints(
+ 0, 0, // x, y
+ 1, 100, // width, height
+ 0.0, 1.0, // weight-x, weight-y
+ GridBagConstraints.WEST, // anchor
+ GridBagConstraints.VERTICAL, // fill
+ new Insets(0, 0, 0, 0), // padding
+ 0, 0)); // padx, pady - ???
+ add(textPane, new GridBagConstraints(
+ 1, dy++, // x, y
+ 4, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.LINE_START, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(10, 11, 11, 11), // padding
+ 0, 0)); // padx, pady - ???
+
+ NbiTextPane separatorPane = new NbiTextPane();
+
+ separatorPane = new NbiTextPane();
+ add(separatorPane, new GridBagConstraints(
+ 3, dy, // x, y
+ 1, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.CENTER, // anchor
+ GridBagConstraints.BOTH, // fill
+ new Insets(0, 0, 0, 0), // padding
+ 0, 0)); // padx, pady - ???
+
+
+ // move error label after the left welcome image
+ Component errorLabel = getComponent(0);
+ getLayout().removeLayoutComponent(errorLabel);
+ add(errorLabel, new GridBagConstraints(
+ 1, 99, // x, y
+ 99, 1, // width, height
+ 1.0, 0.0, // weight-x, weight-y
+ GridBagConstraints.CENTER, // anchor
+ GridBagConstraints.HORIZONTAL, // fill
+ new Insets(4, 11, 4, 0), // padding
+ 0, 0)); // ??? (padx, pady)
+
+
+ }
+ }
+ /////////////////////////////////////////////////////////////////////////////////
+ // Constants
+ public static final String DEFAULT_TITLE =
+ ResourceUtils.getString(WelcomePanel.class,
+ "WP.title");
+ public static final String DEFAULT_DESCRIPTION =
+ ResourceUtils.getString(WelcomePanel.class,
+ "WP.description"); // NOI18N
+ public static final String WELCOME_TEXT_PROPERTY =
+ "welcome.text"; // NOI18N
+ public static final String WELCOME_ALREADY_INSTALLED_TEXT_PROPERTY =
+ "welcome.already.installed.text"; // NOI18N
+ public static final String WELCOME_ALREADY_INSTALLED_NEXT_BUTTON_TEXT_PROPERTY =
+ "welcome.already.installed.next.button.text";//NOI18N
+ public static final String WELCOME_INCOMPATIBLE_PLATFORM_TEXT =
+ ResourceUtils.getString(WelcomePanel.class,
+ "WP.incompatible.platform.text");//NOI18N
+
+ public static final String DEFAULT_WELCOME_ALREADY_INSTALLED_NEXT_BUTTON_TEXT =
+ ResourceUtils.getString(WelcomePanel.class,
+ "WP.already.installed.next.button.text");//NOI18N
+
+ public static final String DEFAULT_WELCOME_TEXT =
+ ResourceUtils.getString(WelcomePanel.class,
+ "WP.welcome.text"); // NOI18N
+
+ public static final String DEFAULT_WELCOME_ALREADY_INSTALLED_TEXT =
+ ResourceUtils.getString(WelcomePanel.class,
+ "WP.already.installed.text"); // NOI18N
+
+ public static final String WELCOME_PAGE_LEFT_TOP_IMAGE_PROPERTY =
+ "nbi.wizard.ui.swing.welcome.left.top.image";//NOI18N
+ public static final String WELCOME_PAGE_LEFT_BOTTOM_IMAGE_PROPERTY =
+ "nbi.wizard.ui.swing.welcome.left.bottom.image";//NOI18N
+}
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/resources/welcome-left-bottom.png b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/resources/welcome-left-bottom.png
new file mode 100644
index 000000000..6d9585bf2
Binary files /dev/null and b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/resources/welcome-left-bottom.png differ
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/resources/welcome-left-top.png b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/resources/welcome-left-top.png
new file mode 100644
index 000000000..13adb1221
Binary files /dev/null and b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/panels/resources/welcome-left-top.png differ
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/sequences/Bundle.properties b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/sequences/Bundle.properties
new file mode 100644
index 000000000..62ce479bb
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/sequences/Bundle.properties
@@ -0,0 +1,43 @@
+#
+# 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-2007 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.
+#
+
+#####################################################################################
+# MainSequence.java
+MS.IA.title=Installation
+MS.IA.description=Please wait while the installer installs {product-name}.
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/sequences/MainSequence.java b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/sequences/MainSequence.java
new file mode 100644
index 000000000..86534f690
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/components/sequences/MainSequence.java
@@ -0,0 +1,154 @@
+/*
+ * 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-2007 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.mycompany.installer.wizard.components.sequences;
+
+import org.netbeans.installer.wizard.components.sequences.ProductWizardSequence;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.mycompany.installer.wizard.components.panels.PostInstallSummaryPanel;
+import org.mycompany.installer.wizard.components.panels.PreInstallSummaryPanel;
+import org.netbeans.installer.product.components.Product;
+import org.netbeans.installer.product.Registry;
+import org.netbeans.installer.utils.ResourceUtils;
+import org.netbeans.installer.utils.helper.ExecutionMode;
+import org.netbeans.installer.wizard.components.WizardSequence;
+import org.netbeans.installer.wizard.components.actions.DownloadConfigurationLogicAction;
+import org.netbeans.installer.wizard.components.actions.DownloadInstallationDataAction;
+import org.netbeans.installer.wizard.components.actions.InstallAction;
+import org.netbeans.installer.wizard.components.actions.UninstallAction;
+import org.netbeans.installer.wizard.components.panels.LicensesPanel;
+
+/**
+ *
+ * @author Dmitry Lipin
+ */
+public class MainSequence extends WizardSequence {
+ /////////////////////////////////////////////////////////////////////////////////
+ // Instance
+
+ private DownloadConfigurationLogicAction downloadConfigurationLogicAction;
+ private LicensesPanel licensesPanel;
+ private PreInstallSummaryPanel preInstallSummaryPanel;
+ private UninstallAction uninstallAction;
+ private DownloadInstallationDataAction downloadInstallationDataAction;
+ private InstallAction installAction;
+ private PostInstallSummaryPanel postInstallSummaryPanel;
+ private Map productSequences;
+
+ public MainSequence() {
+ downloadConfigurationLogicAction = new DownloadConfigurationLogicAction();
+ licensesPanel = new LicensesPanel();
+ preInstallSummaryPanel = new PreInstallSummaryPanel();
+ uninstallAction = new UninstallAction();
+ downloadInstallationDataAction = new DownloadInstallationDataAction();
+ installAction = new InstallAction();
+ postInstallSummaryPanel = new PostInstallSummaryPanel();
+ productSequences = new HashMap();
+
+ installAction.setProperty(InstallAction.TITLE_PROPERTY,
+ DEFAULT_IA_TITLE);
+ installAction.setProperty(InstallAction.DESCRIPTION_PROPERTY,
+ DEFAULT_IA_DESCRIPTION);
+ }
+
+ @Override
+ public void executeForward() {
+ final Registry registry = Registry.getInstance();
+ final List toInstall = registry.getProductsToInstall();
+ final List toUninstall = registry.getProductsToUninstall();
+
+ // remove all current children (if there are any), as the components
+ // selection has probably changed and we need to rebuild from scratch
+ getChildren().clear();
+
+ // the set of wizard components differs greatly depending on the execution
+ // mode - if we're installing, we ask for input, run a wizard sequence for
+ // each selected component and then download and install; if we're creating
+ // a bundle, we only need to download and package things
+
+ if (toInstall.size() > 0) {
+ addChild(downloadConfigurationLogicAction);
+ addChild(licensesPanel);
+
+ for (Product product : toInstall) {
+ if (!productSequences.containsKey(product)) {
+ productSequences.put(
+ product,
+ new ProductWizardSequence(product));
+ }
+
+ addChild(productSequences.get(product));
+ }
+ }
+
+ addChild(preInstallSummaryPanel);
+
+ if (toUninstall.size() > 0) {
+ addChild(uninstallAction);
+ }
+
+ if (toInstall.size() > 0) {
+ addChild(downloadInstallationDataAction);
+ addChild(installAction);
+ }
+
+ addChild(postInstallSummaryPanel);
+
+ super.executeForward();
+ }
+
+ @Override
+ public boolean canExecuteForward() {
+ return ExecutionMode.NORMAL == ExecutionMode.getCurrentExecutionMode() &&
+ (Registry.getInstance().getProductsToInstall().size() > 0 ||
+ Registry.getInstance().getProductsToUninstall().size() > 0);
+ }
+ /////////////////////////////////////////////////////////////////////////////////
+ // Constants
+ public static final String DEFAULT_IA_TITLE =
+ ResourceUtils.getString(
+ MainSequence.class,
+ "MS.IA.title"); // NOI18N
+ public static final String DEFAULT_IA_DESCRIPTION =
+ ResourceUtils.getString(
+ MainSequence.class,
+ "MS.IA.description"); // NOI18N
+
+}
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/wizard-components.xml b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/wizard-components.xml
new file mode 100644
index 000000000..6b9509d7c
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/wizard-components.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/wizard-description-background-left.png b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/wizard-description-background-left.png
new file mode 100644
index 000000000..6fe816aed
Binary files /dev/null and b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/wizard-description-background-left.png differ
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/wizard-description-background-right.png b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/wizard-description-background-right.png
new file mode 100644
index 000000000..f395ba518
Binary files /dev/null and b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/wizard-description-background-right.png differ
diff --git a/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/wizard-icon.png b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/wizard-icon.png
new file mode 100644
index 000000000..a8c0f8c34
Binary files /dev/null and b/sdk/harness/nbi/stub/ext/engine/src/org/mycompany/installer/wizard/wizard-icon.png differ
diff --git a/sdk/harness/nbi/stub/ext/infra/build/engine/build.properties b/sdk/harness/nbi/stub/ext/infra/build/engine/build.properties
new file mode 100644
index 000000000..13c71c7ac
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/infra/build/engine/build.properties
@@ -0,0 +1,77 @@
+#
+# 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-2007 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.
+#
+
+# path to the directory where the base build scripts library and properties
+# reside
+common.dir=../../../../.common
+
+# path to the local working directory; this directory which will be the target
+# for checking out the sources and will be used for the build process
+# * this path can be either absolute or relative in any unix environment,
+# however, only relative paths are supported on windows, as the cygwin scp
+# command does not properly handle colon in local paths
+work.dir=./build
+
+# path to the local distributive directory; this directory will contain the
+# distributive file, when (if) the build script finishes successfully
+dist.dir=./dist
+
+# path to the engine sources within the cvs module; it should be a relative
+# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module
+# name, the path should be 'engine'
+cvs.path=engine
+
+# name of the engine's distributive file
+engine.dist.file.name=nbi-engine.jar
+
+# we do not need to build anything native for the netbeans-specific engine, as it
+# does not contain any native components
+build.native=false
+
+# custom parameter for the netbeans project build script - in case of the netbeans
+# nbi engine - the location of the core engine jar file
+nb.custom.parameter=-Dreference.NBI_Engine.jar=${core.engine.dist.file}
+
+# sources parameters; a search-and-replace will be run over the sources after
+# check-out, replacing [token] => [value]; regular expressions are not allowed
+# * ${sources.params.length} - total number of the parameters
+# * indices should start with 1
+# * parameters are not i18n compliant
+
+sources.params.length=0
diff --git a/sdk/harness/nbi/stub/ext/infra/build/engine/build.xml b/sdk/harness/nbi/stub/ext/infra/build/engine/build.xml
new file mode 100644
index 000000000..eec305c73
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/infra/build/engine/build.xml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ In order to 'clean', 'checkout' and 'build' the engine use the
+ 'build-all' target. To 'clean', 'checkout', 'build' and
+ 'release' - use 'release-all'.
+
+ For more details, please see the source of this build script.
+
+
+
diff --git a/sdk/harness/nbi/stub/ext/infra/build/products/helloworld/build.properties b/sdk/harness/nbi/stub/ext/infra/build/products/helloworld/build.properties
new file mode 100644
index 000000000..b2084d4c7
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/infra/build/products/helloworld/build.properties
@@ -0,0 +1,159 @@
+#
+# 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-2007 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.
+#
+
+# path to the directory where the base build scripts library and properties
+# reside
+common.dir=../../../../../.common
+
+# path to the local working directory; this directory which will be the target
+# for checking out the sources and will be used for the build process
+# * this path can be either absolute or relative in any unix environment,
+# however, only relative paths are supported on windows, as the cygwin scp
+# command does not properly handle colon in local paths
+work.dir=./build
+
+# path to the local distributive directory; this directory will contain the
+# distributive file, when (if) the build script finishes successfully
+dist.dir=./dist
+
+# path to the products's sources within the cvs module; it should be a relative
+# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module
+# name, the path should be 'engine'
+cvs.path=components/products/helloworld
+
+# core product properties:
+# * ${product.uid} - product "family" (e.g. nb-ide)
+# * ${product.version} - actual products' version; together with the uid it
+# forms the unique identifier for the product)
+# * ${product.platforms} - the list of platforms that are supported by this
+# product (note that this property is not related to native libraries)
+product.uid={product-uid}
+product.version=0.6.1.0.0
+product.platforms=generic
+
+# miscellaneous product properties:
+# * ${product.status} - default status that the product will have in the
+# registry. it is meant to be always "not-installed", unless you want
+# something really exotic
+# * ${product.offset} - order of the product's node among its parent's
+# children, the bigger the offset value, the further the product's node will
+# be
+# * ${product.expand} - whether to automatically expand the product's node in
+# the components tree or not; 'true'/'false'
+# * ${product.visible} - whether the product's node is visible or not (note
+# that this value will be modified at nbi runtime, 'true' may become 'false'
+# if the product is filtered out); 'true'/'false'
+# * ${product.features} - list of features that this porduct belongs to; the
+# list should be space-separated
+product.status=not-installed
+product.offset=20000
+product.expand=false
+product.visible=true
+product.features=
+
+# list of configuration logic jar files; normally the first one would be the
+# distributive file of the product's netbeans project
+# * ${product.logic.length} - total number of the files
+# * indices should start with 1
+product.logic.length=1
+product.logic.1.path=${nbproject.dist.dir}/${nbproject.dist.file.name}
+
+# list of product installation data files
+# * ${product.data.length} - total number of the files
+# * ${product.data.N.uri} - uri at which the installation data file is located
+# * ${product.data.N.zip} - whether the data file is a zip archive which needs to
+# be extracted or it is a file that should be used directly; 'true'/'false'
+# * indices should start with 1
+product.data.length=1
+product.data.1.zip=true
+product.data.1.path={product-data-path}
+product.data.sub.dir={product-data-sub-dir}
+
+# modificator for the required disk space parameter; the core value will be the
+# sum of unzipped unstallation data files
+# * the measurement unit is one byte
+product.disk.space.modificator=0
+
+# product's requirements (i.e. other products that should be installed
+# in order for this product to succesfully install and function)
+# * ${product.requirements.length} - total number of the requirements
+# * indices should start with 1
+product.requirements.length=0
+#product.requirements.1.uid=
+#product.requirements.1.version-lower=
+#product.requirements.1.version-upper=
+
+# product's conflicts (i.e. other products that prevent this product from
+# functioning correctly, and thus cannot be installed together with it)
+# * ${product.conflicts.length} - total number of the conflicts
+# * indices should start with 1
+product.conflicts.length=0
+#product.conflicts.1.uid=
+#product.conflicts.1.version-lower=
+#product.conflicts.1.version-upper=
+
+# other products that should be installed prior to this product; these
+# dependencies do not imply that the dependent product will be installed at
+# all, but if both the current and the dependent product are selected for
+# installation, the latter will be installed first
+# * ${product.install-afters.length} - total number of the install-afters
+# * indices should start with 1
+product.install-afters.length=0
+#product.install-afters.1.uid=
+
+# additional product's properties; these will appear in the product's
+# descriptor and in the registry in the form of
+# value tags.
+# * ${product.properties.length} - total number of the properties
+# * indices should start with 1
+# * properties are not i18n compliant
+product.properties.length=3
+product.properties.1.name=installation.location
+product.properties.1.value=$N{install}/{product-install-directory-name}
+product.properties.2.name=installation.location.windows
+product.properties.2.value=$N{install}/{product-install-directory-name-windows}
+product.properties.3.name=installation.location.macosx
+product.properties.3.value=$N{install}/{product-install-directory-name-macosx}.app
+
+# sources parameters; a search-and-replace will be run over the sources after
+# check-out, replacing [token] => [value]; regular expressions are not allowed
+# * ${sources.params.length} - total number of the parameters
+# * indices should start with 1
+# * parameters are not i18n compliant
+sources.params.length=0
\ No newline at end of file
diff --git a/sdk/harness/nbi/stub/ext/infra/build/products/helloworld/build.xml b/sdk/harness/nbi/stub/ext/infra/build/products/helloworld/build.xml
new file mode 100644
index 000000000..00fbe27f3
--- /dev/null
+++ b/sdk/harness/nbi/stub/ext/infra/build/products/helloworld/build.xml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ In order to 'clean', 'checkout' and 'build' the group use the
+ 'build-all' target. To 'clean', 'checkout', 'build' and
+ 'release' - use 'release-all'.
+
+ For more details, please see the source of this build script.
+
+
+
diff --git a/sdk/harness/nbi/stub/template.xml b/sdk/harness/nbi/stub/template.xml
new file mode 100644
index 000000000..1a0b4d03b
--- /dev/null
+++ b/sdk/harness/nbi/stub/template.xml
@@ -0,0 +1,192 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/nbi/stub/tmpl.properties b/sdk/harness/nbi/stub/tmpl.properties
new file mode 100644
index 000000000..e8b316a9c
--- /dev/null
+++ b/sdk/harness/nbi/stub/tmpl.properties
@@ -0,0 +1,16 @@
+suite.location=C:/Documents and Settings/Lipin/My Documents/NetBeansProjects/MyApp
+
+nbi.cluster.location=D:/space/NB-IDE/proto/nbbuild/netbeans/extra
+
+nbi.stub.location=${nbi.cluster.location}/nbi/stub
+nbi.stub.common.location=${nbi.cluster.location}/nbi/.common
+nbi.ant.tasks.jar=${nbi.cluster.location}/modules/ext/nbi-ant-tasks.jar
+nbi.registries.management.jar=${nbi.cluster.location}/modules/ext/nbi-registries-management.jar
+nbi.engine.jar=${nbi.cluster.location}/modules/ext/nbi-engine.jar
+
+generate.installer.for.platforms=windows linux macosx
+
+generator-jdk-location-forward-slashes=C:/Program Files/Java/jdk1.5.0_16
+pack200.enabled=false
+
+suite.nbi.product.uid=myapp
\ No newline at end of file
diff --git a/sdk/harness/no-testcoverage.xml b/sdk/harness/no-testcoverage.xml
new file mode 100644
index 000000000..8f53325a7
--- /dev/null
+++ b/sdk/harness/no-testcoverage.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+No test coverage implementation found in ${harness.dir}.
+
+
+
diff --git a/sdk/harness/osgi.xml b/sdk/harness/osgi.xml
new file mode 100644
index 000000000..d0ae88d02
--- /dev/null
+++ b/sdk/harness/osgi.xml
@@ -0,0 +1,187 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/run.xml b/sdk/harness/run.xml
new file mode 100644
index 000000000..5fc85e6d9
--- /dev/null
+++ b/sdk/harness/run.xml
@@ -0,0 +1,259 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ netbeans_extraclusters="${run.extra.clusters}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+The application is already running within the test user directory.
+You must shut it down before trying to run it again.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/suite.xml b/sdk/harness/suite.xml
new file mode 100644
index 000000000..e8c43fd40
--- /dev/null
+++ b/sdk/harness/suite.xml
@@ -0,0 +1,609 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Using build harness in ${harness.dir}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Suite in ${basedir} with clusters ${cluster.path.final}, build cluster ${cluster}, and sorted modules ${modules.sorted}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must have set at least an application name ('app.name')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Note: As of NetBeans 6.7, you can use the property 'cluster.path' instead of the 'create-platform' target.
+See: http://wiki.netbeans.org/DevFaqHowToReuseModules
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+You MacOS Application bundle was created at ${dist.dir}/${app.name}.app. For final packaging, use hdiutil or other tools to create a .dmg image.
+Alternatively use "zip -yr ${app.name}.app" to create a simple zipped distribution.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Will not delete ${test.user.dir} because ${test.user.dir.lock} still exists; kill any running process and delete lock file if necessary
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OSGi support is EXPERIMENTAL for now; see: http://wiki.netbeans.org/NetBeansInOSGi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Property testcoverage.report.dir not set. Test coverage script may be missing in ${harness.dir}.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/tasks.jar b/sdk/harness/tasks.jar
new file mode 100644
index 000000000..8166a3abc
Binary files /dev/null and b/sdk/harness/tasks.jar differ
diff --git a/sdk/harness/testcoverage-suite.xml b/sdk/harness/testcoverage-suite.xml
new file mode 100644
index 000000000..cff283953
--- /dev/null
+++ b/sdk/harness/testcoverage-suite.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/testcoverage.xml b/sdk/harness/testcoverage.xml
new file mode 100644
index 000000000..027ddbd9c
--- /dev/null
+++ b/sdk/harness/testcoverage.xml
@@ -0,0 +1,229 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Test coverage tasks can be currently run only with default java platform, that is
+with property nbjdk.active unset or set to 'default' and with property nbjdk.home
+unset.
+
+For NB.org module, specify properties:
+nbjdk.home.defaulted=true
+permit.jdk6.builds=true
+when running the target.
+
+Current java platform setup is:
+ nbjdk.active: ${nbjdk.active.print}
+ nbjdk.home: ${nbjdk.home.print}
+ nbjdk.home defaulted: ${nbjdk.home.defaulted.print}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/testcoverage/cobertura/cobertura-1.9.3.jar b/sdk/harness/testcoverage/cobertura/cobertura-1.9.3.jar
new file mode 100644
index 000000000..32d69353e
Binary files /dev/null and b/sdk/harness/testcoverage/cobertura/cobertura-1.9.3.jar differ
diff --git a/sdk/harness/testcoverage/cobertura/lib/asm-3.0.jar b/sdk/harness/testcoverage/cobertura/lib/asm-3.0.jar
new file mode 100644
index 000000000..112f5bd4a
Binary files /dev/null and b/sdk/harness/testcoverage/cobertura/lib/asm-3.0.jar differ
diff --git a/sdk/harness/testcoverage/cobertura/lib/asm-tree-3.0.jar b/sdk/harness/testcoverage/cobertura/lib/asm-tree-3.0.jar
new file mode 100644
index 000000000..2a4b20856
Binary files /dev/null and b/sdk/harness/testcoverage/cobertura/lib/asm-tree-3.0.jar differ
diff --git a/sdk/harness/testcoverage/cobertura/lib/jakarta-oro-2.0.8.jar b/sdk/harness/testcoverage/cobertura/lib/jakarta-oro-2.0.8.jar
new file mode 100644
index 000000000..23488d260
Binary files /dev/null and b/sdk/harness/testcoverage/cobertura/lib/jakarta-oro-2.0.8.jar differ
diff --git a/sdk/harness/testcoverage/cobertura/lib/log4j-1.2.9.jar b/sdk/harness/testcoverage/cobertura/lib/log4j-1.2.9.jar
new file mode 100644
index 000000000..a6568b01a
Binary files /dev/null and b/sdk/harness/testcoverage/cobertura/lib/log4j-1.2.9.jar differ
diff --git a/sdk/harness/update_tracking/org-netbeans-insane.xml b/sdk/harness/update_tracking/org-netbeans-insane.xml
new file mode 100644
index 000000000..647d0c592
--- /dev/null
+++ b/sdk/harness/update_tracking/org-netbeans-insane.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/sdk/harness/update_tracking/org-netbeans-libs-nbi-ant.xml b/sdk/harness/update_tracking/org-netbeans-libs-nbi-ant.xml
new file mode 100644
index 000000000..68457f7ca
--- /dev/null
+++ b/sdk/harness/update_tracking/org-netbeans-libs-nbi-ant.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/update_tracking/org-netbeans-libs-nbi-engine.xml b/sdk/harness/update_tracking/org-netbeans-libs-nbi-engine.xml
new file mode 100644
index 000000000..57101b2ae
--- /dev/null
+++ b/sdk/harness/update_tracking/org-netbeans-libs-nbi-engine.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/update_tracking/org-netbeans-modules-apisupport-harness.xml b/sdk/harness/update_tracking/org-netbeans-modules-apisupport-harness.xml
new file mode 100644
index 000000000..16c9a9f2c
--- /dev/null
+++ b/sdk/harness/update_tracking/org-netbeans-modules-apisupport-harness.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/update_tracking/org-netbeans-modules-apisupport-tc-cobertura.xml b/sdk/harness/update_tracking/org-netbeans-modules-apisupport-tc-cobertura.xml
new file mode 100644
index 000000000..358bf2a75
--- /dev/null
+++ b/sdk/harness/update_tracking/org-netbeans-modules-apisupport-tc-cobertura.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/update_tracking/org-netbeans-modules-jellytools-platform.xml b/sdk/harness/update_tracking/org-netbeans-modules-jellytools-platform.xml
new file mode 100644
index 000000000..0268921b2
--- /dev/null
+++ b/sdk/harness/update_tracking/org-netbeans-modules-jellytools-platform.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/sdk/harness/update_tracking/org-netbeans-modules-jemmy.xml b/sdk/harness/update_tracking/org-netbeans-modules-jemmy.xml
new file mode 100644
index 000000000..565ad9350
--- /dev/null
+++ b/sdk/harness/update_tracking/org-netbeans-modules-jemmy.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/sdk/harness/update_tracking/org-netbeans-modules-nbjunit.xml b/sdk/harness/update_tracking/org-netbeans-modules-nbjunit.xml
new file mode 100644
index 000000000..65088b75e
--- /dev/null
+++ b/sdk/harness/update_tracking/org-netbeans-modules-nbjunit.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/sdk/jme3-assetpack-support/build.xml b/sdk/jme3-assetpack-support/build.xml
new file mode 100644
index 000000000..c55b2748e
--- /dev/null
+++ b/sdk/jme3-assetpack-support/build.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+ Builds, tests, and runs the project com.jme3.gde.assetpack.
+
+
+
+
+
+
diff --git a/sdk/jme3-assetpack-support/manifest.mf b/sdk/jme3-assetpack-support/manifest.mf
new file mode 100644
index 000000000..55152c16b
--- /dev/null
+++ b/sdk/jme3-assetpack-support/manifest.mf
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+OpenIDE-Module: com.jme3.gde.assetpack
+OpenIDE-Module-Implementation-Version: 0
+OpenIDE-Module-Install: com/jme3/gde/assetpack/Installer.class
+OpenIDE-Module-Layer: com/jme3/gde/assetpack/layer.xml
+OpenIDE-Module-Localizing-Bundle: com/jme3/gde/assetpack/Bundle.properties
+OpenIDE-Module-Requires: org.openide.windows.WindowManager
+
diff --git a/sdk/jme3-assetpack-support/nbproject/build-impl.xml b/sdk/jme3-assetpack-support/nbproject/build-impl.xml
new file mode 100644
index 000000000..f62520687
--- /dev/null
+++ b/sdk/jme3-assetpack-support/nbproject/build-impl.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ You must set 'suite.dir' to point to your containing module suite
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/jme3-assetpack-support/nbproject/genfiles.properties b/sdk/jme3-assetpack-support/nbproject/genfiles.properties
new file mode 100644
index 000000000..3e43796f0
--- /dev/null
+++ b/sdk/jme3-assetpack-support/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=69b2b49f
+build.xml.script.CRC32=c0969383
+build.xml.stylesheet.CRC32=a56c6a5b@1.42.2
+# 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=71a82056
+nbproject/build-impl.xml.script.CRC32=4d376df0
+nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.42.2
diff --git a/sdk/jme3-assetpack-support/nbproject/project.properties b/sdk/jme3-assetpack-support/nbproject/project.properties
new file mode 100644
index 000000000..00311e62a
--- /dev/null
+++ b/sdk/jme3-assetpack-support/nbproject/project.properties
@@ -0,0 +1,7 @@
+javac.source=1.5
+javac.compilerargs=-Xlint -Xlint:-serial
+license.file=../license-jme.txt
+nbm.homepage=http://www.jmonkeyengine.com
+nbm.module.author=Normen Hansen
+nbm.needs.restart=true
+spec.version.base=0.7.0
diff --git a/sdk/jme3-assetpack-support/nbproject/project.xml b/sdk/jme3-assetpack-support/nbproject/project.xml
new file mode 100644
index 000000000..fa88b8a9b
--- /dev/null
+++ b/sdk/jme3-assetpack-support/nbproject/project.xml
@@ -0,0 +1,182 @@
+
+
+ org.netbeans.modules.apisupport.project
+
+
+ com.jme3.gde.assetpack
+
+
+
+ com.jme3.gde.core
+
+
+
+ 1
+ 0.9
+
+
+
+ com.jme3.gde.core.baselibs
+
+
+
+ 1
+ 0.7
+
+
+
+ com.jme3.gde.ogretools
+
+
+
+ 1
+ 0.6.1
+
+
+
+ com.jme3.gde.scenecomposer
+
+
+
+ 1
+ 0.6.1
+
+
+
+ org.netbeans.api.progress
+
+
+
+ 1
+ 1.19
+
+
+
+ org.netbeans.modules.options.api
+
+
+
+ 1
+ 1.18
+
+
+
+ org.netbeans.modules.projectapi
+
+
+
+ 1
+ 1.30
+
+
+
+ org.netbeans.modules.projectuiapi
+
+
+
+ 1
+ 1.40
+
+
+
+ org.netbeans.modules.settings
+
+
+
+ 1
+ 1.20
+
+
+
+ org.openide.actions
+
+
+
+ 6.1
+
+
+
+ org.openide.awt
+
+
+
+ 7.20
+
+
+
+ org.openide.dialogs
+
+
+
+ 7.1
+
+
+
+ org.openide.explorer
+
+
+
+ 6.20
+
+
+
+ org.openide.filesystems
+
+
+
+ 7.35
+
+
+
+ org.openide.loaders
+
+
+
+ 7.1
+
+
+
+ org.openide.modules
+
+
+
+ 7.16
+
+
+
+ org.openide.nodes
+
+
+
+ 7.16
+
+
+
+ org.openide.util
+
+
+
+ 8.5
+
+
+
+ org.openide.util.lookup
+
+
+
+ 8.3
+
+
+
+ org.openide.windows
+
+
+
+ 6.30
+
+
+
+
+
+
+
diff --git a/sdk/jme3-assetpack-support/nbproject/suite.properties b/sdk/jme3-assetpack-support/nbproject/suite.properties
new file mode 100644
index 000000000..29d7cc9bd
--- /dev/null
+++ b/sdk/jme3-assetpack-support/nbproject/suite.properties
@@ -0,0 +1 @@
+suite.dir=${basedir}/..
diff --git a/sdk/jme3-assetpack-support/project-template/assetpack.xml b/sdk/jme3-assetpack-support/project-template/assetpack.xml
new file mode 100644
index 000000000..959c437b2
--- /dev/null
+++ b/sdk/jme3-assetpack-support/project-template/assetpack.xml
@@ -0,0 +1,7 @@
+
+
+ Description
+ No License
+
+
+
diff --git a/sdk/jme3-assetpack-support/src/META-INF/services/org.netbeans.spi.project.ProjectFactory b/sdk/jme3-assetpack-support/src/META-INF/services/org.netbeans.spi.project.ProjectFactory
new file mode 100644
index 000000000..005611bee
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/META-INF/services/org.netbeans.spi.project.ProjectFactory
@@ -0,0 +1 @@
+com.jme3.gde.assetpack.project.AssetPackProjectFactory
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackBrowserTopComponentSettings.xml b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackBrowserTopComponentSettings.xml
new file mode 100644
index 000000000..63a4cea95
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackBrowserTopComponentSettings.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackBrowserTopComponentWstcref.xml b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackBrowserTopComponentWstcref.xml
new file mode 100644
index 000000000..0a8c88263
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackBrowserTopComponentWstcref.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackLoader.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackLoader.java
new file mode 100644
index 000000000..5484e2628
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackLoader.java
@@ -0,0 +1,348 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack;
+
+import com.jme3.animation.AnimControl;
+import com.jme3.animation.BoneAnimation;
+import com.jme3.animation.BoneTrack;
+import com.jme3.asset.ModelKey;
+import com.jme3.gde.assetpack.actions.AddAssetAction;
+import com.jme3.gde.assetpack.project.wizards.FileDescription;
+import com.jme3.gde.core.assets.ProjectAssetManager;
+import com.jme3.gde.core.scene.SceneApplication;
+import com.jme3.material.Material;
+import com.jme3.material.MaterialList;
+import com.jme3.scene.Node;
+import com.jme3.scene.Spatial;
+import com.jme3.scene.plugins.ogre.OgreMeshKey;
+import com.jme3.scene.plugins.ogre.matext.MaterialExtension;
+import com.jme3.scene.plugins.ogre.matext.MaterialExtensionSet;
+import com.jme3.scene.plugins.ogre.matext.OgreMaterialKey;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class AssetPackLoader {
+
+ public static Spatial loadAssetPackModel(Element assetElement, ProjectAssetManager pm) {
+ NodeList fileNodeList = assetElement.getElementsByTagName("file");
+ Element fileElement = XmlHelper.findChildElementWithAttribute(assetElement, "file", "main", "true");
+ if (fileElement == null) {
+ fileElement = XmlHelper.findChildElement(assetElement, "file");
+ }
+ Spatial model = null;
+ Node node = null;
+ while (fileElement != null) {
+ Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Load main file {0}",fileElement.getAttribute("path"));
+ if (model != null && node == null) {
+ node = new Node(assetElement.getAttribute("name"));
+ node.attachChild(model);
+ }
+ model = AssetPackLoader.loadSingleMesh(fileElement, fileNodeList, pm);
+ if (model != null && node != null) {
+ node.attachChild(model);
+ } else {
+ Logger.getLogger(AssetPackLoader.class.getName()).log(Level.WARNING, "Error loading model");
+ }
+ //TODO:doesnt work?
+ fileElement = XmlHelper.findNextElementWithAttribute(fileElement, "file", "main", "true");
+ }
+ if (node != null) {
+ return node;
+ }
+ return model;
+ }
+
+ // TODO: merge animation controls for multi meshes
+ private static void moveControls(Spatial from, Node to) {
+ AnimControl control = to.getControl(AnimControl.class);
+ AnimControl control2 = from.getControl(AnimControl.class);
+ if (control == null) {
+ control = new AnimControl(to, control2.getTargets(), control2.getSkeleton());
+ }
+ Collection names = control.getAnimationNames();
+ Collection names2 = new LinkedList(control2.getAnimationNames());
+ //add tracks from anims interface second that exist in first
+ for (Iterator it = names.iterator(); it.hasNext();) {
+ String string = it.next();
+ names2.remove(string);
+ BoneAnimation anim = control.getAnim(string);
+ BoneTrack[] tracks = anim.getTracks();
+ BoneAnimation anim2 = control2.getAnim(string);
+ if (anim2 != null) {
+ BoneTrack[] tracks2 = anim2.getTracks();
+ BoneTrack[] newTracks = new BoneTrack[tracks.length + tracks2.length];
+ for (int i = 0; i < tracks.length; i++) {
+ newTracks[i] = tracks[i];
+ }
+ for (int i = tracks.length; i < tracks2.length; i++) {
+ newTracks[i] = tracks2[i - tracks.length];
+ }
+ anim.setTracks(newTracks);
+ }
+ }
+ //add tracks from anims in second to first
+ for (Iterator it = names2.iterator(); it.hasNext();) {
+ String string = it.next();
+ BoneAnimation anim2 = control2.getAnim(string);
+ BoneTrack[] tracks2 = anim2.getTracks();
+ BoneAnimation anim = control.getAnim(string);
+ if (anim != null) {
+ BoneTrack[] tracks = anim.getTracks();
+ BoneTrack[] newTracks = new BoneTrack[tracks.length + tracks2.length];
+ for (int i = 0; i < tracks.length; i++) {
+ newTracks[i] = tracks[i];
+ }
+ for (int i = tracks.length; i < tracks2.length; i++) {
+ newTracks[i] = tracks2[i - tracks.length];
+ }
+ anim.setTracks(newTracks);
+ } else {
+ control.addAnim(anim2);
+ }
+ }
+ }
+
+ private static Spatial loadSingleMesh(Element fileElement, NodeList fileNodeList, ProjectAssetManager pm) {
+ ModelKey key = null;
+ Material mat = null;
+ Spatial model;
+ MaterialList matList = null;
+ String name = fileElement.getAttribute("path");
+ String materialName = fileElement.getAttribute("material");
+ if ("".equals(materialName)) {
+ materialName = null;
+ }
+
+ //PREPARE MATEXT
+ MaterialExtensionSet matExts = new MaterialExtensionSet();
+ /**
+ * /base/simple
+ * /base/normalmap
+ */
+ MaterialExtension baseLightExt = new MaterialExtension("/base/normalmap/specular",
+ "Common/MatDefs/Light/Lighting.j3md");
+ baseLightExt.setTextureMapping("DiffuseMap", "DiffuseMap");
+ baseLightExt.setTextureMapping("NormalHeightMap", "NormalMap");
+ baseLightExt.setTextureMapping("SpecularMap", "SpecularMap");
+ matExts.addMaterialExtension(baseLightExt);
+
+ MaterialExtension baseLightExt2 = new MaterialExtension("/base/normalmap",
+ "Common/MatDefs/Light/Lighting.j3md");
+ baseLightExt2.setTextureMapping("DiffuseMap", "DiffuseMap");
+ baseLightExt2.setTextureMapping("NormalHeightMap", "NormalMap");
+ baseLightExt2.setTextureMapping("SpecularMap", "SpecularMap");
+ matExts.addMaterialExtension(baseLightExt2);
+
+ MaterialExtension baseLightExt3 = new MaterialExtension("/base/simple",
+ "Common/MatDefs/Light/Lighting.j3md");
+ baseLightExt3.setTextureMapping("DiffuseMap", "DiffuseMap");
+ baseLightExt3.setTextureMapping("NormalHeightMap", "NormalMap");
+ baseLightExt3.setTextureMapping("SpecularMap", "SpecularMap");
+ matExts.addMaterialExtension(baseLightExt3);
+
+ //TODO: mesh.xml!!
+ if (hasExtension(name, "xml") || hasExtension(name, "scene")) {
+ for (int i = 0; i < fileNodeList.getLength(); i++) {
+ Element fileElem = (Element) fileNodeList.item(i);
+ String type = fileElem.getAttribute("type");
+ String path = fileElem.getAttribute("path");
+ if ("material".equals(type) && (materialName == null || materialName.equals(path))) {
+ if (hasExtension(path, "j3m")) {
+ mat = pm.getManager().loadMaterial(path);
+ } else if (hasExtension(path, "material")) {
+ if (matList == null) {
+ Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Load Ogre Material");
+ OgreMaterialKey matKey = new OgreMaterialKey(path);
+ matKey.setMaterialExtensionSet(matExts);
+ matList = pm.getManager().loadAsset(matKey);
+ key = new OgreMeshKey(name, matList);
+ } else {
+ Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Add Ogre Material");
+ OgreMaterialKey matKey = new OgreMaterialKey(path);
+ matKey.setMaterialExtensionSet(matExts);
+ MaterialList newMatList = pm.getManager().loadAsset(matKey);
+ matList.putAll(newMatList);
+ }
+ }
+ }
+ }
+ } else if (hasExtension(name, "obj")) {
+ for (int i = 0; i < fileNodeList.getLength(); i++) {
+ Element fileElem = (Element) fileNodeList.item(i);
+ String type = fileElem.getAttribute("type");
+ String path = fileElem.getAttribute("path");
+ if ("material".equals(type) && (materialName == null || materialName.equals(path))) {
+ if (hasExtension(path, "j3m")) {
+ mat = pm.getManager().loadMaterial(path);
+ }
+ }
+ }
+ } else if (hasExtension(name, "j3o")) {
+ //should have all info inside
+ }
+ if (key != null && mat != null) {
+ Logger.getLogger(AddAssetAction.class.getName()).log(Level.WARNING, "j3m and ogre material defined for asset {0}.", name);
+ }
+ if (key != null) {
+ model = pm.getManager().loadAsset(key);
+ } else {
+ model = pm.getManager().loadModel(name);
+ }
+ if (model == null) {
+ Logger.getLogger(AddAssetAction.class.getName()).log(Level.SEVERE, "Could not load model {0}!", name);
+ return null;
+ }
+ if (mat != null) {
+ model.setMaterial(mat);
+ }
+ return model;
+ }
+
+ private static boolean hasExtension(String name, String extension) {
+ int idx = name.lastIndexOf(".");
+ if (idx < 0) {
+ return false;
+ }
+ String ext = name.substring(idx + 1, name.length());
+ if (ext.equalsIgnoreCase(extension)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static FileDescription getFileDescription(File file) {
+ FileObject fileObject = FileUtil.toFileObject(file);
+ return getFileDescription(fileObject);
+ }
+
+ public static FileDescription getFileDescription(FileObject fileObject) {
+ FileDescription description = new FileDescription();
+ description.setFile(fileObject);
+ if ("material".equals(fileObject.getExt())) {
+ description.setType("material");
+ } else if ("j3m".equals(fileObject.getExt())) {
+ description.setType("material");
+ } else if ("mat".equals(fileObject.getExt())) {
+ description.setType("material");
+ } else if ("scene".equals(fileObject.getExt())) {
+ description.setType("scene");
+ description.setMainFile(true);
+ } else if ("obj".equals(fileObject.getExt())) {
+ description.setType("mesh");
+ description.setMainFile(true);
+ } else if ("j3o".equals(fileObject.getExt())) {
+ description.setType("scene");
+ description.setMainFile(true);
+ } else if ("xml".equals(fileObject.getExt())) {
+ if (fileObject.getName().endsWith(".mesh")) {
+ description.setType("mesh");
+ }
+ if (fileObject.getName().endsWith(".skeleton")) {
+ description.setType("skeleton");
+ }
+ } else if ("png".equals(fileObject.getExt())) {
+ description.setType("texture");
+ } else if ("jpg".equals(fileObject.getExt())) {
+ description.setType("texture");
+ } else if ("jpeg".equals(fileObject.getExt())) {
+ description.setType("texture");
+ } else if ("gif".equals(fileObject.getExt())) {
+ description.setType("texture");
+ } else if ("dds".equals(fileObject.getExt())) {
+ description.setType("texture");
+ } else if (fileObject.getName().endsWith(".mesh")) {
+ description.setType("mesh");
+ } else if (fileObject.getName().endsWith(".skeleton")) {
+ description.setType("skeleton");
+ }
+ return description;
+ }
+
+ public static void addAllFiles(Element assetElement, ProjectAssetManager pm) {
+ //TODO: not good :/
+ NodeList list = assetElement.getElementsByTagName("file");
+ ProjectAssetManager proman = null;
+ try {
+ proman = SceneApplication.getApplication().getCurrentSceneRequest().getManager();
+ if (proman == null) {
+ Logger.getLogger(AssetPackLoader.class.getName()).log(Level.SEVERE, "Could not get project asset manager!");
+ return;
+ }
+ } catch (Exception e) {
+ Logger.getLogger(AssetPackLoader.class.getName()).log(Level.SEVERE, "Could not get project asset manager!");
+ return;
+ }
+ for (int i = 0; i < list.getLength(); i++) {
+ Element fileElem = (Element) list.item(i);
+ try {
+ String src = pm.getAbsoluteAssetPath(fileElem.getAttribute("path"));
+ if (src == null) {
+ Logger.getLogger(AssetPackLoader.class.getName()).log(Level.SEVERE, "Could not find texture with manager!");
+ return;
+ }
+ FileObject srcFile = FileUtil.toFileObject(new File(src));
+ String destName = proman.getAssetFolderName() + "/" + fileElem.getAttribute("path");
+ String destFolder = destName.replace("\\", "/");
+ destFolder = destFolder.substring(0, destFolder.lastIndexOf("/"));
+ FileObject folder = FileUtil.createFolder(new File(destFolder));
+ srcFile.copy(folder, srcFile.getName(), srcFile.getExt());
+ } catch (IOException ex) {
+ Logger.getLogger(AssetPackLoader.class.getName()).log(Level.SEVERE, "Could not copy texture: {0}", ex.getMessage());
+ }
+ }
+ return;
+ }
+
+ public static void addModelFiles(Element assetElement, ProjectAssetManager pm) {
+ //TODO: not good :/
+ NodeList fileNodeList = assetElement.getElementsByTagName("file");
+ ProjectAssetManager currentProjectAssetManager = null;
+ try {
+ currentProjectAssetManager = SceneApplication.getApplication().getCurrentSceneRequest().getManager();
+ if (currentProjectAssetManager == null) {
+ Logger.getLogger(AssetPackLoader.class.getName()).log(Level.SEVERE, "Could not get project asset manager!");
+ return;
+ }
+ } catch (Exception e) {
+ Logger.getLogger(AssetPackLoader.class.getName()).log(Level.SEVERE, "Could not get project asset manager!");
+ return;
+ }
+ for (int i = 0; i < fileNodeList.getLength(); i++) {
+ Element fileElem = (Element) fileNodeList.item(i);
+ String type = fileElem.getAttribute("type");
+ if ("texture".equals(type) || "sound".equals(type) || "materialdef".equals(type) || "shader".equals(type) || "other".equals(type)) {
+ try {
+ String src = pm.getAbsoluteAssetPath(fileElem.getAttribute("path"));
+ if (src == null) {
+ Logger.getLogger(AssetPackLoader.class.getName()).log(Level.SEVERE, "Could not find texture with manager!");
+ return;
+ }
+ FileObject srcFile = FileUtil.toFileObject(new File(src));
+ String destName = currentProjectAssetManager.getAssetFolderName() + "/" + fileElem.getAttribute("path");
+ String destFolder = destName.replace("\\", "/");
+ destFolder = destFolder.substring(0, destFolder.lastIndexOf("/"));
+ FileObject folder = FileUtil.createFolder(new File(destFolder));
+ srcFile.copy(folder, srcFile.getName(), srcFile.getExt());
+ } catch (IOException ex) {
+ Logger.getLogger(AssetPackLoader.class.getName()).log(Level.SEVERE, "Could not copy texture: {0}", ex.getMessage());
+ }
+ }
+ }
+ return;
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackProject.zip b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackProject.zip
new file mode 100644
index 000000000..aa78f973f
Binary files /dev/null and b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackProject.zip differ
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/Bundle.properties b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/Bundle.properties
new file mode 100644
index 000000000..37e904bbf
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/Bundle.properties
@@ -0,0 +1,6 @@
+OpenIDE-Module-Display-Category=jMonkeyPlatform
+OpenIDE-Module-Long-Description=\
+ AssetPack Support
+OpenIDE-Module-Name=AssetPack Support
+OpenIDE-Module-Short-Description=AssetPack Support
+Templates/Project/AssetPack/AssetPackProject.zip=Asset Pack
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/Installer.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/Installer.java
new file mode 100644
index 000000000..c77763070
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/Installer.java
@@ -0,0 +1,34 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack;
+
+import java.io.File;
+import org.openide.modules.ModuleInstall;
+import org.openide.util.NbPreferences;
+import org.openide.util.Utilities;
+
+/**
+ * Manages a module's lifecycle. Remember that an installer is optional and
+ * often not needed at all.
+ */
+public class Installer extends ModuleInstall {
+
+ @Override
+ public void restored() {
+ String path = NbPreferences.forModule(Installer.class).get("assetpack_path", null);
+ if (path == null) {
+ //set extraction dir for platform natives
+ if (Utilities.isMac()) {
+ String jmpDir = System.getProperty("user.home") + "/Library/Application Support/jmonkeyplatform/assetpacks/";
+ NbPreferences.forModule(Installer.class).put("assetpack_path", jmpDir);
+ new File(jmpDir).mkdirs();
+ } else {
+ String jmpDir = System.getProperty("user.home") + File.separator + ".jmonkeyplatform" + File.separator + "assetpacks" + File.separator;
+ NbPreferences.forModule(Installer.class).put("assetpack_path", jmpDir);
+ new File(jmpDir).mkdirs();
+ }
+ }
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/XmlHelper.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/XmlHelper.java
new file mode 100644
index 000000000..e44fb91b1
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/XmlHelper.java
@@ -0,0 +1,73 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.jme3.gde.assetpack;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class XmlHelper {
+ public static Element findFirstChildElement(Element parent) {
+ org.w3c.dom.Node ret = parent.getFirstChild();
+ while (ret != null && (!(ret instanceof Element))) {
+ ret = ret.getNextSibling();
+ }
+ return (Element) ret;
+ }
+
+ public static Element findChildElement(Element parent, String name) {
+ if (parent == null) {
+ return null;
+ }
+ org.w3c.dom.Node ret = parent.getFirstChild();
+ while (ret != null && (!(ret instanceof Element) || !ret.getNodeName().equals(name))) {
+ ret = ret.getNextSibling();
+ }
+ return (Element) ret;
+ }
+
+ public static Element findNextElement(Node ret, String name) {
+ ret = ret.getNextSibling();
+ while (ret != null && (!(ret instanceof Element) || !ret.getNodeName().equals(name))) {
+ ret = ret.getNextSibling();
+ }
+ return (Element) ret;
+ }
+
+ public static Element findChildElementWithAttribute(Element parent, String name, String attribute, String value) {
+ if (parent == null) {
+ return null;
+ }
+ org.w3c.dom.Node ret = parent.getFirstChild();
+ while (ret != null && (!(ret instanceof Element) || !ret.getNodeName().equals(name) || ((Element)ret).getAttribute(attribute)==null || !((Element)ret).getAttribute(attribute).equals(value))) {
+ ret = ret.getNextSibling();
+ }
+ return (Element) ret;
+ }
+
+ public static Element findNextElementWithAttribute(Node ret, String name, String attribute, String value) {
+ ret = ret.getNextSibling();
+ while (ret != null && (!(ret instanceof Element) || !ret.getNodeName().equals(name) || ((Element)ret).getAttribute(attribute)==null || !((Element)ret).getAttribute(attribute).equals(value))) {
+ ret = ret.getNextSibling();
+ }
+ return (Element) ret;
+ }
+
+ public static Element findNextSiblingElement(Element current) {
+ org.w3c.dom.Node ret = current.getNextSibling();
+ while (ret != null) {
+ if (ret instanceof Element) {
+ return (Element) ret;
+ }
+ ret = ret.getNextSibling();
+ }
+ return null;
+ }
+
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/AddAssetAction.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/AddAssetAction.java
new file mode 100644
index 000000000..534c12dd2
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/AddAssetAction.java
@@ -0,0 +1,120 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack.actions;
+
+import com.jme3.gde.assetpack.AssetPackLoader;
+import com.jme3.gde.assetpack.XmlHelper;
+import com.jme3.gde.core.assets.ProjectAssetManager;
+import com.jme3.gde.core.scene.SceneApplication;
+import com.jme3.scene.Spatial;
+import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeListener;
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.Action;
+import org.openide.nodes.Node;
+import org.w3c.dom.Element;
+import com.jme3.gde.scenecomposer.SceneComposerTopComponent;
+import java.io.File;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.w3c.dom.NodeList;
+
+public final class AddAssetAction implements Action {
+
+ private final Node context;
+
+ public AddAssetAction(Node context) {
+ this.context = context;
+ }
+
+ public void actionPerformed(ActionEvent ev) {
+ ProjectAssetManager pm = context.getLookup().lookup(ProjectAssetManager.class);
+ if (pm == null) {
+ Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "AssetManager not found!");
+ return;
+ }
+ Element assetElement = context.getLookup().lookup(Element.class);
+ String type = assetElement.getAttribute("type");
+ if ("model".equals(type) || "scene".equals(type)) {
+ addModelToScene(assetElement, pm);
+ AssetPackLoader.addModelFiles(assetElement, pm);
+ } else {
+ AssetPackLoader.addAllFiles(assetElement, pm);
+ }
+ }
+
+ private void addModelToScene(Element assetElement, ProjectAssetManager pm) {
+// Element fileElement = XmlHelper.findChildElementWithAttribute(assetElement, "file", "main", "true");
+ Spatial model = AssetPackLoader.loadAssetPackModel(assetElement, pm);
+ if (model != null) {
+ SceneComposerTopComponent.findInstance().addModel(model);
+ } else {
+ Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Error loading model");
+ return;
+ }
+ }
+
+ private void copyModelData(NodeList fileNodeList, ProjectAssetManager pm) {
+ //TODO: not good :/
+ ProjectAssetManager currentProjectAssetManager = null;
+ try {
+ currentProjectAssetManager = SceneApplication.getApplication().getCurrentSceneRequest().getManager();
+ if (currentProjectAssetManager == null) {
+ Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Could not get project asset manager!");
+ return;
+ }
+ } catch (Exception e) {
+ Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Could not get project asset manager!");
+ return;
+ }
+ for (int i = 0; i < fileNodeList.getLength(); i++) {
+ Element fileElem = (Element) fileNodeList.item(i);
+ String type = fileElem.getAttribute("type");
+ if ("texture".equals(type) || "sound".equals(type) || "materialdef".equals(type) || "shader".equals(type) || "other".equals(type)) {
+ try {
+ String src = pm.getAbsoluteAssetPath(fileElem.getAttribute("path"));
+ if (src == null) {
+ Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Could not find texture with manager!");
+ return;
+ }
+ FileObject srcFile = FileUtil.toFileObject(new File(src));
+ String destName = currentProjectAssetManager.getAssetFolderName() + "/" + fileElem.getAttribute("path");
+ String destFolder = destName.replace("\\", "/");
+ destFolder = destFolder.substring(0, destFolder.lastIndexOf("/"));
+ FileObject folder = FileUtil.createFolder(new File(destFolder));
+ srcFile.copy(folder, srcFile.getName(), srcFile.getExt());
+ } catch (IOException ex) {
+ Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Could not copy texture: {0}", ex.getMessage());
+ }
+ }
+ }
+ return;
+ }
+
+ public Object getValue(String key) {
+ if (key.equals(NAME)) {
+ return "Add to SceneComposer..";
+ }
+ return null;
+ }
+
+ public void putValue(String key, Object value) {
+ }
+
+ public void setEnabled(boolean b) {
+ }
+
+ public boolean isEnabled() {
+ return true;
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/Bundle.properties b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/Bundle.properties
new file mode 100644
index 000000000..e330aa8f0
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/Bundle.properties
@@ -0,0 +1 @@
+CTL_PreviewAssetPackItem=Preview
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/PreviewAssetAction.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/PreviewAssetAction.java
new file mode 100644
index 000000000..505c36c0d
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/PreviewAssetAction.java
@@ -0,0 +1,71 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack.actions;
+
+import com.jme3.gde.assetpack.AssetPackLoader;
+import com.jme3.gde.core.assets.ProjectAssetManager;
+import com.jme3.gde.core.scene.SceneApplication;
+import com.jme3.gde.core.scene.SceneRequest;
+import com.jme3.gde.core.sceneexplorer.nodes.JmeNode;
+import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility;
+import com.jme3.scene.Spatial;
+import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeListener;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.Action;
+import org.openide.nodes.Node;
+import org.w3c.dom.Element;
+
+public final class PreviewAssetAction implements Action {
+
+ private final Node context;
+
+ public PreviewAssetAction(Node context) {
+ this.context = context;
+ }
+
+ public void actionPerformed(ActionEvent ev) {
+ ProjectAssetManager pm = context.getLookup().lookup(ProjectAssetManager.class);
+ if (pm == null) {
+ Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "AssetManager not found!");
+ return;
+ }
+ Element assetElement = context.getLookup().lookup(Element.class);
+ com.jme3.scene.Node node = new com.jme3.scene.Node("PreviewRootNode");
+ Spatial model = null;
+ model = AssetPackLoader.loadAssetPackModel(assetElement, pm);
+ node.attachChild(model);
+ JmeNode jmeNode = NodeUtility.createNode(node);
+ SceneApplication app = SceneApplication.getApplication();
+ SceneRequest request = new SceneRequest(app, jmeNode, pm);
+ request.setWindowTitle("SceneViewer - PreView AssetPack Model");
+ app.requestScene(request);
+
+ }
+
+ public Object getValue(String key) {
+ if (key.equals(NAME)) {
+ return "Preview Asset..";
+ }
+ return null;
+ }
+
+ public void putValue(String key, Object value) {
+ }
+
+ public void setEnabled(boolean b) {
+ }
+
+ public boolean isEnabled() {
+ return true;
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/AssetPackBrowserTopComponent.form b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/AssetPackBrowserTopComponent.form
new file mode 100644
index 000000000..70e2658d7
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/AssetPackBrowserTopComponent.form
@@ -0,0 +1,170 @@
+
+
+
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/AssetPackBrowserTopComponent.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/AssetPackBrowserTopComponent.java
new file mode 100644
index 000000000..adfc81468
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/AssetPackBrowserTopComponent.java
@@ -0,0 +1,335 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack.browser;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.logging.Logger;
+import org.openide.util.HelpCtx;
+import org.openide.util.NbBundle;
+import org.openide.windows.TopComponent;
+import org.openide.windows.WindowManager;
+//import org.openide.util.ImageUtilities;
+import org.netbeans.api.settings.ConvertAsProperties;
+import org.openide.actions.CopyAction;
+import org.openide.explorer.ExplorerManager;
+import org.openide.explorer.ExplorerUtils;
+import org.openide.explorer.view.BeanTreeView;
+import org.openide.nodes.Node;
+import org.openide.util.actions.SystemAction;
+
+/**
+ * Top component which displays something.
+ */
+@ConvertAsProperties(dtd = "-//com.jme3.gde.assetpack.browser//AssetPackBrowser//EN",
+autostore = false)
+public final class AssetPackBrowserTopComponent extends TopComponent implements ExplorerManager.Provider {
+
+ private static AssetPackBrowserTopComponent instance;
+ private transient ExplorerManager explorerManager = new ExplorerManager();
+ /** path to the icon used by the component and its open action */
+// static final String ICON_PATH = "SET/PATH/TO/ICON/HERE";
+ private static final String PREFERRED_ID = "AssetPackBrowserTopComponent";
+ AssetPackLibrary lib;
+ Node rootNode;
+
+ public AssetPackBrowserTopComponent() {
+ initComponents();
+ initLibrary();
+ initActions();
+ associateLookup(ExplorerUtils.createLookup(explorerManager, getActionMap()));
+ setName(NbBundle.getMessage(AssetPackBrowserTopComponent.class, "CTL_AssetPackBrowserTopComponent"));
+ setToolTipText(NbBundle.getMessage(AssetPackBrowserTopComponent.class, "HINT_AssetPackBrowserTopComponent"));
+ }
+
+ private void initLibrary() {
+ lib = new AssetPackLibrary();
+ rootNode = lib.getRootNode();
+ explorerManager.setRootContext(rootNode);
+ List cats = lib.getCategories();
+ for (Iterator it = cats.iterator(); it.hasNext();) {
+ jComboBox1.addItem(it.next());
+ }
+ }
+
+ private void updateLibrary(){
+ rootNode = lib.getRootNode();
+ getExplorerManager().setRootContext(rootNode);
+ jComboBox1.removeAllItems();
+ jComboBox1.addItem("All Categories");
+ List cats = lib.getCategories();
+ for (Iterator it = cats.iterator(); it.hasNext();) {
+ jComboBox1.addItem(it.next());
+ }
+ }
+
+ private void initActions() {
+// CutAction cut = SystemAction.get(CutAction.class);
+// getActionMap().put(cut.getActionMapKey(), ExplorerUtils.actionCut(explorerManager));
+ CopyAction copy = SystemAction.get(CopyAction.class);
+ getActionMap().put(copy.getActionMapKey(), ExplorerUtils.actionCopy(explorerManager));
+// PasteAction paste = SystemAction.get(PasteAction.class);
+// getActionMap().put(paste.getActionMapKey(), ExplorerUtils.actionPaste(explorerManager));
+// DeleteAction delete = SystemAction.get(DeleteAction.class);
+// getActionMap().put(delete.getActionMapKey(), ExplorerUtils.actionDelete(explorerManager, true));
+ }
+
+ public ExplorerManager getExplorerManager() {
+ return explorerManager;
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jPanel1 = new javax.swing.JPanel();
+ jToolBar1 = new javax.swing.JToolBar();
+ jComboBox1 = new javax.swing.JComboBox();
+ jButton1 = new javax.swing.JButton();
+ jPanel3 = new javax.swing.JPanel();
+ jTextField1 = new javax.swing.JTextField();
+ jPanel2 = new javax.swing.JPanel();
+ jScrollPane1 = new BeanTreeView();
+ jToolBar2 = new javax.swing.JToolBar();
+ jButton3 = new javax.swing.JButton();
+ jButton2 = new javax.swing.JButton();
+
+ jToolBar1.setFloatable(false);
+ jToolBar1.setRollover(true);
+
+ jComboBox1.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
+ jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "All Categories" }));
+ jComboBox1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jComboBox1ActionPerformed(evt);
+ }
+ });
+ jToolBar1.add(jComboBox1);
+
+ org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(AssetPackBrowserTopComponent.class, "AssetPackBrowserTopComponent.jButton1.text")); // NOI18N
+ jButton1.setFocusable(false);
+ jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+ jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+ jButton1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton1ActionPerformed(evt);
+ }
+ });
+ jToolBar1.add(jButton1);
+
+ javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
+ jPanel3.setLayout(jPanel3Layout);
+ jPanel3Layout.setHorizontalGroup(
+ jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 10, Short.MAX_VALUE)
+ );
+ jPanel3Layout.setVerticalGroup(
+ jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 21, Short.MAX_VALUE)
+ );
+
+ jToolBar1.add(jPanel3);
+
+ jTextField1.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
+ jTextField1.setText(org.openide.util.NbBundle.getMessage(AssetPackBrowserTopComponent.class, "AssetPackBrowserTopComponent.jTextField1.text")); // NOI18N
+ jTextField1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jTextField1ActionPerformed(evt);
+ }
+ });
+ jToolBar1.add(jTextField1);
+
+ jPanel2.setLayout(new javax.swing.BoxLayout(jPanel2, javax.swing.BoxLayout.LINE_AXIS));
+ jPanel2.add(jScrollPane1);
+
+ jToolBar2.setFloatable(false);
+ jToolBar2.setRollover(true);
+
+ org.openide.awt.Mnemonics.setLocalizedText(jButton3, org.openide.util.NbBundle.getMessage(AssetPackBrowserTopComponent.class, "AssetPackBrowserTopComponent.jButton3.text")); // NOI18N
+ jButton3.setFocusable(false);
+ jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+ jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+ jButton3.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton3ActionPerformed(evt);
+ }
+ });
+ jToolBar2.add(jButton3);
+
+ org.openide.awt.Mnemonics.setLocalizedText(jButton2, org.openide.util.NbBundle.getMessage(AssetPackBrowserTopComponent.class, "AssetPackBrowserTopComponent.jButton2.text")); // NOI18N
+ jButton2.setFocusable(false);
+ jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+ jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+ jButton2.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton2ActionPerformed(evt);
+ }
+ });
+ jToolBar2.add(jButton2);
+
+ javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
+ jPanel1.setLayout(jPanel1Layout);
+ jPanel1Layout.setHorizontalGroup(
+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 312, Short.MAX_VALUE)
+ .addComponent(jToolBar2, javax.swing.GroupLayout.DEFAULT_SIZE, 312, Short.MAX_VALUE)
+ .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 312, Short.MAX_VALUE)
+ );
+ jPanel1Layout.setVerticalGroup(
+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 409, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jToolBar2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
+ );
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ );
+ }// //GEN-END:initComponents
+
+ private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
+ rootNode = lib.getRootNode(jTextField1.getText().split(","));
+ getExplorerManager().setRootContext(rootNode);
+ }//GEN-LAST:event_jTextField1ActionPerformed
+
+ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
+ updateLibrary();
+ }//GEN-LAST:event_jButton1ActionPerformed
+
+ private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
+ jPanel2.removeAll();
+ jPanel2.add(new OnlineBrowser(lib));
+ jPanel2.validate();
+ }//GEN-LAST:event_jButton2ActionPerformed
+
+ private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
+ jPanel2.removeAll();
+ jPanel2.add(new BeanTreeView());
+ jPanel2.validate();
+ }//GEN-LAST:event_jButton3ActionPerformed
+
+ private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
+ if (!"All Categories".equals((String) jComboBox1.getSelectedItem())) {
+ rootNode = lib.getRootNode((String) jComboBox1.getSelectedItem());
+ getExplorerManager().setRootContext(rootNode);
+ }else{
+ rootNode = lib.getRootNode();
+ getExplorerManager().setRootContext(rootNode);
+ }
+ }//GEN-LAST:event_jComboBox1ActionPerformed
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton jButton1;
+ private javax.swing.JButton jButton2;
+ private javax.swing.JButton jButton3;
+ private javax.swing.JComboBox jComboBox1;
+ private javax.swing.JPanel jPanel1;
+ private javax.swing.JPanel jPanel2;
+ private javax.swing.JPanel jPanel3;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JTextField jTextField1;
+ private javax.swing.JToolBar jToolBar1;
+ private javax.swing.JToolBar jToolBar2;
+ // End of variables declaration//GEN-END:variables
+
+ /**
+ * Gets default instance. Do not use directly: reserved for *.settings files only,
+ * i.e. deserialization routines; otherwise you could get a non-deserialized instance.
+ * To obtain the singleton instance, use {@link #findInstance}.
+ */
+ public static synchronized AssetPackBrowserTopComponent getDefault() {
+ if (instance == null) {
+ instance = new AssetPackBrowserTopComponent();
+ }
+ return instance;
+ }
+
+ /**
+ * Obtain the AssetPackBrowserTopComponent instance. Never call {@link #getDefault} directly!
+ */
+ public static synchronized AssetPackBrowserTopComponent findInstance() {
+ TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
+ if (win == null) {
+ Logger.getLogger(AssetPackBrowserTopComponent.class.getName()).warning(
+ "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system.");
+ return getDefault();
+ }
+ if (win instanceof AssetPackBrowserTopComponent) {
+ return (AssetPackBrowserTopComponent) win;
+ }
+ Logger.getLogger(AssetPackBrowserTopComponent.class.getName()).warning(
+ "There seem to be multiple components with the '" + PREFERRED_ID
+ + "' ID. That is a potential source of errors and unexpected behavior.");
+ return getDefault();
+ }
+
+ @Override
+ public HelpCtx getHelpCtx() {
+ return new HelpCtx("sdk.asset_packs");
+ }
+
+ @Override
+ public int getPersistenceType() {
+ return TopComponent.PERSISTENCE_ALWAYS;
+ }
+
+ @Override
+ public void componentOpened() {
+ // TODO add custom code on component opening
+ }
+
+ @Override
+ public void componentClosed() {
+ // TODO add custom code on component closing
+ }
+
+ @Override
+ protected void componentActivated() {
+ ExplorerUtils.activateActions(explorerManager, true);
+ }
+
+ @Override
+ protected void componentDeactivated() {
+ ExplorerUtils.activateActions(explorerManager, false);
+ }
+
+ void writeProperties(java.util.Properties p) {
+ // better to version settings since initial version as advocated at
+ // http://wiki.apidesign.org/wiki/PropertyFiles
+ p.setProperty("version", "1.0");
+ // TODO store your settings
+ }
+
+ Object readProperties(java.util.Properties p) {
+ if (instance == null) {
+ instance = this;
+ }
+ instance.readPropertiesImpl(p);
+ return instance;
+ }
+
+ private void readPropertiesImpl(java.util.Properties p) {
+ String version = p.getProperty("version");
+ // TODO read your settings according to their version
+ }
+
+ @Override
+ protected String preferredID() {
+ return PREFERRED_ID;
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/AssetPackLibrary.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/AssetPackLibrary.java
new file mode 100644
index 000000000..dc75b62e8
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/AssetPackLibrary.java
@@ -0,0 +1,152 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack.browser;
+
+import com.jme3.gde.assetpack.browser.nodes.AssetPackBrowserFolder;
+import com.jme3.gde.assetpack.Installer;
+import com.jme3.gde.assetpack.XmlHelper;
+import com.jme3.gde.core.assets.ProjectAssetManager;
+import java.io.File;
+import java.io.InputStream;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.netbeans.api.project.Project;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.nodes.Node;
+import org.openide.util.Exceptions;
+import org.openide.util.Lookup;
+import org.openide.util.NbPreferences;
+import org.openide.util.lookup.AbstractLookup;
+import org.openide.util.lookup.InstanceContent;
+import org.openide.xml.XMLUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class AssetPackLibrary implements Project {
+
+ FileObject library;
+ Element[] assetElements = new Element[0];
+ InstanceContent content = new InstanceContent();
+ Lookup lookup = new AbstractLookup(content);
+ private ProjectAssetManager projectAssetManager;
+ private List categories = new LinkedList();
+
+ public AssetPackLibrary() {
+ content.add(this);
+ }
+
+ private void initLibrary() {
+ String path = NbPreferences.forModule(Installer.class).get("assetpack_path", null);
+ library = FileUtil.toFileObject(new File(path));
+ }
+
+ public Node getRootNode() {
+ parseLibrary();
+ AssetPackBrowserFolder multi = new AssetPackBrowserFolder(assetElements, this);
+ return multi;
+ }
+
+ public Node getRootNode(String[] categories, String[] tags) {
+ parseLibrary();
+ AssetPackBrowserFolder multi = new AssetPackBrowserFolder(assetElements, this, categories, tags);
+ return multi;
+ }
+
+ public Node getRootNode(String category) {
+ parseLibrary();
+ AssetPackBrowserFolder multi = new AssetPackBrowserFolder(assetElements, this, new String[]{category}, null);
+ return multi;
+ }
+
+ public Node getRootNode(String[] tags) {
+ parseLibrary();
+ AssetPackBrowserFolder multi = new AssetPackBrowserFolder(assetElements, this, null, tags);
+ return multi;
+ }
+
+ private void parseLibrary() {
+ initLibrary();
+ categories.clear();
+ FileObject[] object = library.getChildren();
+ List assetElements = new LinkedList();
+ for (int i = 0; i < object.length; i++) {
+ FileObject fileObject = object[i];
+ if (fileObject.isFolder()) {
+ FileObject config = fileObject.getFileObject("assetpack.xml");
+ if (config != null) {
+
+ InputStream in;
+ try {
+ in = config.getInputStream();
+ Document doc = XMLUtil.parse(new InputSource(in), false, false, null, null);
+ in.close();
+ Element assets = XmlHelper.findChildElement(doc.getDocumentElement(), "assets");
+ if (assets != null) {
+ assetElements.add(assets);
+ }
+ } catch (Exception ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ if (projectAssetManager == null) {
+ projectAssetManager = new ProjectAssetManager(this, fileObject.getNameExt() + "/assets/");
+ content.add(projectAssetManager);
+ } else {
+ projectAssetManager.addFileLocator(fileObject.getNameExt() + "/assets/");
+ }
+ } else {
+ Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Error in assetpack, could not load assetpack.xml!");
+ }
+ }
+ }
+ this.assetElements = new Element[assetElements.size()];
+ for (int i = 0; i < assetElements.size(); i++) {
+ Element element = assetElements.get(i);
+ this.assetElements[i] = element;
+ Element child = XmlHelper.findChildElement(element, "asset");
+ while (child != null) {
+ String cats = child.getAttribute("categories");
+ String[] categs = cats.split(",");
+ for (int j = 0; j < categs.length; j++) {
+ String string = categs[j];
+ string = string.trim();
+ if (!categories.contains(string)) {
+ categories.add(string);
+ }
+ }
+ child = XmlHelper.findNextElement(child, "asset");
+ }
+ }
+ }
+
+ public FileObject getProjectDirectory() {
+ return library;
+ }
+
+ public Lookup getLookup() {
+ return lookup;
+ }
+
+ /**
+ * @return the projectAssetManager
+ */
+ public ProjectAssetManager getProjectAssetManager() {
+ return projectAssetManager;
+ }
+
+ /**
+ * @return the categories
+ */
+ public List getCategories() {
+ return categories;
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/Bundle.properties b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/Bundle.properties
new file mode 100644
index 000000000..515f491de
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/Bundle.properties
@@ -0,0 +1,7 @@
+CTL_AssetPackBrowserAction=AssetPackBrowser
+CTL_AssetPackBrowserTopComponent=AssetPackBrowser Window
+HINT_AssetPackBrowserTopComponent=This is a AssetPackBrowser window
+AssetPackBrowserTopComponent.jTextField1.text=search
+AssetPackBrowserTopComponent.jButton1.text=update
+AssetPackBrowserTopComponent.jButton2.text=online assetpacks
+AssetPackBrowserTopComponent.jButton3.text=view library
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/OnlineBrowser.form b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/OnlineBrowser.form
new file mode 100644
index 000000000..89b619728
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/OnlineBrowser.form
@@ -0,0 +1,47 @@
+
+
+
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/OnlineBrowser.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/OnlineBrowser.java
new file mode 100644
index 000000000..d444557c6
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/OnlineBrowser.java
@@ -0,0 +1,132 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/*
+ * OnlineBrowser.java
+ *
+ * Created on 25.10.2010, 23:18:26
+ */
+package com.jme3.gde.assetpack.browser;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import org.netbeans.api.progress.ProgressHandle;
+import org.netbeans.api.progress.ProgressHandleFactory;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.Exceptions;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class OnlineBrowser extends javax.swing.JPanel implements HyperlinkListener {
+
+ private AssetPackLibrary lib;
+
+ /** Creates new form OnlineBrowser */
+ public OnlineBrowser(AssetPackLibrary lib) {
+ initComponents();
+ this.lib = lib;
+ jEditorPane1.addHyperlinkListener(this);
+ try {
+ URL url = new URL("http://jmonkeyengine.org/assetpacks/list.php");
+ jEditorPane1.setPage(url);
+ } catch (IOException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ }
+
+ public void hyperlinkUpdate(final HyperlinkEvent event) {
+ if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
+ new Thread(new Runnable() {
+
+ public void run() {
+ ProgressHandle handle = ProgressHandleFactory.createHandle("Downloading AssetPack..");
+ handle.start();
+ String name = event.getURL().toString();
+ name = name.substring(name.lastIndexOf("/") + 1, name.length());
+ name = name.substring(0, name.lastIndexOf("."));
+ name = lib.getProjectDirectory().getPath() + "/" + name;
+ File folder = new File(name);
+ folder.mkdirs();
+ try {
+ unZipFile(event.getURL().openStream(), FileUtil.toFileObject(folder));
+ } catch (IOException ex) {
+ Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Error creating URL: {0}", ex.toString());
+ }
+ handle.finish();
+ }
+ }).start();
+ }
+ }
+
+ private void unZipFile(InputStream source, FileObject projectRoot) throws IOException {
+ try {
+ ZipInputStream str = new ZipInputStream(source);
+ ZipEntry entry;
+ while ((entry = str.getNextEntry()) != null) {
+ if (entry.isDirectory()) {
+ FileUtil.createFolder(projectRoot, entry.getName());
+ } else {
+ FileObject fo = FileUtil.createData(projectRoot, entry.getName());
+ writeFile(str, fo);
+ }
+ }
+ } finally {
+ source.close();
+ }
+ }
+
+ private void writeFile(ZipInputStream str, FileObject fo) throws IOException {
+ OutputStream out = fo.getOutputStream();
+ try {
+ FileUtil.copy(str, out);
+ } finally {
+ out.close();
+ }
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jScrollPane1 = new javax.swing.JScrollPane();
+ jEditorPane1 = new javax.swing.JEditorPane();
+
+ jEditorPane1.setEditable(false);
+ jEditorPane1.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
+ jScrollPane1.setViewportView(jEditorPane1);
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
+ );
+ }// //GEN-END:initComponents
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JEditorPane jEditorPane1;
+ private javax.swing.JScrollPane jScrollPane1;
+ // End of variables declaration//GEN-END:variables
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserChildren.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserChildren.java
new file mode 100644
index 000000000..482af13b4
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserChildren.java
@@ -0,0 +1,120 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack.browser.nodes;
+
+import com.jme3.gde.assetpack.XmlHelper;
+import java.util.LinkedList;
+import java.util.List;
+import org.netbeans.api.project.Project;
+import org.openide.nodes.Children;
+import org.openide.nodes.Node;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class AssetPackBrowserChildren extends Children.Keys {
+
+ private Project project;
+ private Element[] xmlNode;
+ private String[] categories;
+ private String[] tags;
+
+ public AssetPackBrowserChildren(Element xmlNode, Project project, String[] categories, String[] tags) {
+ this.xmlNode = new Element[]{xmlNode};
+ this.categories = categories;
+ this.tags = tags;
+ this.project = project;
+ }
+
+ public AssetPackBrowserChildren(Element xmlNode, Project project) {
+ this.xmlNode = new Element[]{xmlNode};
+ this.project = project;
+ }
+
+ public AssetPackBrowserChildren(Element[] xmlNode, Project project, String[] categories, String[] tags) {
+ this.xmlNode = xmlNode;
+ this.categories = categories;
+ this.tags = tags;
+ this.project = project;
+ }
+
+ public AssetPackBrowserChildren(Element[] xmlNode, Project project) {
+ this.xmlNode = xmlNode;
+ this.project = project;
+ }
+
+ @Override
+ protected void addNotify() {
+ super.addNotify();
+ setKeys(createKeys());
+ }
+
+ protected List createKeys() {
+ LinkedList ret = new LinkedList();
+ for (int i = 0; i < xmlNode.length; i++) {
+ Element element = xmlNode[i];
+ Element curElement = XmlHelper.findFirstChildElement(element);
+ while (curElement != null) {
+ if (checkElement(curElement)) {
+ ret.add(curElement);
+
+ }
+ curElement = XmlHelper.findNextSiblingElement(curElement);
+ }
+
+ }
+ return ret;
+ }
+
+ private boolean checkElement(Element curElement) {
+ if (!"asset".equals(curElement.getTagName())) {
+ return false;
+ }
+ boolean checkCategories = false;
+ boolean checkTags = false;
+ if (categories != null) {
+ for (int i = 0; i < categories.length; i++) {
+ String string = categories[i].trim();
+ String cats = curElement.getAttribute("categories");
+ if (cats != null) {
+ String[] catg = cats.split(",");
+ for (int j = 0; j < catg.length; j++) {
+ String string1 = catg[j].trim();
+ if (string.equalsIgnoreCase(string1)) {
+ checkCategories = true;
+ }
+ }
+ }
+ }
+ } else {
+ checkCategories = true;
+ }
+ if (tags != null) {
+ for (int i = 0; i < tags.length; i++) {
+ String string = tags[i].trim();
+ String tags = curElement.getAttribute("tags");
+ if (tags != null) {
+ String[] catg = tags.split(",");
+ for (int j = 0; j < catg.length; j++) {
+ String string1 = catg[j].trim();
+ if (string.equalsIgnoreCase(string1)) {
+ checkTags = true;
+ }
+ }
+ }
+ }
+ } else {
+ checkTags = true;
+ }
+ return checkTags && checkCategories;
+ }
+
+ @Override
+ protected Node[] createNodes(Element key) {
+ return new Node[]{new AssetPackBrowserItem(key, project)};
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserFolder.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserFolder.java
new file mode 100644
index 000000000..6c33d362e
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserFolder.java
@@ -0,0 +1,63 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack.browser.nodes;
+
+import com.jme3.gde.assetpack.project.AssetPackProject;
+import com.jme3.gde.assetpack.project.actions.ImportAssetAction;
+import java.awt.Image;
+import javax.swing.Action;
+import org.netbeans.api.project.Project;
+import org.openide.nodes.AbstractNode;
+import org.openide.util.ImageUtilities;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class AssetPackBrowserFolder extends AbstractNode {
+
+ Image icon = ImageUtilities.loadImage("/com/jme3/gde/assetpack/icons/assets.gif");
+ Project proj;
+
+ public AssetPackBrowserFolder(Element[] elem, Project lib, String[] categories, String[] tags) {
+ super(new AssetPackBrowserChildren(elem, lib, categories, tags));
+ proj = lib;
+ setName("Assets");
+ }
+
+ public AssetPackBrowserFolder(Element[] elem, Project lib) {
+ super(new AssetPackBrowserChildren(elem, lib));
+ proj = lib;
+ setName("Assets");
+ }
+
+ public void refresh() {
+ ((AssetPackBrowserChildren) getChildren()).addNotify();
+ }
+
+ public Action[] getActions(boolean context) {
+ if (proj instanceof AssetPackProject) {
+ return new Action[]{new ImportAssetAction((AssetPackProject)proj)};
+ } else {
+ return new Action[]{ // SystemAction.get(RenameAction.class),
+ // SystemAction.get(CopyAction.class),
+ // SystemAction.get(CutAction.class),
+ // SystemAction.get(PasteAction.class),
+ // SystemAction.get(DeleteAction.class)
+ };
+ }
+ }
+
+ @Override
+ public Image getIcon(int type) {
+ return icon;
+ }
+
+ @Override
+ public Image getOpenedIcon(int type) {
+ return icon;
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java
new file mode 100644
index 000000000..6c5f1a3e8
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java
@@ -0,0 +1,109 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack.browser.nodes;
+
+import com.jme3.gde.assetpack.actions.AddAssetAction;
+import com.jme3.gde.assetpack.actions.PreviewAssetAction;
+import com.jme3.gde.assetpack.browser.AssetPackLibrary;
+import com.jme3.gde.assetpack.browser.properties.ElementAttributeProperty;
+import com.jme3.gde.assetpack.browser.properties.ElementNodeTextProperty;
+import com.jme3.gde.core.assets.ProjectAssetManager;
+import java.awt.Image;
+import javax.swing.Action;
+import org.netbeans.api.project.Project;
+import org.openide.nodes.AbstractNode;
+import org.openide.nodes.Children;
+import org.openide.nodes.Sheet;
+import org.openide.nodes.Sheet.Set;
+import org.openide.util.ImageUtilities;
+import org.openide.util.lookup.Lookups;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class AssetPackBrowserItem extends AbstractNode {
+
+ public static final String[] ASSET_TYPES = new String[]{
+ "model",
+ "texture",
+ "sound",
+ "material",
+ "other"};
+// public static final String[] ASSET_FORMATS = new String[]{
+// "ogrexml",
+// "wavefront",
+// "j3o",
+// "image",
+// "sound",
+// "other"};
+ private Element item;
+ private Image icon;
+ private Project project;
+ private PreviewAssetAction previewAction;
+ private AddAssetAction addAction;
+
+ public AssetPackBrowserItem(Element item, Project proj) {
+ super(Children.LEAF, proj != null ? Lookups.fixed(item, proj, proj.getLookup().lookup(ProjectAssetManager.class)) : Lookups.fixed(item));
+ addAction = new AddAssetAction(this);
+ previewAction = new PreviewAssetAction(this);
+ this.item = item;
+ this.project = proj;
+ setName(item.getAttribute("name"));
+ setImage();
+ }
+
+ private void setImage() {
+ try {
+ String add = item.getAttribute("type");
+ icon = ImageUtilities.loadImage("/com/jme3/gde/assetpack/icons/" + add + ".gif");
+ } catch (Exception e) {
+ }
+ }
+
+ @Override
+ public Image getIcon(int type) {
+ if (icon != null) {
+ return icon;
+ }
+ return super.getIcon(type);
+ }
+
+ public Action[] getActions(boolean context) {
+ if (project.getLookup().lookup(AssetPackLibrary.class) != null) {
+ return new Action[]{
+ addAction,
+ previewAction
+ };
+ } else {
+ return new Action[]{previewAction};
+ }
+ }
+
+ @Override
+ public Action getPreferredAction() {
+// if (project.getLookup().lookup(AssetPackLibrary.class) != null) {
+// return addAction;
+// } else {
+ return previewAction;
+// }
+ }
+
+ @Override
+ protected Sheet createSheet() {
+ Sheet sheet = super.createSheet();
+ Set set = Sheet.createPropertiesSet();
+ set.put(new ElementAttributeProperty(project, item, "name"));
+ set.put(new ElementNodeTextProperty(project, item, "description"));
+ set.put(new ElementAttributeProperty(project, item, "categories"));
+ set.put(new ElementAttributeProperty(project, item, "tags"));
+ set.put(new ElementNodeTextProperty(project, item, "license"));
+ set.put(new ElementAttributeProperty(project, item, "type", ASSET_TYPES));
+// set.put(new ElementAttributeProperty(project, item, "format", ASSET_FORMATS));
+ sheet.put(set);
+ return sheet;
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/properties/ElementAttributeProperty.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/properties/ElementAttributeProperty.java
new file mode 100644
index 000000000..3b7d85888
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/properties/ElementAttributeProperty.java
@@ -0,0 +1,87 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack.browser.properties;
+
+import com.jme3.gde.assetpack.project.AssetPackProject;
+import java.beans.PropertyEditor;
+import java.lang.reflect.InvocationTargetException;
+import org.netbeans.api.project.Project;
+import org.openide.nodes.Node.Property;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class ElementAttributeProperty extends Property {
+
+ private boolean readOnly;
+ private Element element;
+ private String attribute;
+ private PropertyEditor editor;
+ private Project project;
+
+ public ElementAttributeProperty(Project project, Element element, String attribute) {
+ this(project, element, attribute, false);
+ }
+
+ public ElementAttributeProperty(Project project, Element element, String attribute, String[] tags) {
+ this(project, element, attribute, tags, false);
+ }
+
+ public ElementAttributeProperty(Project project, Element element, String attribute, boolean readOnly) {
+ this(project, element, attribute, null, readOnly);
+ }
+
+ public ElementAttributeProperty(Project project, Element element, String attribute, String[] tags, boolean readOnly) {
+ super(String.class);
+ this.project = project;
+ this.readOnly = readOnly;
+ this.element = element;
+ this.attribute = attribute;
+ setName(attribute);
+ if (tags != null) {
+ editor = new SelectionPropertyEditor(tags, element.getAttribute(attribute));
+ }
+ }
+
+ @Override
+ public PropertyEditor getPropertyEditor() {
+ if (editor != null) {
+ return editor;
+ }
+ return super.getPropertyEditor();
+ }
+
+ @Override
+ public boolean canRead() {
+ return true;
+ }
+
+ @Override
+ public String getValue() throws IllegalAccessException, InvocationTargetException {
+ return element.getAttribute(attribute);
+ }
+
+ @Override
+ public boolean canWrite() {
+ if (this.project != null && this.project.getLookup().lookup(AssetPackProject.class) == null) {
+ return false;
+ }
+ return !readOnly;
+ }
+
+ @Override
+ public void setValue(String val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+ element.setAttribute(attribute, val);
+ if (this.project == null) {
+ return;
+ }
+ AssetPackProject project = this.project.getLookup().lookup(AssetPackProject.class);
+ if (project != null) {
+ project.saveSettings();
+ }
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/properties/ElementNodeTextProperty.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/properties/ElementNodeTextProperty.java
new file mode 100644
index 000000000..91580b7af
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/properties/ElementNodeTextProperty.java
@@ -0,0 +1,88 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack.browser.properties;
+
+import com.jme3.gde.assetpack.project.AssetPackProject;
+import java.beans.PropertyEditor;
+import java.lang.reflect.InvocationTargetException;
+import org.openide.nodes.Node.Property;
+import org.w3c.dom.Element;
+import com.jme3.gde.assetpack.XmlHelper;
+import org.netbeans.api.project.Project;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class ElementNodeTextProperty extends Property {
+
+ private boolean readOnly;
+ private Element element;
+ private String attribute;
+ private PropertyEditor editor;
+ private Project project;
+
+ public ElementNodeTextProperty(Project project, Element element, String attribute) {
+ this(project, element, attribute, false);
+ }
+
+ public ElementNodeTextProperty(Project project, Element element, String attribute, String[] tags) {
+ this(project, element, attribute, tags, false);
+ }
+
+ public ElementNodeTextProperty(Project project, Element element, String attribute, boolean readOnly) {
+ this(project, element, attribute, null, readOnly);
+ }
+
+ public ElementNodeTextProperty(Project project, Element element, String attribute, String[] tags, boolean readOnly) {
+ super(String.class);
+ this.readOnly = readOnly;
+ this.element = element;
+ this.attribute = attribute;
+ this.project = project;
+ setName(attribute);
+ if (tags != null) {
+ editor = new SelectionPropertyEditor(tags, element.getAttribute(attribute));
+ }
+ }
+
+ @Override
+ public PropertyEditor getPropertyEditor() {
+ if (editor != null) {
+ return editor;
+ }
+ return super.getPropertyEditor();
+ }
+
+ @Override
+ public boolean canRead() {
+ return true;
+ }
+
+ @Override
+ public String getValue() throws IllegalAccessException, InvocationTargetException {
+ return XmlHelper.findChildElement(element, attribute).getTextContent();// element.getAttribute(attribute);
+ }
+
+ @Override
+ public boolean canWrite() {
+ if (this.project != null && this.project.getLookup().lookup(AssetPackProject.class) == null) {
+ return false;
+ }
+ return !readOnly;
+ }
+
+ @Override
+ public void setValue(String val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+ XmlHelper.findChildElement(element, attribute).setTextContent(val);
+ if (this.project == null) {
+ return;
+ }
+ AssetPackProject project = this.project.getLookup().lookup(AssetPackProject.class);
+ if (project != null) {
+ project.saveSettings();
+ }
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/properties/SelectionPropertyEditor.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/properties/SelectionPropertyEditor.java
new file mode 100644
index 000000000..191bbe2f9
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/properties/SelectionPropertyEditor.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.jme3.gde.assetpack.browser.properties;
+
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Rectangle;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyEditor;
+import java.util.Iterator;
+import java.util.LinkedList;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class SelectionPropertyEditor implements PropertyEditor {
+
+ private LinkedList listeners = new LinkedList();
+ private String value = new String();
+ String[] tags = new String[0];
+
+ public SelectionPropertyEditor(String[] tags, String value) {
+ this.tags = tags;
+ this.value = value;
+ }
+
+ public void setValue(Object value) {
+ if (value instanceof String) {
+ value = (String) value;
+ }
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public boolean isPaintable() {
+ return false;
+ }
+
+ public void paintValue(Graphics gfx, Rectangle box) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public String getJavaInitializationString() {
+ return null;
+ }
+
+ public String getAsText() {
+ return value.toString();
+ }
+
+ public void setAsText(final String text) throws IllegalArgumentException {
+ String old = value;
+ value = text;
+ notifyListeners(old, value);
+ }
+
+ public String[] getTags() {
+ return tags;
+ }
+
+ public Component getCustomEditor() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean supportsCustomEditor() {
+ return false;
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ listeners.add(listener);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ listeners.remove(listener);
+ }
+
+ private void notifyListeners(String before, String after) {
+ for (Iterator it = listeners.iterator(); it.hasNext();) {
+ PropertyChangeListener propertyChangeListener = it.next();
+ propertyChangeListener.propertyChange(new PropertyChangeEvent(this, null, before, after));
+ }
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/assetpack.png b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/assetpack.png
new file mode 100644
index 000000000..c866d25e5
Binary files /dev/null and b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/assetpack.png differ
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/assetpack_24.png b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/assetpack_24.png
new file mode 100644
index 000000000..39f043ce4
Binary files /dev/null and b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/assetpack_24.png differ
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/assetpack_48.png b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/assetpack_48.png
new file mode 100644
index 000000000..c6e17fdd5
Binary files /dev/null and b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/assetpack_48.png differ
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/assets.gif b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/assets.gif
new file mode 100644
index 000000000..941730bab
Binary files /dev/null and b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/assets.gif differ
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/font.gif b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/font.gif
new file mode 100644
index 000000000..3747a103e
Binary files /dev/null and b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/font.gif differ
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/gui.gif b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/gui.gif
new file mode 100644
index 000000000..421d54335
Binary files /dev/null and b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/gui.gif differ
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/material.gif b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/material.gif
new file mode 100644
index 000000000..7f524523f
Binary files /dev/null and b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/material.gif differ
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/model.gif b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/model.gif
new file mode 100644
index 000000000..eeab8ff3a
Binary files /dev/null and b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/model.gif differ
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/scene.gif b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/scene.gif
new file mode 100644
index 000000000..95ca42aba
Binary files /dev/null and b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/scene.gif differ
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/sound.gif b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/sound.gif
new file mode 100644
index 000000000..6b7af790a
Binary files /dev/null and b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/sound.gif differ
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/texture.gif b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/texture.gif
new file mode 100644
index 000000000..638f48ff0
Binary files /dev/null and b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/icons/texture.gif differ
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/layer.xml b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/layer.xml
new file mode 100644
index 000000000..586c50b9f
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/layer.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/online/MultiPartFormOutputStream.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/online/MultiPartFormOutputStream.java
new file mode 100644
index 000000000..f901a563d
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/online/MultiPartFormOutputStream.java
@@ -0,0 +1,401 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack.online;
+
+import java.io.*;
+import java.net.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.netbeans.api.progress.ProgressHandle;
+
+/**
+ * MultiPartFormOutputStream is used to write
+ * "multipart/form-data" to a java.net.URLConnection for
+ * POSTing. This is primarily for file uploading to HTTP servers.
+ *
+ * @since JDK1.3
+ */
+public class MultiPartFormOutputStream {
+
+ /**
+ * The line end characters.
+ */
+ private static final String NEWLINE = "\r\n";
+ /**
+ * The boundary prefix.
+ */
+ private static final String PREFIX = "--";
+ /**
+ * The output stream to write to.
+ */
+ private DataOutputStream out = null;
+ /**
+ * The multipart boundary string.
+ */
+ private String boundary = null;
+
+ /**
+ * Creates a new MultiPartFormOutputStream object using
+ * the specified output stream and boundary. The boundary is required
+ * to be created before using this method, as described in the
+ * description for the getContentType(String) method.
+ * The boundary is only checked for null or empty string,
+ * but it is recommended to be at least 6 characters. (Or use the
+ * static createBoundary() method to create one.)
+ *
+ * @param os the output stream
+ * @param boundary the boundary
+ * @see #createBoundary()
+ * @see #getContentType(String)
+ */
+ public MultiPartFormOutputStream(OutputStream os, String boundary) {
+ if (os == null) {
+ throw new IllegalArgumentException("Output stream is required.");
+ }
+ if (boundary == null || boundary.length() == 0) {
+ throw new IllegalArgumentException("Boundary stream is required.");
+ }
+ this.out = new DataOutputStream(os);
+ this.boundary = boundary;
+ }
+
+ /**
+ * Writes an boolean field value.
+ *
+ * @param name the field name (required)
+ * @param value the field value
+ * @throws java.io.IOException on input/output errors
+ */
+ public void writeField(String name, boolean value)
+ throws java.io.IOException {
+ writeField(name, new Boolean(value).toString());
+ }
+
+ /**
+ * Writes an double field value.
+ *
+ * @param name the field name (required)
+ * @param value the field value
+ * @throws java.io.IOException on input/output errors
+ */
+ public void writeField(String name, double value)
+ throws java.io.IOException {
+ writeField(name, Double.toString(value));
+ }
+
+ /**
+ * Writes an float field value.
+ *
+ * @param name the field name (required)
+ * @param value the field value
+ * @throws java.io.IOException on input/output errors
+ */
+ public void writeField(String name, float value)
+ throws java.io.IOException {
+ writeField(name, Float.toString(value));
+ }
+
+ /**
+ * Writes an long field value.
+ *
+ * @param name the field name (required)
+ * @param value the field value
+ * @throws java.io.IOException on input/output errors
+ */
+ public void writeField(String name, long value)
+ throws java.io.IOException {
+ writeField(name, Long.toString(value));
+ }
+
+ /**
+ * Writes an int field value.
+ *
+ * @param name the field name (required)
+ * @param value the field value
+ * @throws java.io.IOException on input/output errors
+ */
+ public void writeField(String name, int value)
+ throws java.io.IOException {
+ writeField(name, Integer.toString(value));
+ }
+
+ /**
+ * Writes an short field value.
+ *
+ * @param name the field name (required)
+ * @param value the field value
+ * @throws java.io.IOException on input/output errors
+ */
+ public void writeField(String name, short value)
+ throws java.io.IOException {
+ writeField(name, Short.toString(value));
+ }
+
+ /**
+ * Writes an char field value.
+ *
+ * @param name the field name (required)
+ * @param value the field value
+ * @throws java.io.IOException on input/output errors
+ */
+ public void writeField(String name, char value)
+ throws java.io.IOException {
+ writeField(name, new Character(value).toString());
+ }
+
+ /**
+ * Writes an string field value. If the value is null, an empty string
+ * is sent ("").
+ *
+ * @param name the field name (required)
+ * @param value the field value
+ * @throws java.io.IOException on input/output errors
+ */
+ public void writeField(String name, String value)
+ throws java.io.IOException {
+ if (name == null) {
+ throw new IllegalArgumentException("Name cannot be null or empty.");
+ }
+ if (value == null) {
+ value = "";
+ }
+ /*
+ --boundary\r\n
+ Content-Disposition: form-data; name=""\r\n
+ \r\n
+ \r\n
+ */
+ // write boundary
+ out.writeBytes(PREFIX);
+ out.writeBytes(boundary);
+ out.writeBytes(NEWLINE);
+ // write content header
+ out.writeBytes("Content-Disposition: form-data; name=\"" + name + "\"");
+ out.writeBytes(NEWLINE);
+ out.writeBytes(NEWLINE);
+ // write content
+ out.writeBytes(value);
+ out.writeBytes(NEWLINE);
+ out.flush();
+ }
+
+ /**
+ * Writes a file's contents. If the file is null, does not exists, or
+ * is a directory, a java.lang.IllegalArgumentException
+ * will be thrown.
+ *
+ * @param name the field name
+ * @param mimeType the file content type (optional, recommended)
+ * @param file the file (the file must exist)
+ * @throws java.io.IOException on input/output errors
+ */
+ public void writeFile(String name, String mimeType, File file)
+ throws java.io.IOException {
+ if (file == null) {
+ throw new IllegalArgumentException("File cannot be null.");
+ }
+ if (!file.exists()) {
+ throw new IllegalArgumentException("File does not exist.");
+ }
+ if (file.isDirectory()) {
+ throw new IllegalArgumentException("File cannot be a directory.");
+ }
+ writeFile(name, mimeType, file.getCanonicalPath(), new FileInputStream(file));
+ }
+
+ /**
+ * Writes a input stream's contents. If the input stream is null, a
+ * java.lang.IllegalArgumentException will be thrown.
+ *
+ * @param name the field name
+ * @param mimeType the file content type (optional, recommended)
+ * @param fileName the file name (required)
+ * @param is the input stream
+ * @throws java.io.IOException on input/output errors
+ */
+ public void writeFile(String name, String mimeType,
+ String fileName, InputStream is)
+ throws java.io.IOException {
+ if (is == null) {
+ throw new IllegalArgumentException("Input stream cannot be null.");
+ }
+ if (fileName == null || fileName.length() == 0) {
+ throw new IllegalArgumentException("File name cannot be null or empty.");
+ }
+ /*
+ --boundary\r\n
+ Content-Disposition: form-data; name=""; filename=""\r\n
+ Content-Type: \r\n
+ \r\n
+ \r\n
+ */
+ // write boundary
+ out.writeBytes(PREFIX);
+ out.writeBytes(boundary);
+ out.writeBytes(NEWLINE);
+ // write content header
+ out.writeBytes("Content-Disposition: form-data; name=\"" + name
+ + "\"; filename=\"" + fileName + "\"");
+ out.writeBytes(NEWLINE);
+ if (mimeType != null) {
+ out.writeBytes("Content-Type: " + mimeType);
+ out.writeBytes(NEWLINE);
+ }
+ out.writeBytes(NEWLINE);
+ // write content
+ byte[] data = new byte[1024];
+ int r = 0;
+ while ((r = is.read(data, 0, data.length)) != -1) {
+ out.write(data, 0, r);
+ }
+ // close input stream, but ignore any possible exception for it
+ try {
+ is.close();
+ } catch (Exception e) {
+ }
+ out.writeBytes(NEWLINE);
+ out.flush();
+ }
+
+ /**
+ * Writes the given bytes. The bytes are assumed to be the contents
+ * of a file, and will be sent as such. If the data is null, a
+ * java.lang.IllegalArgumentException will be thrown.
+ *
+ * @param name the field name
+ * @param mimeType the file content type (optional, recommended)
+ * @param fileName the file name (required)
+ * @param data the file data
+ * @throws java.io.IOException on input/output errors
+ */
+ public void writeFile(String name, String mimeType,
+ String fileName, byte[] data)
+ throws java.io.IOException {
+ if (data == null) {
+ throw new IllegalArgumentException("Data cannot be null.");
+ }
+ if (fileName == null || fileName.length() == 0) {
+ throw new IllegalArgumentException("File name cannot be null or empty.");
+ }
+ /*
+ --boundary\r\n
+ Content-Disposition: form-data; name=""; filename=""\r\n
+ Content-Type: \r\n
+ \r\n
+ \r\n
+ */
+ // write boundary
+ out.writeBytes(PREFIX);
+ out.writeBytes(boundary);
+ out.writeBytes(NEWLINE);
+ // write content header
+ out.writeBytes("Content-Disposition: form-data; name=\"" + name
+ + "\"; filename=\"" + fileName + "\"");
+ out.writeBytes(NEWLINE);
+ if (mimeType != null) {
+ out.writeBytes("Content-Type: " + mimeType);
+ out.writeBytes(NEWLINE);
+ }
+ out.writeBytes(NEWLINE);
+ // write content
+ out.write(data, 0, data.length);
+ out.writeBytes(NEWLINE);
+ out.flush();
+ }
+
+ /**
+ * Flushes the stream. Actually, this method does nothing, as the only
+ * write methods are highly specialized and automatically flush.
+ *
+ * @throws java.io.IOException on input/output errors
+ */
+ public void flush() throws java.io.IOException {
+ // out.flush();
+ }
+
+ /**
+ * Closes the stream.
+ *
+ * NOTE: This method MUST be called to finalize the
+ * multipart stream.
+ *
+ * @throws java.io.IOException on input/output errors
+ */
+ public void close() throws java.io.IOException {
+ // write final boundary
+ out.writeBytes(PREFIX);
+ out.writeBytes(boundary);
+ out.writeBytes(PREFIX);
+ out.writeBytes(NEWLINE);
+ out.flush();
+ out.close();
+ }
+
+ /**
+ * Gets the multipart boundary string being used by this stream.
+ *
+ * @return the boundary
+ */
+ public String getBoundary() {
+ return this.boundary;
+ }
+
+ /**
+ * Creates a new java.net.URLConnection object from the
+ * specified java.net.URL. This is a convenience method
+ * which will set the doInput, doOutput,
+ * useCaches and defaultUseCaches fields to
+ * the appropriate settings in the correct order.
+ *
+ * @return a java.net.URLConnection object for the URL
+ * @throws java.io.IOException on input/output errors
+ */
+ public static URLConnection createConnection(URL url)
+ throws java.io.IOException {
+ URLConnection urlConn = url.openConnection();
+ if (urlConn instanceof HttpURLConnection) {
+ HttpURLConnection httpConn = (HttpURLConnection) urlConn;
+ httpConn.setRequestMethod("POST");
+ }
+ urlConn.setDoInput(true);
+ urlConn.setDoOutput(true);
+ urlConn.setUseCaches(false);
+ urlConn.setDefaultUseCaches(false);
+ return urlConn;
+ }
+
+ /**
+ * Creates a multipart boundary string by concatenating 20 hyphens (-)
+ * and the hexadecimal (base-16) representation of the current time in
+ * milliseconds.
+ *
+ * @return a multipart boundary string
+ * @see #getContentType(String)
+ */
+ public static String createBoundary() {
+ return "--------------------"
+ + Long.toString(System.currentTimeMillis(), 16);
+ }
+
+ /**
+ * Gets the content type string suitable for the
+ * java.net.URLConnection which includes the multipart
+ * boundary string.
+ *
+ * This method is static because, due to the nature of the
+ * java.net.URLConnection class, once the output stream
+ * for the connection is acquired, it's too late to set the content
+ * type (or any other request parameter). So one has to create a
+ * multipart boundary string first before using this class, such as
+ * with the createBoundary() method.
+ *
+ * @param boundary the boundary string
+ * @return the content type string
+ * @see #createBoundary()
+ */
+ public static String getContentType(String boundary) {
+ return "multipart/form-data; boundary=" + boundary;
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/online/OnlinePacksConnector.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/online/OnlinePacksConnector.java
new file mode 100644
index 000000000..8269d82c3
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/online/OnlinePacksConnector.java
@@ -0,0 +1,75 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.jme3.gde.assetpack.online;
+
+import java.io.*;
+import java.net.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.NotifyDescriptor.Confirmation;
+import org.openide.filesystems.FileUtil;
+
+/**
+ *
+ * @author normenhansen
+ */
+public class OnlinePacksConnector {
+
+ public static void upload(String exsistingFileName, String user, String pass) {
+ upload("http://jmonkeyengine.org/assetpacks/upload.php", exsistingFileName, user, pass);
+ }
+
+ public static void upload(String urlString, String exsistingFileName, String user, String pass) {
+ try {
+ File file = new File(exsistingFileName);
+ int size = (int) FileUtil.toFileObject(file).getSize();
+ Logger.getLogger(OnlinePacksConnector.class.getName()).log(Level.FINE, "Upload file size: {0}", size);
+
+ URL url = new URL(urlString);
+ String boundary = MultiPartFormOutputStream.createBoundary();
+ URLConnection urlConn = MultiPartFormOutputStream.createConnection(url);
+ urlConn.setRequestProperty("Accept", "*/*");
+ urlConn.setRequestProperty("Content-Type", MultiPartFormOutputStream.getContentType(boundary));
+ urlConn.setRequestProperty("Connection", "Keep-Alive");
+ urlConn.setRequestProperty("Cache-Control", "no-cache");
+ MultiPartFormOutputStream out = new MultiPartFormOutputStream(urlConn.getOutputStream(), boundary);
+ // write a text field element
+ out.writeField("user", user);
+ out.writeField("pass", pass);
+ // upload a file
+ out.writeFile("file", "application/zip", file);
+ // can also write bytes directly
+ //out.writeFile("myFile", "text/plain", "C:\\test.txt",
+ // "This is some file text.".getBytes("ASCII"));
+ out.close();
+ // read response from server
+ BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
+ String line = "";
+ while ((line = in.readLine()) != null) {
+ if (line.startsWith("Error:")) {
+ line = line.substring(6, line.length()).trim();
+ Confirmation msg = new NotifyDescriptor.Confirmation(
+ "Error uploading to jmonkeyengine.org!\n" + line,
+ NotifyDescriptor.OK_CANCEL_OPTION,
+ NotifyDescriptor.ERROR_MESSAGE);
+ DialogDisplayer.getDefault().notifyLater(msg);
+ }else{
+ Confirmation msg = new NotifyDescriptor.Confirmation(
+ "Successfully uploaded to jmonkeyengine.org!\n" + line,
+ NotifyDescriptor.OK_CANCEL_OPTION,
+ NotifyDescriptor.INFORMATION_MESSAGE);
+ DialogDisplayer.getDefault().notifyLater(msg);
+ }
+ System.out.println(line);
+ }
+ in.close();
+ } catch (Exception ex) {
+ Logger.getLogger(OnlinePacksConnector.class.getName()).log(Level.SEVERE, null, ex);
+ } finally {
+ }
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProject.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProject.java
new file mode 100644
index 000000000..0cbb013c7
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProject.java
@@ -0,0 +1,397 @@
+package com.jme3.gde.assetpack.project;
+
+import com.jme3.gde.assetpack.XmlHelper;
+import com.jme3.gde.assetpack.browser.nodes.AssetPackBrowserFolder;
+import com.jme3.gde.assetpack.project.properties.GeneralSettingsPanel;
+import com.jme3.gde.assetpack.project.properties.LicensePanel;
+import com.jme3.gde.core.assets.ProjectAssetManager;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ProjectInformation;
+import org.netbeans.spi.project.ActionProvider;
+import org.netbeans.spi.project.DeleteOperationImplementation;
+import org.netbeans.spi.project.CopyOperationImplementation;
+import org.netbeans.spi.project.ProjectState;
+import org.netbeans.spi.project.ui.CustomizerProvider;
+import org.netbeans.spi.project.ui.LogicalViewProvider;
+import org.netbeans.spi.project.ui.support.DefaultProjectOperations;
+import org.netbeans.spi.project.ui.support.ProjectCustomizer;
+import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category;
+import org.openide.filesystems.FileLock;
+import org.openide.filesystems.FileObject;
+import org.openide.util.Exceptions;
+import org.openide.util.HelpCtx;
+import org.openide.util.ImageUtilities;
+import org.openide.util.Lookup;
+import org.openide.util.lookup.Lookups;
+import org.openide.xml.XMLUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+
+public class AssetPackProject implements Project {
+
+ private final FileObject projectDir;
+ private LogicalViewProvider logicalView = new AssetPackProjectLogicalView(this);
+ private String assetsFolder = "assets";
+ private final ProjectState state;
+ private Lookup lkp;
+ private ProjectAssetManager projectAssetManager;
+ private Document configuration;
+ private AssetPackProjectCustomizer projectCustomizer;
+ private AssetPackBrowserFolder assetPackFolder;
+
+ public AssetPackProject(FileObject projectDir, ProjectState state) {
+ this.projectDir = projectDir;
+ this.state = state;
+ projectAssetManager = new ProjectAssetManager(this, assetsFolder);
+ loadProjectFile();
+ projectCustomizer = new AssetPackProjectCustomizer(this);
+ }
+
+ @Override
+ public FileObject getProjectDirectory() {
+ return projectDir;
+ }
+
+ private FileObject getConfigFile() {
+ FileObject folder = projectDir;
+ FileObject file = folder.getFileObject(AssetPackProjectFactory.CONFIG_NAME);
+ if (file == null) {
+ try {
+ return folder.createData(AssetPackProjectFactory.CONFIG_NAME);
+ } catch (IOException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ }
+ return file;
+ }
+
+ private void loadProjectFile() {
+ InputStream in = null;
+ try {
+ FileObject file = getConfigFile();
+ in = file.getInputStream();
+ configuration = XMLUtil.parse(new InputSource(in), false, false, null, null);
+ in.close();
+ } catch (Exception ex) {
+ Exceptions.printStackTrace(ex);
+ } finally {
+ }
+ }
+
+ public FileObject getAssetsFolder() {
+ FileObject result =
+ projectDir.getFileObject(assetsFolder);
+ try {
+ if (result == null) {
+ result = projectDir.createFolder(assetsFolder);
+ }
+ } catch (IOException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ return result;
+ }
+
+ public String getDescription() {
+ Element properties = null;
+ properties = XmlHelper.findChildElement(configuration.getDocumentElement(), "description");
+ if (properties == null) {
+ return "";
+ }
+ return properties.getTextContent().trim();
+ }
+
+ public void setDescription(String description) {
+ Element properties = null;
+ properties = XmlHelper.findChildElement(configuration.getDocumentElement(), "description");
+ if (properties == null) {
+ return;
+ }
+ properties.setTextContent(description);
+ }
+
+ public String getLicense() {
+ Element properties = null;
+ properties = XmlHelper.findChildElement(configuration.getDocumentElement(), "license");
+ if (properties == null) {
+ return "";
+ }
+ return properties.getTextContent().trim();
+ }
+
+ public void setLicense(String description) {
+ Element properties = null;
+ properties = XmlHelper.findChildElement(configuration.getDocumentElement(), "license");
+ if (properties == null) {
+ properties = configuration.createElement("license");
+ configuration.appendChild(properties);
+ }
+ properties.setTextContent(description);
+ }
+
+ public String getProjectName() {
+ return configuration.getDocumentElement().getAttribute("name");
+ }
+
+ public void setProjectName(String name) {
+ configuration.getDocumentElement().setAttribute("name", name);
+ }
+
+ public String getDistributorName() {
+ return configuration.getDocumentElement().getAttribute("distributor");
+ }
+
+ public void setDistributorName(String name) {
+ configuration.getDocumentElement().setAttribute("distributor", name);
+ }
+
+ public String getVersion() {
+ return configuration.getDocumentElement().getAttribute("version");
+ }
+
+ public void setVersion(String name) {
+ configuration.getDocumentElement().setAttribute("version", name);
+ }
+
+ public void saveSettings() {
+ FileLock lock = null;
+ try {
+ FileObject file = getConfigFile();
+ lock = file.lock();
+ OutputStream out = file.getOutputStream(lock);
+ XMLUtil.write(configuration, out, "UTF-8");
+ if (out != null) {
+ out.close();
+
+ }
+ } catch (IOException ex) {
+ Exceptions.printStackTrace(ex);
+ } finally {
+ if (lock != null) {
+ lock.releaseLock();
+ }
+ }
+ }
+
+ public Element getProjectAssets() {
+ return XmlHelper.findChildElement(configuration.getDocumentElement(), "assets");
+ }
+
+ public Element getProjectDescription() {
+ return XmlHelper.findChildElement(configuration.getDocumentElement(), "description");
+ }
+
+ public Element getProjectLicense() {
+ return XmlHelper.findChildElement(configuration.getDocumentElement(), "license");
+ }
+
+ @Override
+ public Lookup getLookup() {
+ if (lkp == null) {
+ lkp = Lookups.fixed(new Object[]{
+ this, //project spec requires a project be in its own lookup
+ state, //allow outside code to mark the project as needing saving
+ logicalView, //Logical view of project implementation
+ projectAssetManager,
+ projectCustomizer,
+ new ActionProviderImpl(), //Provides standard actions like Build and Clean
+ new DemoDeleteOperation(),
+ new DemoCopyOperation(this),
+ new Info(), //Project information implementation
+ });
+ }
+ return lkp;
+ }
+
+ public ProjectAssetManager getProjectAssetManager() {
+ return projectAssetManager;
+ }
+
+ public AssetPackProjectCustomizer getProjectCustomizer() {
+ return projectCustomizer;
+ }
+
+ /**
+ * @return the configuration
+ */
+ public Document getConfiguration() {
+ return configuration;
+ }
+
+ public AssetPackBrowserFolder getAssetPackFolder() {
+ return assetPackFolder;
+ }
+
+ public AssetPackBrowserFolder setAssetPackFolder(AssetPackBrowserFolder folder) {
+ assetPackFolder = folder;
+ return assetPackFolder;
+ }
+
+// public void showProjectCustomizer(){
+// ProjectCustomizer.createCustomizerDialog("com-jme3-gde-assetpack", this.getLookup(), "General", null, HelpCtx.DEFAULT_HELP).setVisible(true);
+// }
+ private final class ActionProviderImpl implements ActionProvider {
+
+ private String[] supported = new String[]{
+ ActionProvider.COMMAND_DELETE,
+ ActionProvider.COMMAND_COPY,};
+
+ @Override
+ public String[] getSupportedActions() {
+ return supported;
+ }
+
+ @Override
+ public void invokeAction(String string, Lookup lookup) throws IllegalArgumentException {
+ if (string.equalsIgnoreCase(ActionProvider.COMMAND_DELETE)) {
+ DefaultProjectOperations.performDefaultDeleteOperation(AssetPackProject.this);
+ }
+ if (string.equalsIgnoreCase(ActionProvider.COMMAND_COPY)) {
+ DefaultProjectOperations.performDefaultCopyOperation(AssetPackProject.this);
+ }
+ }
+
+ @Override
+ public boolean isActionEnabled(String command, Lookup lookup) throws IllegalArgumentException {
+ if ((command.equals(ActionProvider.COMMAND_DELETE))) {
+ return true;
+ } else if ((command.equals(ActionProvider.COMMAND_COPY))) {
+ return true;
+ } else {
+ throw new IllegalArgumentException(command);
+ }
+ }
+ }
+
+ private final class DemoDeleteOperation implements DeleteOperationImplementation {
+
+ public void notifyDeleting() throws IOException {
+ }
+
+ public void notifyDeleted() throws IOException {
+ }
+
+ public List getMetadataFiles() {
+ List dataFiles = new ArrayList();
+ return dataFiles;
+ }
+
+ public List getDataFiles() {
+ List dataFiles = new ArrayList();
+ return dataFiles;
+ }
+ }
+
+ private final class DemoCopyOperation implements CopyOperationImplementation {
+
+ private final AssetPackProject project;
+ private final FileObject projectDir;
+
+ public DemoCopyOperation(AssetPackProject project) {
+ this.project = project;
+ this.projectDir = project.getProjectDirectory();
+ }
+
+ public List getMetadataFiles() {
+ return Collections.EMPTY_LIST;
+ }
+
+ public List getDataFiles() {
+ return Collections.EMPTY_LIST;
+ }
+
+ public void notifyCopying() throws IOException {
+ }
+
+ public void notifyCopied(Project arg0, File arg1, String arg2) throws IOException {
+ }
+ }
+
+ private final class AssetPackProjectCustomizer implements CustomizerProvider, ProjectCustomizer.CategoryComponentProvider, ActionListener {
+
+ private Category[] propertyCategories = new Category[]{
+ Category.create("General", "General", null),
+ Category.create("License", "License", null),};
+ AssetPackProject project;
+ GeneralSettingsPanel panel1;
+ LicensePanel panel2;
+
+ public AssetPackProjectCustomizer(AssetPackProject project) {
+ this.project = project;
+ }
+
+ public void showCustomizer() {
+ ProjectCustomizer.createCustomizerDialog(propertyCategories, this, "General", this, new HelpCtx("sdk.asset_packs")).setVisible(true);
+ }
+
+ public JComponent create(Category category) {
+ if (category.getName().equals("General")) {
+ panel1 =
+ new GeneralSettingsPanel(project);
+ return panel1;
+ } else if (category.getName().equals("License")) {
+ panel2 =
+ new LicensePanel(project);
+ return panel2;
+ } else {
+ return new JPanel();
+ }
+
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ panel1.actionPerformed(null);
+ panel2.actionPerformed(null);
+ saveSettings();
+ }
+ }
+
+ /** Implementation of project system's ProjectInformation class */
+ private final class Info implements ProjectInformation {
+
+ @Override
+ public Icon getIcon() {
+ return new ImageIcon(ImageUtilities.loadImage(
+ "com/jme3/gde/assetpack/icons/assetpack.png"));
+ }
+
+ @Override
+ public String getName() {
+ return getProjectName();
+ }
+
+ @Override
+ public String getDisplayName() {
+ return getProjectName();
+ }
+
+ @Override
+ public void addPropertyChangeListener(PropertyChangeListener pcl) {
+ //do nothing, won't change
+ }
+
+ @Override
+ public void removePropertyChangeListener(PropertyChangeListener pcl) {
+ //do nothing, won't change
+ }
+
+ @Override
+ public Project getProject() {
+ return AssetPackProject.this;
+ }
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProjectDescription.html b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProjectDescription.html
new file mode 100644
index 000000000..c8fcf1de5
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProjectDescription.html
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ An AssetPack allows you to pack models, textures, sounds and other assets
+ into packages that you can browse inside jMP and easily add the assets to any project.
+ You can also distribute your AssetPack to other users in the form of zip files
+ or via jmonkeyengine.org
+
+
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProjectFactory.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProjectFactory.java
new file mode 100644
index 000000000..31e1508d9
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProjectFactory.java
@@ -0,0 +1,39 @@
+package com.jme3.gde.assetpack.project;
+
+import java.io.IOException;
+import org.netbeans.api.project.Project;
+import org.netbeans.spi.project.ProjectFactory;
+import org.netbeans.spi.project.ProjectState;
+import org.openide.filesystems.FileObject;
+
+public class AssetPackProjectFactory implements ProjectFactory {
+
+ public static final String CONFIG_NAME = "assetpack.xml";
+
+ //Specifies when a project is a project, i.e. properties file exists
+ @Override
+ public boolean isProject(FileObject projectDirectory) {
+ if (projectDirectory.getFileObject(CONFIG_NAME) != null) {
+ return true;
+ }
+ return false;
+ }
+
+ //Specifies when the project will be opened, i.e.,
+ //if the project exists:
+ @Override
+ public Project loadProject(FileObject dir, ProjectState state) throws IOException {
+ return isProject(dir) ? new AssetPackProject(dir, state) : null;
+ }
+
+ @Override
+ public void saveProject(final Project project) throws IOException, ClassCastException {
+ FileObject projectRoot = project.getProjectDirectory();
+ if (projectRoot.getFileObject(CONFIG_NAME) == null) {
+ throw new IOException("Project Settings " + projectRoot.getPath()
+ + " deleted,"
+ + " cannot save project");
+ }
+ ((AssetPackProject)project).saveSettings();
+ }
+}
diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProjectLogicalView.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProjectLogicalView.java
new file mode 100644
index 000000000..6984d82f2
--- /dev/null
+++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProjectLogicalView.java
@@ -0,0 +1,148 @@
+package com.jme3.gde.assetpack.project;
+
+import com.jme3.gde.assetpack.project.actions.PublishAssetPackAction;
+import com.jme3.gde.assetpack.browser.nodes.AssetPackBrowserFolder;
+import com.jme3.gde.assetpack.project.actions.ConvertOgreBinaryMeshesAction;
+import java.awt.Image;
+import java.util.LinkedList;
+import java.util.List;
+import javax.swing.Action;
+import org.netbeans.spi.project.ui.LogicalViewProvider;
+import org.netbeans.spi.project.ui.support.CommonProjectActions;
+import org.openide.loaders.DataObjectNotFoundException;
+import org.openide.nodes.AbstractNode;
+import org.openide.nodes.Children;
+import org.openide.nodes.Node;
+import org.openide.util.Exceptions;
+import org.openide.util.ImageUtilities;
+import org.openide.util.lookup.AbstractLookup;
+import org.openide.util.lookup.InstanceContent;
+import org.w3c.dom.Element;
+
+class AssetPackProjectLogicalView implements LogicalViewProvider {
+
+ private final AssetPackProject project;
+
+ public AssetPackProjectLogicalView(AssetPackProject project) {
+ this.project = project;
+ }
+
+ @Override
+ public org.openide.nodes.Node createLogicalView() {
+
+ try {
+ return new ProjectNode(project);
+ } catch (DataObjectNotFoundException donfe) {
+ Exceptions.printStackTrace(donfe);
+ //Fallback—the directory couldn't be created -
+ //read-only filesystem or something evil happened
+ return new AbstractNode(Children.LEAF);
+ }
+ }
+
+ /** This is the node you actually see in the project tab for the project */
+ private static final class ProjectNode extends AbstractNode {
+
+ private InstanceContent instanceContent;
+ final AssetPackProject project;
+
+ public ProjectNode(AssetPackProject project) throws DataObjectNotFoundException {
+ super(new ProjectChildren(project), new ProjectLookup(new InstanceContent()));
+ this.project = project;
+ instanceContent = ((ProjectLookup) getLookup()).getInstanceContent();
+ instanceContent.add(project);
+ instanceContent.add(project.getProjectAssetManager());
+// instanceContent.add(project.getProjectCustomizer());
+ }
+
+ @Override
+ public Action[] getActions(boolean arg0) {
+ Action[] nodeActions = new Action[8];
+ nodeActions[0] = new PublishAssetPackAction(project);
+ nodeActions[1] = new ConvertOgreBinaryMeshesAction(project);
+ nodeActions[2] = CommonProjectActions.copyProjectAction();
+ nodeActions[3] = CommonProjectActions.deleteProjectAction();
+ nodeActions[5] = CommonProjectActions.setAsMainProjectAction();
+ nodeActions[6] = CommonProjectActions.closeProjectAction();
+ nodeActions[7] = CommonProjectActions.customizeProjectAction();
+ return nodeActions;
+ }
+
+ @Override
+ public Image getIcon(int type) {
+ return ImageUtilities.loadImage("com/jme3/gde/assetpack/icons/assetpack.png");
+ }
+
+ @Override
+ public Image getOpenedIcon(int type) {
+ return getIcon(type);
+ }
+
+ @Override
+ public String getDisplayName() {
+ return project.getProjectName();
+ }
+ }
+
+ public static final class ProjectLookup extends AbstractLookup {
+
+ private static final long serialVersionUID = 1214314412L;
+ private InstanceContent instanceContent;
+
+ public ProjectLookup(InstanceContent instanceContent) {
+ super(instanceContent);
+ this.instanceContent = instanceContent;
+ instanceContent.add(this);
+ }
+
+ public InstanceContent getInstanceContent() {
+ return instanceContent;
+ }
+ }
+
+ private static final class ProjectChildren extends Children.Keys