? src/org/netbeans/modules/java/j2seproject/ui/customizer/MainClassChooserJList.form ? src/org/netbeans/modules/java/j2seproject/ui/customizer/MainClassChooserJList.java ? src/org/netbeans/modules/java/j2seproject/ui/customizer/MainClassChooser_backup.form ? src/org/netbeans/modules/java/j2seproject/ui/customizer/MainClassChooser_backup.java Index: src/org/netbeans/modules/java/j2seproject/J2SEProjectUtil.java =================================================================== RCS file: /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectUtil.java,v retrieving revision 1.1 diff -u -r1.1 J2SEProjectUtil.java --- src/org/netbeans/modules/java/j2seproject/J2SEProjectUtil.java 20 May 2004 13:40:23 -0000 1.1 +++ src/org/netbeans/modules/java/j2seproject/J2SEProjectUtil.java 21 May 2004 16:47:27 -0000 @@ -23,7 +23,7 @@ public class J2SEProjectUtil { private J2SEProjectUtil () {} - /** Returns the J2SEProject source' directory. + /** Returns the J2SEProject sources directory. * * @param p project (assumed J2SEProject) * @return source directory or null if not set or a wrong type of project @@ -32,6 +32,23 @@ if (p instanceof J2SEProject) { J2SEProject j2se = (J2SEProject) p; return j2se.getSourceDirectory (); + } else { + // support only J2SEProject, better throw IAE + return null; + } + } + + /** Returns the property value evaluated by J2SEProject's PropertyEvaluator. + * + * @param p project (assumed J2SEProject) + * @param property name of property + * @return evaluated value of given property or null if property not set or + * if a wrong type of project + */ + final public static String getEvaluatedProperty (Project p, String property) { + if (p instanceof J2SEProject) { + J2SEProject j2se = (J2SEProject) p; + return j2se.evaluator ().getProperty (property); } else { // support only J2SEProject, better throw IAE return null; 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.7 diff -u -r1.7 Bundle.properties --- src/org/netbeans/modules/java/j2seproject/ui/customizer/Bundle.properties 13 May 2004 12:24:57 -0000 1.7 +++ src/org/netbeans/modules/java/j2seproject/ui/customizer/Bundle.properties 21 May 2004 16:47:27 -0000 @@ -57,9 +57,8 @@ #Customize jar creation -LBL_CustomizeJar_DistDir_JTextField=Distribution Directory: -LBL_CustomizeJar_BrowseDistDir_JButton=Browse... -LBL_CustomizeJar_Excludes_JTextField=Exclude From Distribution: +LBL_CustomizeJar_DistDir_JTextField=JAR File: +LBL_CustomizeJar_Excludes_JTextField=Exclude From JAR: LBL_CustomizeJar_Commpres_JCheckBox=Compress JAR # Customize javadoc creation Index: src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerJar.form =================================================================== RCS file: /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerJar.form,v retrieving revision 1.2 diff -u -r1.2 CustomizerJar.form --- src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerJar.form 16 Mar 2004 15:30:58 -0000 1.2 +++ src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerJar.form 21 May 2004 16:47:27 -0000 @@ -25,24 +25,11 @@ - + - - - - - - - - - - - - - - + @@ -54,14 +41,14 @@ - + - + @@ -73,7 +60,7 @@ - + Index: src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerJar.java =================================================================== RCS file: /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerJar.java,v retrieving revision 1.2 diff -u -r1.2 CustomizerJar.java --- src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerJar.java 16 Mar 2004 15:30:58 -0000 1.2 +++ src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerJar.java 21 May 2004 16:47:28 -0000 @@ -26,6 +26,7 @@ import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataListener; import org.netbeans.api.project.ant.AntArtifact; +import org.netbeans.modules.java.j2seproject.J2SEProjectUtil; import org.netbeans.spi.project.support.ant.AntProjectHelper; import org.netbeans.spi.project.support.ant.PropertyUtils; import org.openide.DialogDisplayer; @@ -46,17 +47,11 @@ vps = new VisualPropertySupport( j2seProperties ); } - public void initValues() { - vps.register( jTextFieldDistDir, J2SEProjectProperties.DIST_DIR ); + vps.register( jTextFieldDistDir, J2SEProjectProperties.DIST_JAR ); vps.register( jTextFieldExcludes, J2SEProjectProperties.BUILD_CLASSES_EXCLUDES ); vps.register( jCheckBoxCommpress, J2SEProjectProperties.JAR_COMPRESS ); - - // XXX Temporarily removing some controls - remove( jLabelDistDir ); - remove( jTextFieldDistDir ); - remove( jButtonDistDir ); } @@ -70,7 +65,6 @@ jLabelDistDir = new javax.swing.JLabel(); jTextFieldDistDir = new javax.swing.JTextField(); - jButtonDistDir = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); jTextFieldExcludes = new javax.swing.JTextField(); jCheckBoxCommpress = new javax.swing.JCheckBox(); @@ -84,30 +78,29 @@ gridBagConstraints.insets = new java.awt.Insets(12, 12, 12, 12); add(jLabelDistDir, gridBagConstraints); - jTextFieldDistDir.setEnabled(false); + jTextFieldDistDir.setEditable(false); gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(12, 0, 12, 12); + gridBagConstraints.weightx = 1.0; add(jTextFieldDistDir, gridBagConstraints); - jButtonDistDir.setText(org.openide.util.NbBundle.getMessage(CustomizerJar.class, "LBL_CustomizeJar_BrowseDistDir_JButton")); - jButtonDistDir.setEnabled(false); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 12); - add(jButtonDistDir, gridBagConstraints); - jLabel2.setText(org.openide.util.NbBundle.getMessage(CustomizerJar.class, "LBL_CustomizeJar_Excludes_JTextField")); gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 12); gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.insets = new java.awt.Insets(12, 12, 12, 12); add(jLabel2, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 1; + gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12); gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(12, 0, 12, 12); add(jTextFieldExcludes, gridBagConstraints); jCheckBoxCommpress.setText(org.openide.util.NbBundle.getMessage(CustomizerJar.class, "LBL_CustomizeJar_Commpres_JCheckBox")); @@ -116,16 +109,15 @@ gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 12); gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weighty = 1.0; - gridBagConstraints.insets = new java.awt.Insets(12, 12, 12, 12); add(jCheckBoxCommpress, gridBagConstraints); }//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton jButtonDistDir; private javax.swing.JCheckBox jCheckBoxCommpress; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabelDistDir; Index: src/org/netbeans/modules/java/j2seproject/ui/customizer/VisualPropertySupport.java =================================================================== RCS file: /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/VisualPropertySupport.java,v retrieving revision 1.3 diff -u -r1.3 VisualPropertySupport.java --- src/org/netbeans/modules/java/j2seproject/ui/customizer/VisualPropertySupport.java 25 Apr 2004 23:43:06 -0000 1.3 +++ src/org/netbeans/modules/java/j2seproject/ui/customizer/VisualPropertySupport.java 21 May 2004 16:47:28 -0000 @@ -28,6 +28,7 @@ import javax.swing.event.ListDataListener; import javax.swing.text.BadLocationException; import javax.swing.text.Document; +import org.netbeans.modules.java.j2seproject.J2SEProjectUtil; /** Class which makes creation of the GUI easier. Registers JComponent * property names and handles reading/storing the values from the components @@ -147,14 +148,19 @@ private Object getAsType( String propertyName, Class expectedType, boolean throwException ) { - Object value = j2seProperties.get( propertyName ); + Object value; + if (expectedType.equals (String.class)) { + value = J2SEProjectUtil.getEvaluatedProperty (j2seProperties.getProject (), propertyName); + } else { + value = j2seProperties.get( propertyName ); + } if ( value == null || expectedType.isInstance( value ) ) { return value; } else if ( throwException ) { throw new IllegalArgumentException( "Value of property: " + propertyName + // NOI18N - " exbected to be: " + expectedType.getName() + // NOI18N + " expected to be: " + expectedType.getName() + // NOI18N " but was: " + value.getClass().getName() + "!" ); // NOI18N } else {