public class UrlLinkDisplay
{
- private String id; // id is not supplied to display, but used to identify
- // entries when saved
+ // column positions
+ public static final int DATABASE = 0;
- private boolean isPrimary;
+ public static final int NAME = 1;
- private boolean isSelected;
+ public static final int URL = 2;
- private UrlLink link;
+ public static final int SELECTED = 3;
+
+ public static final int PRIMARY = 4;
+
+ public static final int ID = 5;
// Headers for columns in table
- private final static List<String> colNames = new ArrayList<String>()
+ @SuppressWarnings("serial")
+ private static final List<String> COLNAMES = new ArrayList<String>()
{
{
add(MessageManager.formatMessage("label.database"));
}
};
- // column positions
- public final static int DATABASE = 0;
-
- public final static int NAME = 1;
-
- public final static int URL = 2;
+ private String id; // id is not supplied to display, but used to identify
+ // entries when saved
- public final static int SELECTED = 3;
+ private boolean isPrimary;
- public final static int PRIMARY = 4;
+ private boolean isSelected;
- public final static int ID = 5;
+ private UrlLink link;
public UrlLinkDisplay(String rowId, UrlLink rowLink,
boolean rowSelected, boolean rowDefault)
break;
case NAME:
setDescription((String) value);
+ break;
case DATABASE:
setDBName((String) value);
break;
// so only allow editing if it is not
return (!link.usesDBAccession());
}
- else if (index == SELECTED)
- {
- return true;
- }
else
{
- return false;
+ return index == SELECTED;
}
}
public static List<String> getDisplayColumnNames()
{
// Display names between DESCRIPTION and ID (excludes ID)
- return colNames.subList(DATABASE, ID);
+ return COLNAMES.subList(DATABASE, ID);
}
}