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 153330
Collapse All | Expand All

(-)a/i18n/manifest.mf (-1 / +1 lines)
Lines 1-7 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.i18n/1
2
OpenIDE-Module: org.netbeans.modules.i18n/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/i18n/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/i18n/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.25
4
OpenIDE-Module-Specification-Version: 1.26
5
OpenIDE-Module-Layer: org/netbeans/modules/i18n/Layer.xml
5
OpenIDE-Module-Layer: org/netbeans/modules/i18n/Layer.xml
6
AutoUpdate-Show-In-Client: false
6
AutoUpdate-Show-In-Client: false
7
7
(-)a/i18n/src/org/netbeans/modules/i18n/wizard/HardStringWizardPanel.form (-12 / +48 lines)
Lines 1-8 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.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AuxValues>
4
  <AuxValues>
5
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
5
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
6
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
7
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
6
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
8
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
7
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
9
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
8
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
10
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
Lines 54-84 Link Here
54
      </AuxValues>
56
      </AuxValues>
55
      <Constraints>
57
      <Constraints>
56
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
58
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
57
          <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="11" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
59
          <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="11" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
58
        </Constraint>
60
        </Constraint>
59
      </Constraints>
61
      </Constraints>
60
    </Component>
62
    </Component>
61
    <Container class="javax.swing.JScrollPane" name="scrollPane">
63
    <Container class="javax.swing.JSplitPane" name="jSplitPane1">
62
      <Properties>
64
      <Properties>
63
        <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
65
        <Property name="orientation" type="int" value="0"/>
64
          <Dimension value="[100, 100]"/>
66
        <Property name="resizeWeight" type="double" value="0.5"/>
65
        </Property>
66
      </Properties>
67
      </Properties>
67
      <Constraints>
68
      <Constraints>
68
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
69
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
69
          <GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
70
          <GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
70
        </Constraint>
71
        </Constraint>
71
      </Constraints>
72
      </Constraints>
72
73
73
      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
74
      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
74
      <SubComponents>
75
      <SubComponents>
75
        <Component class="javax.swing.JTable" name="hardStringTable">
76
        <Container class="javax.swing.JScrollPane" name="scrollPane">
76
          <Properties>
77
          <Properties>
77
            <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
78
            <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
78
              <Connection code="tableModel" type="code"/>
79
              <Dimension value="[100, 100]"/>
79
            </Property>
80
            </Property>
80
          </Properties>
81
          </Properties>
81
        </Component>
82
          <Constraints>
83
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
84
              <JSplitPaneConstraints position="left"/>
85
            </Constraint>
86
          </Constraints>
87
88
          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
89
          <SubComponents>
90
            <Component class="javax.swing.JTable" name="hardStringTable">
91
              <Properties>
92
                <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
93
                  <Connection code="tableModel" type="code"/>
94
                </Property>
95
              </Properties>
96
            </Component>
97
          </SubComponents>
98
        </Container>
99
        <Container class="javax.swing.JScrollPane" name="jScrollPane1">
100
          <AuxValues>
101
            <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
102
          </AuxValues>
103
          <Constraints>
104
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
105
              <JSplitPaneConstraints position="right"/>
106
            </Constraint>
107
          </Constraints>
108
109
          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
110
          <SubComponents>
111
            <Component class="javax.swing.JEditorPane" name="preview">
112
              <Properties>
113
                <Property name="editable" type="boolean" value="false"/>
114
              </Properties>
115
            </Component>
116
          </SubComponents>
117
        </Container>
82
      </SubComponents>
118
      </SubComponents>
83
    </Container>
119
    </Container>
84
  </SubComponents>
120
  </SubComponents>
(-)a/i18n/src/org/netbeans/modules/i18n/wizard/HardStringWizardPanel.java (-5 / +55 lines)
Lines 65-74 Link Here
65
import javax.swing.JPanel;
65
import javax.swing.JPanel;
66
import javax.swing.JTable;
66
import javax.swing.JTable;
67
import javax.swing.JTextField;
67
import javax.swing.JTextField;
68
import javax.swing.event.ListSelectionEvent;
68
import javax.swing.table.AbstractTableModel;
69
import javax.swing.table.AbstractTableModel;
69
import javax.swing.table.DefaultTableCellRenderer;
70
import javax.swing.table.DefaultTableCellRenderer;
70
import javax.swing.table.TableCellEditor;
71
import javax.swing.table.TableCellEditor;
71
import javax.swing.AbstractCellEditor;
72
import javax.swing.AbstractCellEditor;
73
import javax.swing.event.ListSelectionListener;
74
import javax.swing.text.Document;
75
import javax.swing.text.Position;
72
import org.netbeans.api.java.classpath.ClassPath;
76
import org.netbeans.api.java.classpath.ClassPath;
73
77
74
import org.netbeans.modules.i18n.HardCodedString;
78
import org.netbeans.modules.i18n.HardCodedString;
Lines 98-104 Link Here
98
 * @author  Marian Petras
