This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 33948
Collapse All | Expand All

(-)src/org/netbeans/modules/xml/catalog/CatalogMounterPanel.form (-9 / +8 lines)
Lines 7-22 Link Here
7
        <EmptyBorder bottom="4" left="4" right="4" top="4"/>
7
        <EmptyBorder bottom="4" left="4" right="4" top="4"/>
8
      </Border>
8
      </Border>
9
    </Property>
9
    </Property>
10
    <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
11
      <Dimension value="[380, 100]"/>
12
    </Property>
13
    <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
10
    <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
14
      <Dimension value="[380, 100]"/>
11
      <Dimension value="[380, 100]"/>
15
    </Property>
12
    </Property>
16
  </Properties>
13
  </Properties>
17
  <SyntheticProperties>
14
  <AuxValues>
18
    <SyntheticProperty name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
15
    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
19
  </SyntheticProperties>
16
  </AuxValues>
20
17
21
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
18
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
22
  <SubComponents>
19
  <SubComponents>
Lines 25-33 Link Here
25
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
22
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
26
          <ResourceString bundle="org/netbeans/modules/xml/catalog/Bundle.properties" key="CatalogMounterPanel.catalogLabel.text" replaceFormat="Util.THIS.getString (&quot;{key}&quot;)"/>
23
          <ResourceString bundle="org/netbeans/modules/xml/catalog/Bundle.properties" key="CatalogMounterPanel.catalogLabel.text" replaceFormat="Util.THIS.getString (&quot;{key}&quot;)"/>
27
        </Property>
24
        </Property>
28
        <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
29
          <Color blue="0" green="0" id="black" palette="1" red="0" type="palette"/>
30
        </Property>
31
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
25
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
32
          <Connection code="catalogComboBox" type="code"/>
26
          <Connection code="catalogComboBox" type="code"/>
33
        </Property>
27
        </Property>
Lines 39-44 Link Here
39
      </Constraints>
33
      </Constraints>
40
    </Component>
34
    </Component>
41
    <Component class="javax.swing.JComboBox" name="catalogComboBox">
35
    <Component class="javax.swing.JComboBox" name="catalogComboBox">
36
      <Properties>
37
        <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
38
          <Connection code="comboSize(40)" type="code"/>
39
        </Property>
40
      </Properties>
42
      <Constraints>
41
      <Constraints>
43
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
42
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
44
          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="12" insetsBottom="0" insetsRight="11" anchor="11" weightX="1.0" weightY="0.0"/>
43
          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="12" insetsBottom="0" insetsRight="11" anchor="11" weightX="1.0" weightY="0.0"/>
(-)src/org/netbeans/modules/xml/catalog/CatalogMounterPanel.java (-4 / +13 lines)
Lines 43-48 Link Here
43
        model.addChangeListener(this);
43
        model.addChangeListener(this);
44
    }
44
    }
45
45
46
    /**
47
     * Compute preffered dimension for combo with
48
     * particulal number of columns
49
     */
50
    private Dimension comboSize(int columns) {
51
        JTextField template = new JTextField();
52
        template.setColumns(columns);
53
        return template.getPreferredSize();
54
    }
46
    
55
    
47
    
56
    
