Index: src/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 --- src/org/netbeans/modules/xml/catalog/CatalogMounterPanel.form 12 Mar 2002 14:38:45 -0000 1.4 +++ src/org/netbeans/modules/xml/catalog/CatalogMounterPanel.form 28 May 2003 13:46:38 -0000 @@ -7,16 +7,13 @@ - - - - - - + + + @@ -25,9 +22,6 @@ - - - @@ -39,6 +33,11 @@ + + + + + Index: src/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 --- src/org/netbeans/modules/xml/catalog/CatalogMounterPanel.java 12 Mar 2002 14:38:45 -0000 1.5 +++ src/org/netbeans/modules/xml/catalog/CatalogMounterPanel.java 28 May 2003 13:46:38 -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: src/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 --- src/org/netbeans/modules/xml/catalog/CatalogRootNode.java 27 Feb 2003 23:45:34 -0000 1.15 +++ src/org/netbeans/modules/xml/catalog/CatalogRootNode.java 28 May 2003 13:46:38 -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: src/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 --- src/org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.form 12 Mar 2002 14:38:46 -0000 1.5 +++ src/org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.form 28 May 2003 13:46:38 -0000 @@ -1,9 +1,9 @@
- - - + + + @@ -12,9 +12,6 @@ - - - @@ -29,10 +26,9 @@ - + - Index: src/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 --- src/org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.java 22 Mar 2002 17:30:54 -0000 1.6 +++ src/org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.java 28 May 2003 13:46:38 -0000 @@ -48,26 +48,18 @@ 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.setPreferredSize(new java.awt.Dimension(220, 20)); + locationTextField.addActionListener(formListener); + locationTextField.addFocusListener(formListener); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; @@ -95,6 +87,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 +140,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 }