/** * Returns the number of rows in the model. A <code>JTable</code> uses this method to determine * how many rows it should display. This method should be quick, as it is called frequently * during rendering. * * @return the number of rows in the model * @see #getColumnCount */ public int getRowCount() { if (globalAuthenticationStore == null) { return 0; } final String[] strings = globalAuthenticationStore.getKnownURLs(); return strings.length; }
/** * Returns the value for the cell at <code>columnIndex</code> and <code>rowIndex</code>. * * @param rowIndex the row whose value is to be queried * @param columnIndex the column whose value is to be queried * @return the value Object at the specified cell */ public Object getValueAt(final int rowIndex, final int columnIndex) { if (globalAuthenticationStore == null) { return null; } final String[] strings = globalAuthenticationStore.getKnownURLs(); if (rowIndex >= strings.length) { return null; } final String url = strings[rowIndex]; if (columnIndex == 0) { return (url); } else if (columnIndex == 1) { return globalAuthenticationStore.getUsername(url); } else if (columnIndex == 2) { return globalAuthenticationStore.getPassword(url); } return null; }