48
    /** This method is called from within the constructor to
57
    /** This method is called from within the constructor to
Lines 60-75 Link Here
60
        setLayout(new java.awt.GridBagLayout());
69
        setLayout(new java.awt.GridBagLayout());
61
70
62
        setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(4, 4, 4, 4)));
71
        setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(4, 4, 4, 4)));
63
        setPreferredSize(new java.awt.Dimension(380, 100));
64
        setMinimumSize(new java.awt.Dimension(380, 100));
72
        setMinimumSize(new java.awt.Dimension(380, 100));
65
        catalogLabel.setText(Util.THIS.getString ("CatalogMounterPanel.catalogLabel.text"));
73
        catalogLabel.setText(Util.THIS.getString ("CatalogMounterPanel.catalogLabel.text"));
66
        catalogLabel.setForeground(java.awt.Color.black);
67
        catalogLabel.setLabelFor(catalogComboBox);
74
        catalogLabel.setLabelFor(catalogComboBox);
68
        gridBagConstraints = new java.awt.GridBagConstraints();
75
        gridBagConstraints = new java.awt.GridBagConstraints();
69
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
76
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
70
        gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 0);
77
        gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 0);
71
        add(catalogLabel, gridBagConstraints);
78
        add(catalogLabel, gridBagConstraints);
72
79
80
        catalogComboBox.setPreferredSize(comboSize(40));
73
        gridBagConstraints = new java.awt.GridBagConstraints();
81
        gridBagConstraints = new java.awt.GridBagConstraints();
74
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
82
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
75
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
83
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
Lines 84-92 Link Here
84
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
92
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
85
        gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
93
        gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
86
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
94
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
87
        gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 11);
88
        gridBagConstraints.weightx = 1.0;
95
        gridBagConstraints.weightx = 1.0;
89
        gridBagConstraints.weighty = 1.0;
96
        gridBagConstraints.weighty = 1.0;
97
        gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 11);
90
        add(parentPanel, gridBagConstraints);
98
        add(parentPanel, gridBagConstraints);
91
99
92
    }//GEN-END:initComponents
100
    }//GEN-END:initComponents
Lines 94-107 Link Here
94
    private void updateCatalogPanel() {
102
    private void updateCatalogPanel() {
95
        Customizer cust = model.getCatalogCustomizer();
103
        Customizer cust = model.getCatalogCustomizer();
96
        cust.setObject(model.getCatalog());
104
        cust.setObject(model.getCatalog());
105
        invalidate();
97
        parentPanel.removeAll();
106
        parentPanel.removeAll();
98
        Component catalogPanel = (Component) cust;
107
        Component catalogPanel = (Component) cust;
99
        parentPanel.add(catalogPanel, BorderLayout.CENTER);
108
        parentPanel.add(catalogPanel, BorderLayout.CENTER);
109
        validate();
100
    }
110
    }
101
    
111
    
102
    public void stateChanged(ChangeEvent e) {
112
    public void stateChanged(ChangeEvent e) {
103
        updateCatalogPanel();
113
        updateCatalogPanel();
104
        revalidate();
105
    }
114
    }
106
115
107
    // Variables declaration - do not modify//GEN-BEGIN:variables
116
    // Variables declaration - do not modify//GEN-BEGIN:variables
(-)src/org/netbeans/modules/xml/catalog/CatalogRootNode.java (-1 / +18 lines)
Lines 32-37 Link Here
32
import org.netbeans.modules.xml.catalog.settings.CatalogSettings;
32
import org.netbeans.modules.xml.catalog.settings.CatalogSettings;
33
import org.openide.util.HelpCtx;
33
import org.openide.util.HelpCtx;
34
import java.awt.event.ActionEvent;
34
import java.awt.event.ActionEvent;
35
import javax.swing.*;
35
36
36
/**
37
/**
37
 * Node representing catalog root in the Runtime tab. It retrieves all
38
 * Node representing catalog root in the Runtime tab. It retrieves all
Lines 103-109 Link Here
103
//                }
104
//                }
104
//            });
105
//            });
105
            
106
            
106
            myDialog.setSize(450, 250);  //^ packing never creates bigger window :-(
107
            // set dialog size to 60x10 characters
108
            JTextArea template = new JTextArea();
109
            template.setColumns(60);
110
            template.setRows(8 + 2);  // 8 lines, 2 bottom line with buttons
111
            Dimension dimension = template.getPreferredSize();
112
            
113
            //#33996 this is insets size as prescribed by UI guidelines            
114
            final int insets = 12;
115
            
116
            // small fonts have problems that insets are times more important
117
            // then font size, include also insets
118
            int heightInsets = dimension.height + 10 * insets;  // 10 lines * 12 inset size
119
            int widthInsets = dimension.width + 4 * insets;
120
            Dimension fullDimension = new Dimension(widthInsets, heightInsets);
121
            myDialog.setSize(fullDimension);  //^ packing never creates bigger window :-(
122
            
123
            
107
            myDialog.show();
124
            myDialog.show();
108
        }
125
        }
109
126
(-)src/org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.form (-8 / +4 lines)
Lines 1-9 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.0" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.0" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <SyntheticProperties>
4
  <AuxValues>
5
    <SyntheticProperty name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
5
    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
6
  </SyntheticProperties>
6
  </AuxValues>
7
7
8
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
8
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
9
  <SubComponents>
9
  <SubComponents>
Lines 12-20 Link Here
12
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
12
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
13
          <ResourceString bundle="org/netbeans/modules/xml/catalog/impl/Bundle.properties" key="XCatalogCustomizer.locationLabel.text" replaceFormat="Util.THIS.getString (&quot;{key}&quot;)"/>
13
          <ResourceString bundle="org/netbeans/modules/xml/catalog/impl/Bundle.properties" key="XCatalogCustomizer.locationLabel.text" replaceFormat="Util.THIS.getString (&quot;{key}&quot;)"/>
14
        </Property>
14
        </Property>
15
        <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
16
          <Color blue="0" green="0" id="black" palette="1" red="0" type="palette"/>
17
        </Property>
18
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
15
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
19
          <Connection code="locationTextField" type="code"/>
16
          <Connection code="locationTextField" type="code"/>
20
        </Property>
17
        </Property>
Lines 29-38 Link Here
29
      <Properties>
26
      <Properties>
30
        <Property name="columns" type="int" value="20"/>
27
        <Property name="columns" type="int" value="20"/>
31
        <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
28
        <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
32
          <Dimension value="[240, 20]"/>
29
          <Dimension value="[220, 20]"/>
33
        </Property>
30
        </Property>
34
      </Properties>
31
      </Properties>
35
36
      <Events>
32
      <Events>
37
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="locationTextFieldActionPerformed"/>
33
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="locationTextFieldActionPerformed"/>
38
        <EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="locationTextFieldFocusLost"/>
34
        <EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="locationTextFieldFocusLost"/>
(-)src/org/netbeans/modules/xml/catalog/impl/XCatalogCustomizer.java (-14 / +25 lines)
Lines 48-73 Link Here
48
        locationTextField = new javax.swing.JTextField();
48
        locationTextField = new javax.swing.JTextField();
49
        descTextArea = new javax.swing.JTextArea();
49
        descTextArea = new javax.swing.JTextArea();
50
50
51
        FormListener formListener = new FormListener();
52
51
        setLayout(new java.awt.GridBagLayout());
53
        setLayout(new java.awt.GridBagLayout());
52
54
53
        locationLabel.setText(Util.THIS.getString ("XCatalogCustomizer.locationLabel.text"));
55
        locationLabel.setText(Util.THIS.getString ("XCatalogCustomizer.locationLabel.text"));
54
        locationLabel.setForeground(java.awt.Color.black);
55
        locationLabel.setLabelFor(locationTextField);
56
        locationLabel.setLabelFor(locationTextField);
56
        add(locationLabel, new java.awt.GridBagConstraints());
57
        add(locationLabel, new java.awt.GridBagConstraints());
57
58
58
        locationTextField.setColumns(20);
59
        locationTextField.setColumns(20);
59
        locationTextField.setPreferredSize(new java.awt.Dimension(240, 20));
60
        locationTextField.setPreferredSize(new java.awt.Dimension(220, 20));
60
        locationTextField.addActionListener(new java.awt.event.ActionListener() {
61
        locationTextField.addActionListener(formListener);
61
            public void actionPerformed(java.awt.event.ActionEvent evt) {
62
        locationTextField.addFocusListener(formListener);
62
                locationTextFieldActionPerformed(evt);
63
            }
64
        });
65
66
        locationTextField.addFocusListener(new java.awt.event.FocusAdapter() {
67
            public void focusLost(java.awt.event.FocusEvent evt) {
68
                locationTextFieldFocusLost(evt);
69
            }
70
        });
71
63
72
        gridBagConstraints = new java.awt.GridBagConstraints();
64
        gridBagConstraints = new java.awt.GridBagConstraints();
73
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
65
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
Lines 95-100 Link Here
95
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
87
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
96
        add(descTextArea, gridBagConstraints);
88
        add(descTextArea, gridBagConstraints);
97
89
90
    }
91
92
    // Code for dispatching events from components to event handlers.
93
94
    private class FormListener implements java.awt.event.ActionListener, java.awt.event.FocusListener {
95
        public void actionPerformed(java.awt.event.ActionEvent evt) {
96
            if (evt.getSource() == locationTextField) {
97
                XCatalogCustomizer.this.locationTextFieldActionPerformed(evt);
98
            }
99
        }
100
101
        public void focusGained(java.awt.event.FocusEvent evt) {
102
        }
103
104
        public void focusLost(java.awt.event.FocusEvent evt) {
105
            if (evt.getSource() == locationTextField) {
106
                XCatalogCustomizer.this.locationTextFieldFocusLost(evt);
107
            }
108
        }
98
    }//GEN-END:initComponents
109
    }//GEN-END:initComponents
99
110
100
    //!!! find out whether action performed is not enought
111
    //!!! find out whether action performed is not enought
Lines 129-136 Link Here
129
    
140
    
130
    // Variables declaration - do not modify//GEN-BEGIN:variables
141
    // Variables declaration - do not modify//GEN-BEGIN:variables
131
    private javax.swing.JTextArea descTextArea;
142
    private javax.swing.JTextArea descTextArea;
132
    private javax.swing.JTextField locationTextField;
133
    private javax.swing.JLabel locationLabel;
143
    private javax.swing.JLabel locationLabel;
144
    private javax.swing.JTextField locationTextField;
134
    // End of variables declaration//GEN-END:variables
145
    // End of variables declaration//GEN-END:variables
135
146
136
}
147
}

Return to bug 33948