4655 ensure table with artifact counts can not be modified

This commit is contained in:
William Schaefer 2019-01-29 18:37:13 -05:00
parent 0faa8d826c
commit a4ff37a3b3
2 changed files with 13 additions and 3 deletions

View File

@ -124,10 +124,11 @@
<SubComponents> <SubComponents>
<Component class="javax.swing.JTable" name="artifactCountsTable"> <Component class="javax.swing.JTable" name="artifactCountsTable">
<Properties> <Properties>
<Property name="autoCreateRowSorter" type="boolean" value="true"/>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="2" rowCount="0"> <Table columnCount="2" rowCount="0">
<Column editable="true" title="Result Type" type="java.lang.Object"/> <Column editable="false" title="Result Type" type="java.lang.Object"/>
<Column editable="true" title="Count" type="java.lang.Object"/> <Column editable="false" title="Count" type="java.lang.Object"/>
</Table> </Table>
</Property> </Property>
</Properties> </Properties>

View File

@ -130,6 +130,7 @@ class DataSourceSummaryCountsPanel extends javax.swing.JPanel {
org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(DataSourceSummaryCountsPanel.class, "DataSourceSummaryCountsPanel.jLabel1.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(DataSourceSummaryCountsPanel.class, "DataSourceSummaryCountsPanel.jLabel1.text")); // NOI18N
artifactCountsTable.setAutoCreateRowSorter(true);
artifactCountsTable.setModel(new javax.swing.table.DefaultTableModel( artifactCountsTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] { new Object [][] {
@ -137,7 +138,15 @@ class DataSourceSummaryCountsPanel extends javax.swing.JPanel {
new String [] { new String [] {
"Result Type", "Count" "Result Type", "Count"
} }
)); ) {
boolean[] canEdit = new boolean [] {
false, false
};
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
artifactCountsScrollPane.setViewportView(artifactCountsTable); artifactCountsScrollPane.setViewportView(artifactCountsTable);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);