AbstractIndexTableModel.java revision 2dc073d0f37048372498e13ffe84455896bac945
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* Table Model used to store information about indexes. It is used basically
* by the tables that appear on the right side of the 'Manage Indexes...'
* dialog when the user clicks on 'Indexes' or 'VLV Indexes'.
*
*/
public abstract class AbstractIndexTableModel extends SortableTableModel
implements Comparator<AbstractIndexDescriptor>
{
private static final long serialVersionUID = -5131878622200568636L;
/**
* The sort column of the table.
*/
protected int sortColumn;
/**
* Whether the sorting is ascending or descending.
*/
protected boolean sortAscending = true;
private ControlPanelInfo info;
/**
* Sets the data for this table model.
* @param newData the data for this table model.
* @param info the control panel info.
*/
{
}
/**
* Updates the table model contents and sorts its contents depending on the
* sort options set by the user.
*/
public void forceResort()
{
}
/** {@inheritDoc} */
public int getColumnCount()
{
return COLUMN_NAMES.length;
}
/** {@inheritDoc} */
public int getRowCount()
{
}
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
return COLUMN_NAMES[col];
}
/**
* Returns whether the sort is ascending or descending.
* @return <CODE>true</CODE> if the sort is ascending and <CODE>false</CODE>
* otherwise.
*/
public boolean isSortAscending()
{
return sortAscending;
}
/**
* Sets whether to sort ascending of descending.
* @param sortAscending whether to sort ascending or descending.
*/
public void setSortAscending(boolean sortAscending)
{
this.sortAscending = sortAscending;
}
/**
* Returns the column index used to sort.
* @return the column index used to sort.
*/
public int getSortColumn()
{
return sortColumn;
}
/**
* Sets the column index used to sort.
* @param sortColumn column index used to sort..
*/
public void setSortColumn(int sortColumn)
{
this.sortColumn = sortColumn;
}
/**
* Returns the index in the specified row.
* @param row the row.
* @return the index in the specified row.
*/
{
}
/**
* Returns the message to be displayed in the cell if an index must be
* rebuilt.
* @param index the index to be analyzed.
* @return the message to be displayed in the cell if an index must be
* rebuilt.
*/
{
{
}
else
{
}
}
/**
* Compares the names of the two indexes.
* @param i1 the first index.
* @param i2 the second index.
* @return the alphabetical comparison of the names of both indexes.
*/
{
}
/**
* Compares the rebuild messages for the two indexes.
* @param i1 the first index.
* @param i2 the second index.
* @return the alphabetical comparison of the rebuild required message of both
* indexes.
*/
{
}
/**
* Updates the array data. This includes resorting it.
*/
private void updateDataArray()
{
indexArray.clear();
{
}
}
/**
* Returns the column names of the table.
* @return the column names of the table.
*/
protected abstract String[] getColumnNames();
/**
* Returns the different cell values for a given index in a String array.
* @param index the index.
* @return the different cell values for a given index in a String array.
*/
}