This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I am trying to provide my own implementation of Java Platform. I am trying to avoid looking into source code, I am only relying on Javadoc. I believe it is not possible to succeed in this task with such restrictions. The documentation does not seem to be adequate. 1. I have my implementation of PlatformInstall. Where shall I register it and how? I tried @ServiceProvider(...) but no luck. This shall be part of javadoc for http://bits.netbeans.org/6.9.1/javadoc/org-netbeans-modules-java-platform/org/netbeans/spi/java/platform/PlatformInstall.html and/or http://bits.netbeans.org/6.9.1/javadoc/org-netbeans-modules-java-platform/org/netbeans/spi/java/platform/GeneralPlatformInstall.html 2. I guess I know what to do inside accept method (once it is called). I have no idea what createIterator method shall do. It's javadoc confirms I am not the only one: http://bits.netbeans.org/6.9.1/javadoc/org-netbeans-modules-java-platform/org/netbeans/spi/java/platform/PlatformInstall.html#createIterator(org.openide.filesystems.FileObject) Where the instance shall be created? A bit of demo code would be helpful.
OK, I started to read the java.platform code. This is how I can install my platform install: @ServiceProvider( service=GeneralPlatformInstall.class, path="org-netbeans-api-java/platform/installers" ) public final class LejosPlatformInstall extends PlatformInstall { }
Fixed jet-main 310a178b39ae
Integrated into 'main-golden', will be available in build *201010010000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/310a178b39ae User: Tomas Zezula <tzezula@netbeans.org> Log: #190165:Inadequate documentation for Java Platform API
Slight adjustments (hopefully correct) in http://hg.netbeans.org/core-main/rev/f6c8d20ade0a
Documentation is still incomplete and there is something incorrect. First, The "public java.util.Set instantiate() throws IOException" method has to return a Set of JavaPlatform not InstanceObject, the code in the example documentation causes a ClassCastException. the line ----- return Collections.singleton(InstanceDataObject.create( DataFolder.findFolder(FileUtil.getConfigFile("Services/Platforms/org-netbeans-api-java-Platform")), theName, p, null, true)); ------ has to be changed to ----- return Collections.singleton(InstanceDataObject.create( DataFolder.findFolder(FileUtil.getConfigFile("Services/Platforms/org-netbeans-api-java-Platform")), theName, p, null, true).instanceCreate()); ----- Then, even with this addition, It still doesn't work. I diagnosed the problem like this ----------------- In org/netbeans/modules/java/platform/ui/PlatformsCustomizer.java method refreshPlatforms() line 638 JavaPlatform platform = node.getLookup().lookup(JavaPlatform.class); after this line the "platform" reference points to null which means there is something other incorrect in the method instantiate. Please update the documentation to tell the right way. I can't fix it yet.
Created attachment 102507 [details] Sample lejos-rcx project of mine Here is the sample project that I have. Use following commands to get my sources. If you want to build up on them, go on. ~$ mkdir lejos ~$ cd lejos/ ~/lejos$ hg init ~/lejos$ hg unbundle ~/lejos-rcx.hg adding changesets adding manifests adding file changes added 4 changesets with 19 changes to 16 files (run 'hg update' to get a working copy) ~/lejos$ hg update
Fixe the javadoc. Fixed jet-main 6c35f5f5d12e. Regarding the PlatformsCustomizer: The null is OK and according to doc. The javadoc says: The platform definition file has to represent the JavaPlatform instance. This can be done in many ways. For example using the ConvertAsJavaBean annotation If you look at the customizer sources: http://hg.netbeans.org/jet-main/file/2ea59ca380d1/java.platform/src/org/netbeans/modules/java/platform/ui/PlatformsCustomizer.java The customizer lookups Platform in the Node, if it's not there it lookups InstanceCookie and uses it to create the platform.