Skip to content

Commit

Permalink
Merge pull request #87 from EarlOfEgo/master
Browse files Browse the repository at this point in the history
Display the device name
  • Loading branch information
pbreault authored Jun 10, 2018
2 parents f11b646 + 971170a commit d59d0b4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public Object getValueAt(int rowIndex, int columnIndex) {
IDevice device = myDevices[rowIndex];
switch (columnIndex) {
case DEVICE_NAME_COLUMN_INDEX:
return device;
return generateDeviceName(device);
case SERIAL_COLUMN_INDEX:
return device.getSerialNumber();
case DEVICE_STATE_COLUMN_INDEX:
Expand All @@ -430,6 +430,13 @@ public Object getValueAt(int rowIndex, int columnIndex) {
return null;
}

private String generateDeviceName(IDevice device) {
return device.getName()
.replace(device.getSerialNumber(), "")
.replaceAll("[-_]", " ")
.replaceAll("[\\[\\]]", "");
}

@Override
public Class<?> getColumnClass(int columnIndex) {
if (columnIndex == COMPATIBILITY_COLUMN_INDEX) {
Expand Down

0 comments on commit d59d0b4

Please sign in to comment.