1 19 package org.netbeans.modules.java.j2seplatform.platformdefinition; 20 21 import org.netbeans.api.java.platform.JavaPlatform; 22 import org.netbeans.api.java.platform.JavaPlatformManager; 23 import org.netbeans.spi.java.queries.SourceLevelQueryImplementation; 24 25 29 public class J2SEPlatformSourceLevelQueryImpl implements SourceLevelQueryImplementation { 30 31 32 public J2SEPlatformSourceLevelQueryImpl() { 33 } 34 35 public String getSourceLevel(org.openide.filesystems.FileObject javaFile) { 36 try { 37 } catch (Exception e) {} 38 JavaPlatform[] platforms = JavaPlatformManager.getDefault().getInstalledPlatforms (); 39 for (int i=0; i< platforms.length; i++) { 40 if (J2SEPlatformImpl.PLATFORM_J2SE.equalsIgnoreCase(platforms[i].getSpecification().getName()) && platforms[i].getSourceFolders().contains(javaFile)) { return platforms[i].getSpecification().getVersion().toString(); 42 } 43 } 44 return null; 45 } 46 47 48 } 49 | Popular Tags |