102
 * @author  Marian Petras
99
 * @see Panel
103
 * @see Panel
100
 */
104
 */
101
final class HardStringWizardPanel extends JPanel {
105
final class HardStringWizardPanel extends JPanel implements ListSelectionListener {
102
106
103
    /** Column index of check box column. */
107
    /** Column index of check box column. */
104
    private static final int COLUMN_INDEX_CHECK = 0;
108
    private static final int COLUMN_INDEX_CHECK = 0;
Lines 129-146 Link Here
129
        initAccessibility();
133
        initAccessibility();
130
    }
134
    }
131
135
136
    @Override
137
    public void doLayout() {
138
        super.doLayout();
139
        jSplitPane1.setDividerLocation(0.5D);
140
    }
141
132
    
142
    
133
    /** Sets combo model only for source which were some found strings in. */
143
    /** Sets combo model only for source which were some found strings in. */
134
    private void setComboModel(Map<DataObject,SourceData> sourceMap) {
144
    private void setComboModel(Map<DataObject,SourceData> sourceMap) {
135
        List<DataObject> nonEmptySources = new ArrayList<DataObject>();
145
        List<DataObject> nonEmptySources = new ArrayList<DataObject>();
136
        
146
        String mimeType = null;
137
        for (Map.Entry<DataObject,SourceData> entry : sourceMap.entrySet()) {
147
        for (Map.Entry<DataObject,SourceData> entry : sourceMap.entrySet()) {
138
            if (!entry.getValue().getStringMap().isEmpty()) {
148
            if (!entry.getValue().getStringMap().isEmpty()) {
139
                nonEmptySources.add(entry.getKey());
149
                nonEmptySources.add(entry.getKey());
150
                mimeType = entry.getKey().getPrimaryFile().getMIMEType();
140
            }
151
            }
141
        }
152
        }
142
        
153
        
143
        sourceCombo.setModel(new DefaultComboBoxModel(nonEmptySources.toArray()));
154
        sourceCombo.setModel(new DefaultComboBoxModel(nonEmptySources.toArray()));
155
        if (mimeType != null) {
156
            preview.setContentType(mimeType);
157
        }
158
        sourceComboActionPerformed(null);
144
    }
159
    }
145
    
160
    
146
    /** Adds additional init of components. */
161
    /** Adds additional init of components. */
Lines 279-284 Link Here
279
        // PENDING: Setting the size of columns with check box and  customize button editor.
294
        // PENDING: Setting the size of columns with check box and  customize button editor.
280
        hardStringTable.getColumnModel().getColumn(COLUMN_INDEX_CHECK).setMaxWidth(30);
295
        hardStringTable.getColumnModel().getColumn(COLUMN_INDEX_CHECK).setMaxWidth(30);
281
        hardStringTable.getColumnModel().getColumn(COLUMN_INDEX_CUSTOM).setMaxWidth(30);
296
        hardStringTable.getColumnModel().getColumn(COLUMN_INDEX_CUSTOM).setMaxWidth(30);
297
        hardStringTable.getSelectionModel().addListSelectionListener(this);
282
    }
298
    }
283
    
299
    
