Skip to content

Commit b2486b2

Browse files
cmaglielmihalkovic
authored andcommitted
Removed useless DESCRIPTION_COL constant
1 parent acdf174 commit b2486b2

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

app/src/cc/arduino/contributions/libraries/ui/LibrariesIndexTableModel.java

+3-9
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
@SuppressWarnings("serial")
4444
public class LibrariesIndexTableModel extends FilteredAbstractTableModel<ContributedLibrary> {
4545

46-
public final static int DESCRIPTION_COL = 0;
4746

4847
private final List<ContributedLibraryReleases> contributions = new ArrayList<>();
4948

@@ -120,9 +119,7 @@ public Class<?> getColumnClass(int colum) {
120119

121120
@Override
122121
public void setValueAt(Object value, int row, int col) {
123-
if (col == DESCRIPTION_COL) {
124-
fireTableCellUpdated(row, col);
125-
}
122+
fireTableCellUpdated(row, col);
126123
}
127124

128125
@Override
@@ -131,15 +128,12 @@ public Object getValueAt(int row, int col) {
131128
return null;
132129
}
133130
ContributedLibraryReleases contribution = contributions.get(row);
134-
if (col == DESCRIPTION_COL) {
135-
return contribution;// .getSelected();
136-
}
137-
return null;
131+
return contribution;// .getSelected();
138132
}
139133

140134
@Override
141135
public boolean isCellEditable(int row, int col) {
142-
return col == DESCRIPTION_COL;
136+
return true;
143137
}
144138

145139
public ContributedLibraryReleases getReleases(int row) {

app/src/cc/arduino/contributions/packages/ui/ContributionIndexTableModel.java

+3-10
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
@SuppressWarnings("serial")
4949
public class ContributionIndexTableModel extends FilteredAbstractTableModel<ContributedPlatform> {
5050

51-
public final static int DESCRIPTION_COL = 0;
52-
5351
public static class ContributedPlatformReleases {
5452
public final ContributedPackage packager;
5553
public final String arch;
@@ -184,9 +182,7 @@ public Class<?> getColumnClass(int colum) {
184182

185183
@Override
186184
public void setValueAt(Object value, int row, int col) {
187-
if (col == DESCRIPTION_COL) {
188-
fireTableCellUpdated(row, col);
189-
}
185+
fireTableCellUpdated(row, col);
190186
}
191187

192188
@Override
@@ -195,15 +191,12 @@ public Object getValueAt(int row, int col) {
195191
return null;
196192
}
197193
ContributedPlatformReleases contribution = contributions.get(row);
198-
if (col == DESCRIPTION_COL) {
199-
return contribution;// .getSelected();
200-
}
201-
return null;
194+
return contribution;// .getSelected();
202195
}
203196

204197
@Override
205198
public boolean isCellEditable(int row, int col) {
206-
return col == DESCRIPTION_COL;
199+
return true;
207200
}
208201

209202
public ContributedPlatformReleases getReleases(int row) {

app/src/cc/arduino/contributions/ui/InstallerJDialog.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
package cc.arduino.contributions.ui;
3131

32-
import static cc.arduino.contributions.packages.ui.ContributionIndexTableModel.DESCRIPTION_COL;
3332
import static processing.app.I18n.tr;
3433

3534
import java.awt.BorderLayout;
@@ -165,7 +164,7 @@ public void keyReleased(KeyEvent keyEvent) {
165164

166165
{
167166
TableColumnModel tcm = contribTable.getColumnModel();
168-
TableColumn col = tcm.getColumn(DESCRIPTION_COL);
167+
TableColumn col = tcm.getColumn(0);
169168
col.setCellRenderer(createCellRenderer());
170169
col.setCellEditor(createCellEditor());
171170
col.setResizable(true);

0 commit comments

Comments
 (0)