/** * Sorts on the specified column. * * @param column the column index. * @param ascending a flag that controls the sort order. * */ public void sortByColumn(final int column, final boolean ascending) { if (isSortable(column)) { super.sortByColumn(column, ascending); Collections.sort(this.properties, new SystemPropertyComparator(ascending)); } }
/** * Creates and returns a JTable containing all the system properties. This method returns a * table that is configured so that the user can sort the properties by clicking on the table * header. * * @return a system properties table. */ public static SortableTable createSystemPropertiesTable() { final SystemPropertiesTableModel properties = new SystemPropertiesTableModel(); final SortableTable table = new SortableTable(properties); final TableColumnModel model = table.getColumnModel(); TableColumn column = model.getColumn(0); column.setPreferredWidth(200); column = model.getColumn(1); column.setPreferredWidth(350); table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); return table; }
/** * Creates and returns a JTable containing all the system properties. This method returns a * table that is configured so that the user can sort the properties by clicking on the table * header. * * @return a system properties table. */ public static SortableTable createSystemPropertiesTable() { final SystemPropertiesTableModel properties = new SystemPropertiesTableModel(); final SortableTable table = new SortableTable(properties); final TableColumnModel model = table.getColumnModel(); TableColumn column = model.getColumn(0); column.setPreferredWidth(200); column = model.getColumn(1); column.setPreferredWidth(350); table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); return table; }
/** * Sorts on the specified column. * * @param column the column index. * @param ascending a flag that controls the sort order. * */ public void sortByColumn(final int column, final boolean ascending) { if (isSortable(column)) { super.sortByColumn(column, ascending); Collections.sort(this.properties, new SystemPropertyComparator(ascending)); } }
/** * Creates and returns a JTable containing all the system properties. This method returns a * table that is configured so that the user can sort the properties by clicking on the table * header. * * @return a system properties table. */ public static SortableTable createSystemPropertiesTable() { final SystemPropertiesTableModel properties = new SystemPropertiesTableModel(); final SortableTable table = new SortableTable(properties); final TableColumnModel model = table.getColumnModel(); TableColumn column = model.getColumn(0); column.setPreferredWidth(200); column = model.getColumn(1); column.setPreferredWidth(350); table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); return table; }
/** * Sorts on the specified column. * * @param column the column index. * @param ascending a flag that controls the sort order. * */ public void sortByColumn(final int column, final boolean ascending) { if (isSortable(column)) { super.sortByColumn(column, ascending); Collections.sort(this.properties, new SystemPropertyComparator(ascending)); } }