284
    private void initAccessibility() {        
300
    private void initAccessibility() {        
Lines 295-309 Link Here
295
     * WARNING: Do NOT modify this code. The content of this method is
311
     * WARNING: Do NOT modify this code. The content of this method is
296
     * always regenerated by the Form Editor.
312
     * always regenerated by the Form Editor.
297
     */
313
     */
298
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
314
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
299
    private void initComponents() {
315
    private void initComponents() {
300
        java.awt.GridBagConstraints gridBagConstraints;
316
        java.awt.GridBagConstraints gridBagConstraints;
301
317
302
        sourceLabel = new javax.swing.JLabel();
318
        sourceLabel = new javax.swing.JLabel();
303
        sourceCombo = new javax.swing.JComboBox();
319
        sourceCombo = new javax.swing.JComboBox();
304
        hardStringLabel = new javax.swing.JLabel();
320
        hardStringLabel = new javax.swing.JLabel();
321
        jSplitPane1 = new javax.swing.JSplitPane();
305
        scrollPane = new javax.swing.JScrollPane();
322
        scrollPane = new javax.swing.JScrollPane();
306
        hardStringTable = new javax.swing.JTable();
323
        hardStringTable = new javax.swing.JTable();
324
        jScrollPane1 = new javax.swing.JScrollPane();
325
        preview = new javax.swing.JEditorPane();
307
326
308
        setLayout(new java.awt.GridBagLayout());
327
        setLayout(new java.awt.GridBagLayout());
309
328
Lines 330-343 Link Here
330
        gridBagConstraints = new java.awt.GridBagConstraints();
349
        gridBagConstraints = new java.awt.GridBagConstraints();
331
        gridBagConstraints.gridx = 0;
350
        gridBagConstraints.gridx = 0;
332
        gridBagConstraints.gridy = 2;
351
        gridBagConstraints.gridy = 2;
352
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
333
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
353
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
334
        gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 0);
354
        gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 0);
335
        add(hardStringLabel, gridBagConstraints);
355
        add(hardStringLabel, gridBagConstraints);
356
357
        jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
358
        jSplitPane1.setResizeWeight(0.5);
336
359
337
        scrollPane.setPreferredSize(new java.awt.Dimension(100, 100));
360
        scrollPane.setPreferredSize(new java.awt.Dimension(100, 100));
338
361
339
        hardStringTable.setModel(tableModel);
362
        hardStringTable.setModel(tableModel);
340
        scrollPane.setViewportView(hardStringTable);
363
        scrollPane.setViewportView(hardStringTable);
364
365
        jSplitPane1.setLeftComponent(scrollPane);
366
367
        preview.setEditable(false);
368
        jScrollPane1.setViewportView(preview);
369
370
        jSplitPane1.setRightComponent(jScrollPane1);
341
371
342
        gridBagConstraints = new java.awt.GridBagConstraints();
372
        gridBagConstraints = new java.awt.GridBagConstraints();
343
        gridBagConstraints.gridx = 0;
373
        gridBagConstraints.gridx = 0;
Lines 345-352 Link Here
345
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
375
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
346
        gridBagConstraints.weightx = 1.0;
376
        gridBagConstraints.weightx = 1.0;
347
        gridBagConstraints.weighty = 1.0;
377
        gridBagConstraints.weighty = 1.0;
348
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0);
378
        add(jSplitPane1, gridBagConstraints);
349
        add(scrollPane, gridBagConstraints);
350
    }// </editor-fold>//GEN-END:initComponents
379
    }// </editor-fold>//GEN-END:initComponents
351
380
352
    private void sourceComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sourceComboActionPerformed
381
    private void sourceComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sourceComboActionPerformed
Lines 359-373 Link Here
359
            scrollPane.setViewportView(hardStringTable);
388
            scrollPane.setViewportView(hardStringTable);
360
            tableModel.fireTableDataChanged();
389
            tableModel.fireTableDataChanged();
361
        }
390
        }
391
        SourceData data = sourceMap.get(sourceCombo.getSelectedItem());
392
        Document doc = data.getSupport().getDocument();
393
        preview.setDocument(doc);
362
    }//GEN-LAST:event_sourceComboActionPerformed
394
    }//GEN-LAST:event_sourceComboActionPerformed
363
395
364
    // Variables declaration - do not modify//GEN-BEGIN:variables
396
    // Variables declaration - do not modify//GEN-BEGIN:variables
365
    private javax.swing.JLabel hardStringLabel;
397
    private javax.swing.JLabel hardStringLabel;
366
    private javax.swing.JTable hardStringTable;
398
    private javax.swing.JTable hardStringTable;
399
    private javax.swing.JScrollPane jScrollPane1;
400
    private javax.swing.JSplitPane jSplitPane1;
401
    private javax.swing.JEditorPane preview;
367
    private javax.swing.JScrollPane scrollPane;
402
    private javax.swing.JScrollPane scrollPane;
368
    private javax.swing.JComboBox sourceCombo;
403
    private javax.swing.JComboBox sourceCombo;
369
    private javax.swing.JLabel sourceLabel;
404
    private javax.swing.JLabel sourceLabel;
370
    // End of variables declaration//GEN-END:variables
405
    // End of variables declaration//GEN-END:variables
406
407
    public void valueChanged(ListSelectionEvent e) {
408
        int ix = hardStringTable.getSelectedRow();
409
        if (ix >= 0) {
410
            Object o = hardStringTable.getModel().getValueAt (ix, COLUMN_INDEX_HARDSTRING);
411
            if (o instanceof HardCodedString) {
412
                HardCodedString hard = (HardCodedString) o;
413
                Position start = hard.getStartPosition();
414
                Position end = hard.getEndPosition();
415
                preview.setSelectionStart (start.getOffset());
416
                preview.setSelectionEnd(end.getOffset());
417
            }
418
        }
419
    }
420
    // End of variables declaration
371
421
372
    /** Table model for this class. */
422
    /** Table model for this class. */
373
    private class HardCodedStringTableModel extends AbstractTableModel {
423
    private class HardCodedStringTableModel extends AbstractTableModel {

Return to bug 153330