Index: org/netbeans/modules/xml/catalog/CatalogMounterPanel.form =================================================================== RCS file: /cvs/xml/catalog/src/org/netbeans/modules/xml/catalog/CatalogMounterPanel.form,v retrieving revision 1.4 diff -u -b -r1.4 CatalogMounterPanel.form --- org/netbeans/modules/xml/catalog/CatalogMounterPanel.form 12 Mar 2002 14:38:45 -0000 1.4 +++ org/netbeans/modules/xml/catalog/CatalogMounterPanel.form 17 Jun 2003 08:09:54 -0000 @@ -7,16 +7,13 @@ - - - - - - + + + @@ -25,9 +22,6 @@ - - - @@ -39,6 +33,11 @@ + + + + + Index: org/netbeans/modules/xml/catalog/CatalogMounterPanel.java =================================================================== RCS file: /cvs/xml/catalog/src/org/netbeans/modules/xml/catalog/CatalogMounterPanel.java,v retrieving revision 1.5 diff -u -b -r1.5 CatalogMounterPanel.java --- org/netbeans/modules/xml/catalog/CatalogMounterPanel.java 12 Mar 2002 14:38:45 -0000 1.5 +++ org/netbeans/modules/xml/catalog/CatalogMounterPanel.java 17 Jun 2003 08:09:54 -0000 @@ -43,6 +43,15 @@ model.addChangeListener(this); } + /** + * Compute preffered dimension for combo with + * particulal number of columns + */ + private Dimension comboSize(int columns) { + JTextField template = new JTextField(); + template.setColumns(columns); + return template.getPreferredSize(); + } /** This method is called from within the constructor to @@ -60,16 +69,15 @@ setLayout(new java.awt.GridBagLayout()); setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(4, 4, 4, 4))); - setPreferredSize(new java.awt.Dimension(380, 100)); setMinimumSize(new java.awt.Dimension(380, 100)); catalogLabel.setText(Util.THIS.getString ("CatalogMounterPanel.catalogLabel.text")); - catalogLabel.setForeground(java.awt.Color.black); catalogLabel.setLabelFor(catalogComboBox); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 0); add(catalogLabel, gridBagConstraints); + catalogComboBox.setPreferredSize(comboSize(40)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; @@ -84,9 +92,9 @@ gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 11); gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; + gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 11); add(parentPanel, gridBagConstraints); }//GEN-END:initComponents @@ -94,14 +102,15 @@ private void updateCatalogPanel() { Customizer cust = model.getCatalogCustomizer(); cust.setObject(model.getCatalog()); + invalidate(); parentPanel.removeAll(); Component catalogPanel = (Component) cust; parentPanel.add(catalogPanel, BorderLayout.CENTER); + validate(); } public void stateChanged(ChangeEvent e) { updateCatalogPanel(); - revalidate(); } // Variables declaration - do not modify//GEN-BEGIN:variables Index: org/netbeans/modules/xml/catalog/CatalogRootNode.java =================================================================== RCS file: /cvs/xml/catalog/src/org/netbeans/modules/xml/catalog/CatalogRootNode.java,v retrieving revision 1.15 diff -u -b -r1.15 CatalogRootNode.java --- org/netbeans/modules/xml/catalog/CatalogRootNode.java 27 Feb 2003 23:45:34 -0000 1.15 +++ org/netbeans/modules/xml/catalog/CatalogRootNode.java 17 Jun 2003 08:09:55 -0000 @@ -32,6 +32,7 @@ import org.netbeans.modules.xml.catalog.settings.CatalogSettings; import org.openide.util.HelpCtx; import java.awt.event.ActionEvent; +import javax.swing.*; /** * Node representing catalog root in the Runtime tab. It retrieves all @@ -103,7 +104,23 @@ // } // }); - myDialog.setSize(450, 250); //^ packing never creates bigger window :-( + // set dialog size to 60x10 characters + JTextArea template = new JTextArea(); + template.setColumns(60); + template.setRows(8 + 2); // 8 lines, 2 bottom line with buttons + Dimension dimension = template.getPreferredSize(); + + //#33996 this is insets size as prescribed by UI guidelines + final int insets = 12; + + // small fonts have problems that insets are times more important + // then font size, include also insets + int heightInsets = dimension.height + 10 * insets; // 10 lines * 12 inset size + int widthInsets = dimension.width + 4 * insets; + Dimension fullDimension = new Dimension(widthInsets, heightInsets); + myDialog.setSize(fullDimension); //^ packing never creates bigger window :-( + + myDialog.show(); } Index: org/netbeans/modules/xml/catalog/impl/SystemCatalogCustomizer.form =================================================================== RCS file: /cvs/xml/catalog/src/org/netbeans/modules/xml/catalog/impl/SystemCatalogCustomizer.form,v retrieving revision 1.5 diff -u -b -r1.5 SystemCatalogCustomizer.form --- org/netbeans/modules/xml/catalog/impl/SystemCatalogCustomizer.form 12 Mar 2002 14:38:46 -0000 1.5 +++ org/netbeans/modules/xml/catalog/impl/SystemCatalogCustomizer.form 17 Jun 2003 08:09:55 -0000 @@ -1,39 +1,37 @@
- - - + + + - - + - - - + + + + + - - - - - - + + + + - Index: org/netbeans/modules/xml/catalog/impl/SystemCatalogCustomizer.java =================================================================== RCS file: /cvs/xml/catalog/src/org/netbeans/modules/xml/catalog/impl/SystemCatalogCustomizer.java,v retrieving revision 1.5 diff -u -b -r1.5 SystemCatalogCustomizer.java --- org/netbeans/modules/xml/catalog/impl/SystemCatalogCustomizer.java 12 Mar 2002 14:38:46 -0000 1.5 +++ org/netbeans/modules/xml/catalog/impl/SystemCatalogCustomizer.java 17 Jun 2003 08:09:55 -0000 @@ -48,15 +48,16 @@ setLayout(new java.awt.GridBagLayout()); - jTextArea1.setWrapStyleWord(true); - jTextArea1.setLineWrap(true); + jTextArea1.setColumns(40); jTextArea1.setEditable(false); - jTextArea1.setForeground(new java.awt.Color(102, 102, 153)); jTextArea1.setFont(javax.swing.UIManager.getFont ("Label.font")); + jTextArea1.setForeground(new java.awt.Color(102, 102, 153)); + jTextArea1.setLineWrap(true); + jTextArea1.setRows(4); jTextArea1.setText(Util.THIS.getString ("SystemCatalogCustomizer.readOnly.text")); - jTextArea1.setDisabledTextColor(javax.swing.UIManager.getColor ("Label.foreground")); - jTextArea1.setPreferredSize(new java.awt.Dimension(300, 50)); + jTextArea1.setWrapStyleWord(true); jTextArea1.setBorder(null); + jTextArea1.setDisabledTextColor(javax.swing.UIManager.getColor ("Label.foreground")); jTextArea1.setEnabled(false); jTextArea1.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); Index: org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.form =================================================================== RCS file: /cvs/xml/catalog/src/org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.form,v retrieving revision 1.5 diff -u -b -r1.5 XCatalogCustomizer.form --- org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.form 12 Mar 2002 14:38:46 -0000 1.5 +++ org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.form 17 Jun 2003 08:09:55 -0000 @@ -1,9 +1,9 @@ - - - + + + @@ -12,9 +12,6 @@ - - - @@ -28,11 +25,7 @@ - - - - Index: org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.java =================================================================== RCS file: /cvs/xml/catalog/src/org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.java,v retrieving revision 1.6 diff -u -b -r1.6 XCatalogCustomizer.java --- org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.java 22 Mar 2002 17:30:54 -0000 1.6 +++ org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.java 17 Jun 2003 08:09:55 -0000 @@ -48,26 +48,17 @@ locationTextField = new javax.swing.JTextField(); descTextArea = new javax.swing.JTextArea(); + FormListener formListener = new FormListener(); + setLayout(new java.awt.GridBagLayout()); locationLabel.setText(Util.THIS.getString ("XCatalogCustomizer.locationLabel.text")); - locationLabel.setForeground(java.awt.Color.black); locationLabel.setLabelFor(locationTextField); add(locationLabel, new java.awt.GridBagConstraints()); locationTextField.setColumns(20); - locationTextField.setPreferredSize(new java.awt.Dimension(240, 20)); - locationTextField.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - locationTextFieldActionPerformed(evt); - } - }); - - locationTextField.addFocusListener(new java.awt.event.FocusAdapter() { - public void focusLost(java.awt.event.FocusEvent evt) { - locationTextFieldFocusLost(evt); - } - }); + locationTextField.addActionListener(formListener); + locationTextField.addFocusListener(formListener); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; @@ -95,6 +86,25 @@ gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0); add(descTextArea, gridBagConstraints); + } + + // Code for dispatching events from components to event handlers. + + private class FormListener implements java.awt.event.ActionListener, java.awt.event.FocusListener { + public void actionPerformed(java.awt.event.ActionEvent evt) { + if (evt.getSource() == locationTextField) { + XCatalogCustomizer.this.locationTextFieldActionPerformed(evt); + } + } + + public void focusGained(java.awt.event.FocusEvent evt) { + } + + public void focusLost(java.awt.event.FocusEvent evt) { + if (evt.getSource() == locationTextField) { + XCatalogCustomizer.this.locationTextFieldFocusLost(evt); + } + } }//GEN-END:initComponents //!!! find out whether action performed is not enought @@ -129,8 +139,8 @@ // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextArea descTextArea; - private javax.swing.JTextField locationTextField; private javax.swing.JLabel locationLabel; + private javax.swing.JTextField locationTextField; // End of variables declaration//GEN-END:variables } Index: org/netbeans/modules/xml/catalog/impl/sun/CatalogCustomizer.form =================================================================== RCS file: /cvs/xml/catalog/src/org/netbeans/modules/xml/catalog/impl/sun/CatalogCustomizer.form,v retrieving revision 1.6 diff -u -b -r1.6 CatalogCustomizer.form --- org/netbeans/modules/xml/catalog/impl/sun/CatalogCustomizer.form 10 Apr 2002 13:41:22 -0000 1.6 +++ org/netbeans/modules/xml/catalog/impl/sun/CatalogCustomizer.form 17 Jun 2003 08:09:55 -0000 @@ -1,23 +1,20 @@ - - - + + + - - + + - - - @@ -27,12 +24,8 @@ - - - - + - @@ -49,7 +42,6 @@ - @@ -68,7 +60,6 @@ - @@ -80,6 +71,7 @@ + @@ -88,6 +80,7 @@ + Index: org/netbeans/modules/xml/catalog/impl/sun/CatalogCustomizer.java =================================================================== RCS file: /cvs/xml/catalog/src/org/netbeans/modules/xml/catalog/impl/sun/CatalogCustomizer.java,v retrieving revision 1.7 diff -u -b -r1.7 CatalogCustomizer.java --- org/netbeans/modules/xml/catalog/impl/sun/CatalogCustomizer.java 10 Apr 2002 13:41:22 -0000 1.7 +++ org/netbeans/modules/xml/catalog/impl/sun/CatalogCustomizer.java 17 Jun 2003 08:09:55 -0000 @@ -61,26 +61,17 @@ preferCheckBox = new javax.swing.JCheckBox(); descTextArea = new javax.swing.JTextArea(); + FormListener formListener = new FormListener(); + setLayout(new java.awt.GridBagLayout()); - locationLabel.setForeground(java.awt.Color.black); - locationLabel.setText(Util.THIS.getString ("CatalogCustomizer.locationLabel.text")); locationLabel.setLabelFor(locationTextField); + locationLabel.setText(Util.THIS.getString ("CatalogCustomizer.locationLabel.text")); add(locationLabel, new java.awt.GridBagConstraints()); - locationTextField.setColumns(20); - locationTextField.setPreferredSize(new java.awt.Dimension(220, 20)); - locationTextField.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - locationTextFieldActionPerformed(evt); - } - }); - - locationTextField.addFocusListener(new java.awt.event.FocusAdapter() { - public void focusLost(java.awt.event.FocusEvent evt) { - locationTextFieldFocusLost(evt); - } - }); + locationTextField.setColumns(40); + locationTextField.addActionListener(formListener); + locationTextField.addFocusListener(formListener); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; @@ -89,11 +80,7 @@ add(locationTextField, gridBagConstraints); selectButton.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/xml/catalog/impl/sun/Bundle").getString("PROP_choose_file")); - selectButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - selectButtonActionPerformed(evt); - } - }); + selectButton.addActionListener(formListener); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; @@ -102,11 +89,7 @@ preferCheckBox.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/xml/catalog/impl/sun/Bundle").getString("LBL_preference")); preferCheckBox.setToolTipText(Util.THIS.getString("HINT_pp")); - preferCheckBox.addChangeListener(new javax.swing.event.ChangeListener() { - public void stateChanged(javax.swing.event.ChangeEvent evt) { - preferCheckBoxStateChanged(evt); - } - }); + preferCheckBox.addChangeListener(formListener); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; @@ -116,10 +99,12 @@ gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 11); add(preferCheckBox, gridBagConstraints); + descTextArea.setColumns(40); descTextArea.setEditable(false); descTextArea.setFont(javax.swing.UIManager.getFont ("Label.font")); descTextArea.setForeground(new java.awt.Color(102, 102, 153)); descTextArea.setLineWrap(true); + descTextArea.setRows(4); descTextArea.setText(Util.THIS.getString("DESC_catalog_fmts")); descTextArea.setWrapStyleWord(true); descTextArea.setDisabledTextColor(javax.swing.UIManager.getColor ("Label.foreground")); @@ -134,6 +119,34 @@ gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0); add(descTextArea, gridBagConstraints); + } + + // Code for dispatching events from components to event handlers. + + private class FormListener implements java.awt.event.ActionListener, java.awt.event.FocusListener, javax.swing.event.ChangeListener { + public void actionPerformed(java.awt.event.ActionEvent evt) { + if (evt.getSource() == locationTextField) { + CatalogCustomizer.this.locationTextFieldActionPerformed(evt); + } + else if (evt.getSource() == selectButton) { + CatalogCustomizer.this.selectButtonActionPerformed(evt); + } + } + + public void focusGained(java.awt.event.FocusEvent evt) { + } + + public void focusLost(java.awt.event.FocusEvent evt) { + if (evt.getSource() == locationTextField) { + CatalogCustomizer.this.locationTextFieldFocusLost(evt); + } + } + + public void stateChanged(javax.swing.event.ChangeEvent evt) { + if (evt.getSource() == preferCheckBox) { + CatalogCustomizer.this.preferCheckBoxStateChanged(evt); + } + } }//GEN-END:initComponents private void selectButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectButtonActionPerformed @@ -184,11 +197,11 @@ } // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JTextArea descTextArea; private javax.swing.JLabel locationLabel; private javax.swing.JTextField locationTextField; private javax.swing.JCheckBox preferCheckBox; private javax.swing.JButton selectButton; - private javax.swing.JTextArea descTextArea; // End of variables declaration//GEN-END:variables }