PlatformUiSupport.storePlatform
with updatePreferredPlatform
parameter
+ Added PlatformUiSupport.storePlatform
with updatePreferredPlatform
parameter allowing
+ the API clients to specify if the PreferredProjectPlatform
should be updated.
+
null
.
+ */
+ public static void storePlatform(
+ @NonNull final EditableProperties props,
+ @NonNull final UpdateHelper helper,
+ @NonNull final String projectConfigurationNamespace,
+ @NonNull final Object platformKey,
+ @NullAllowed final Object sourceLevelKey) {
+ storePlatform(props, helper, projectConfigurationNamespace, platformKey, sourceLevelKey, true);
+ }
/**
* Stores active platform, javac.source and javac.target into the project's metadata.
@@ -137,9 +158,16 @@
* @param projectConfigurationNamespace project configuration namespace.
* @param platformKey the {@link PlatformKey} got from the platform model.
* @param sourceLevelKey {@link SourceLevelKey} representing source level; can be null
.
+ * @param updatePreferredPlatform if true the {@link PreferredProjectPlatform} will be updated
+ * @since 1.37
*/
- public static void storePlatform(EditableProperties props, UpdateHelper helper,
- String projectConfigurationNamespace, Object platformKey, Object sourceLevelKey) {
+ public static void storePlatform(
+ @NonNull final EditableProperties props,
+ @NonNull final UpdateHelper helper,
+ @NonNull final String projectConfigurationNamespace,
+ @NonNull final Object platformKey,
+ @NullAllowed final Object sourceLevelKey,
+ final boolean updatePreferredPlatform) {
Parameters.notNull("props", props); //NOI18N
Parameters.notNull("helper", helper); //NOI18N
Parameters.notNull("projectConfigurationNamespace", projectConfigurationNamespace); //NOI18N
@@ -157,7 +185,9 @@
if (platform == null) {
return;
}
-
+ if (updatePreferredPlatform) {
+ PreferredProjectPlatform.setPreferredPlatform(platform);
+ }
SpecificationVersion jdk13 = new SpecificationVersion("1.3"); //NOI18N
String platformAntName = platform.getProperties().get("platform.ant.name"); //NOI18N
assert platformAntName != null;
diff --git a/java.j2seproject/nbproject/project.properties b/java.j2seproject/nbproject/project.properties
--- a/java.j2seproject/nbproject/project.properties
+++ b/java.j2seproject/nbproject/project.properties
@@ -42,7 +42,7 @@
javac.compilerargs=-Xlint -Xlint:-serial
javac.source=1.6
-spec.version.base=1.52.0
+spec.version.base=1.53.0
javadoc.arch=${basedir}/arch.xml
javadoc.apichanges=${basedir}/apichanges.xml
diff --git a/java.j2seproject/nbproject/project.xml b/java.j2seproject/nbproject/project.xml
--- a/java.j2seproject/nbproject/project.xml
+++ b/java.j2seproject/nbproject/project.xml
@@ -142,7 +142,7 @@
PreferredProjectPlatform
+ Added PreferredProjectPlatform
to provide a
+ JavaPlatform
which should be used for a new project.
+