* for default platform.
* @return active {@link JavaPlatform} or null if the project's platform
* is broken
*/
public static JavaPlatform getJavaActivePlatform (final String activePlatformId) {
final JavaPlatformManager pm = JavaPlatformManager.getDefault();
if (activePlatformId == null) {
return pm.getDefaultPlatform();
}
else {
JavaPlatform[] installedPlatforms = pm.getPlatforms(null, new org.netbeans.api.java.platform.Specification ("j2se",null)); //NOI18N
for (JavaPlatform p : installedPlatforms) {
String antName = p.getProperties().get("platform.ant.name"); // NOI18N
if (antName != null && antName.equals(activePlatformId)) {
return p;
}