Index: src/org/netbeans/modules/java/j2seproject/ui/customizer/Bundle.properties =================================================================== RCS file: /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/Bundle.properties,v retrieving revision 1.90 diff -u -r1.90 Bundle.properties --- src/org/netbeans/modules/java/j2seproject/ui/customizer/Bundle.properties 7 Sep 2007 09:55:19 -0000 1.90 +++ src/org/netbeans/modules/java/j2seproject/ui/customizer/Bundle.properties 28 Sep 2007 10:09:39 -0000 @@ -200,6 +200,8 @@ TXT_BrokenPlatformFmt=Missing platform: {0} #{0} - Source Level TXT_InvalidSourceLevel=Illegal Source Level: {0} +#{0} - JDK version +LBL_JDK=JDK {0} #LibrariesChooser MSG_LibraryAlreadyIncluded=The library is already included in the project. @@ -409,11 +411,8 @@ LBL_CustomizeJavadoc_AddOptionsInfo_JLabel=(e.g. -overview or -header "Some header") LBL_CustomizeRun_Run_TestVM_Options=&Test VM Options\: - - -TXT_SourceLevel=Source Level\: - -MNE_SourceLevel=L +TXT_SourceLevel=Source/Binary Format: +MNE_SourceLevel=B AD_SourceLevel=N/A Index: src/org/netbeans/modules/java/j2seproject/ui/customizer/PlatformUiSupport.java =================================================================== RCS file: /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/PlatformUiSupport.java,v retrieving revision 1.22 diff -u -r1.22 PlatformUiSupport.java --- src/org/netbeans/modules/java/j2seproject/ui/customizer/PlatformUiSupport.java 30 Jun 2006 20:07:44 -0000 1.22 +++ src/org/netbeans/modules/java/j2seproject/ui/customizer/PlatformUiSupport.java 28 Sep 2007 10:09:51 -0000 @@ -59,6 +59,7 @@ */ public class PlatformUiSupport { + private static final SpecificationVersion JDK_5 = new SpecificationVersion ("1.5"); //NOI18N private PlatformUiSupport() { } @@ -98,6 +99,7 @@ //null means active broken (unresolved) platform, no need to do anything if (platform != null) { SpecificationVersion jdk13 = new SpecificationVersion ("1.3"); //NOI18N + SpecificationVersion jdk16 = new SpecificationVersion ("1.6"); //NOI18N String platformAntName = (String) platform.getProperties().get("platform.ant.name"); //NOI18N assert platformAntName != null; props.put(J2SEProjectProperties.JAVA_PLATFORM, platformAntName); @@ -149,7 +151,23 @@ sourceLevel = ((SourceLevelKey)sourceLevelKey).getSourceLevel(); } String javacSource = sourceLevel.toString(); - String javacTarget = jdk13.compareTo(sourceLevel)>=0 ? "1.1" : javacSource; //NOI18N + String javacTarget = javacSource; + + //Issue #116490 + // Customizer value | -source | -targer + // JDK 1.2 1.2 1.1 + // JDK 1.3 1.3 1.3 + // JDK 1.4 1.4 1.4 + // JDK 5 1.5 1.5 + // JDK 6 1.5 1.6 + // JDK 7 1.7 1.7 - should bring a new language features + if (jdk13.compareTo(sourceLevel)>=0) { + javacTarget = "1.1"; //NOI18N + } + else if (jdk16.equals(sourceLevel)) { + javacSource = "1.5"; //NOI18N + } + if (!javacSource.equals(props.getProperty(J2SEProjectProperties.JAVAC_SOURCE))) { props.setProperty (J2SEProjectProperties.JAVAC_SOURCE, javacSource); } @@ -304,16 +322,16 @@ return this.sourceLevel.compareTo(otherKey.sourceLevel); } - public /*@Override*/ boolean equals (final Object other) { + public @Override boolean equals (final Object other) { return (other instanceof SourceLevelKey) && ((SourceLevelKey)other).sourceLevel.equals(this.sourceLevel); } - public /*@Override*/ int hashCode () { + public @Override int hashCode () { return this.sourceLevel.hashCode(); } - public /*@Override*/ String toString () { + public @Override String toString () { StringBuffer buffer = new StringBuffer (); if (this.broken) { buffer.append("Broken: "); //NOI18N @@ -322,6 +340,20 @@ return buffer.toString(); } + public String getDisplayName () { + String _tmp = sourceLevel.toString(); + if (JDK_5.compareTo(sourceLevel)<=0) { + int index = _tmp.indexOf('.'); //NOI18N + if (index > 0 && index + 1 < _tmp.length()) { + int index2 = _tmp.indexOf('.', index+1); //NOI18N + if (index2 < 0) { + _tmp = _tmp.substring(index+1); + } + } + } + return NbBundle.getMessage(PlatformUiSupport.class, "LBL_JDK",_tmp); + } + } private static class PlatformComboBoxModel extends AbstractListModel implements ComboBoxModel, PropertyChangeListener { @@ -599,10 +631,10 @@ SourceLevelKey key = (SourceLevelKey) value; if (key.isBroken()) { message = "" + //NOI18N - NbBundle.getMessage(PlatformUiSupport.class,"TXT_InvalidSourceLevel",key.getSourceLevel().toString()); + NbBundle.getMessage(PlatformUiSupport.class,"TXT_InvalidSourceLevel",key.getDisplayName()); } else { - message = key.getSourceLevel().toString(); + message = key.getDisplayName(); } } return this.delegate.getListCellRendererComponent(list, message, index, isSelected, cellHasFocus);