/** * @param sortable the sortable to set */ public void setSortable( boolean sortable ) { this.sortable = sortable; if ( !sortable ) { table.setSortColumn( null ); } else { table.setSortColumn( table.getColumn( sortfield ) ); } }
private void refreshOrder() { clientOrder = Order.Ascend; clientOrderBy = OrderBy.NAME; updateOrder(); updateOrderby(); table.setSortColumn(null); }
private void columnSelected() { TreeItem[] items = tree.getSelection(); if (items.length > 0) { if (clientOrder == Order.Ascend) { table.setSortDirection(SWT.UP); } else { table.setSortDirection(SWT.DOWN); } if (clientOrderBy == OrderBy.NAME) table.setSortColumn(tblclmnName); else if (clientOrderBy == OrderBy.TYPE) table.setSortColumn(tblclmnType); else table.setSortColumn(tblclmnSize); ContainerKeyInfo info = new ContainerKeyInfo(); parseContainer(items[0], info); updateOrder(); updateOrderby(); tableItemOrderSelected(info); } }
table.setSortColumn( table.getColumn( sortfield ) ); table.setSortDirection( sortingDescending ? SWT.DOWN : SWT.UP );
table.setSortColumn( table.getColumn( sortfield ) ); table.setSortDirection( sortingDescending ? SWT.DOWN : SWT.UP );
private void setSortColumn() { TableColumn sortColumn = CURRENT_FILE_FIELD.getTableColumn(); if (sortColumn == null) { logger.warning("could not find preferred sort column"); } else { swtTable.setSortColumn(sortColumn); swtTable.setSortDirection(SWT.UP); } }
/** * Updates the SWT table to indicate sorting icon on the primary sort column. */ protected final void updateTableSortColumn() { final List<Integer> sortedColumns = getSortingColumns(); if (sortedColumns.isEmpty()) { // no columns sorted table.setSortColumn(null); table.setSortDirection(SWT.NONE); } else { // make GL primary sort column the SWT table sort column final int primaryColumnIndex = sortedColumns.get(0).intValue(); final int sortDirection = isColumnReverse(primaryColumnIndex) ? SWT.DOWN : SWT.UP; table.setSortColumn(table.getColumn(primaryColumnIndex)); table.setSortDirection(sortDirection); } }
/** * Updates the SWT table to indicate sorting icon on the primary sort column. */ protected final void updateTableSortColumn() { final List<Integer> sortedColumns = getSortingColumns(); if (sortedColumns.isEmpty()) { // no columns sorted table.setSortColumn(null); table.setSortDirection(SWT.NONE); } else { // make GL primary sort column the SWT table sort column final int primaryColumnIndex = sortedColumns.get(0).intValue(); final int sortDirection = isColumnReverse(primaryColumnIndex) ? SWT.DOWN : SWT.UP; table.setSortColumn(table.getColumn(primaryColumnIndex)); table.setSortDirection(sortDirection); } }
/** * Updates the SWT table to indicate sorting icon on the primary sort column. */ protected final void updateTableSortColumn() { final List<Integer> sortedColumns = getSortingColumns(); if (sortedColumns.isEmpty()) { // no columns sorted table.setSortColumn(null); table.setSortDirection(SWT.NONE); } else { // make GL primary sort column the SWT table sort column final int primaryColumnIndex = sortedColumns.get(0).intValue(); final int sortDirection = isColumnReverse(primaryColumnIndex) ? SWT.DOWN : SWT.UP; table.setSortColumn(table.getColumn(primaryColumnIndex)); table.setSortDirection(sortDirection); } }
@Override public void widgetSelected(SelectionEvent e) { boolean ascending = comparator.setField(table.indexOf(tc)); try { table.setSortColumn(tc); table.setSortDirection(ascending ? SWT.UP : SWT.DOWN); } catch (NoSuchMethodError ignore) { // Ignore Pre 3.0 } pluginIFs.sort(comparator); table.clearAll(); } });
@Override public void handleEvent(Event e) { // determine new sort column and direction TableColumn sortColumn = subscriptionsList.getSortColumn(); TableColumn currentColumn = (TableColumn) e.widget; int dir = subscriptionsList.getSortDirection(); if (sortColumn == currentColumn) { dir = dir == SWT.UP ? SWT.DOWN : SWT.UP; } else { subscriptionsList.setSortColumn(currentColumn); dir = SWT.DOWN; } subscriptionsList.setSortDirection(dir); sortAndRefresh(); } };
private void resetTableDisplay () { try { issuesModel.setIssues(session.getIssues()); tblIssues.setSortColumn(null); // Reset the sort column displayType = cbDisplay.getSelectionIndex(); issueType = cbTypes.getSelectionIndex(); issuesModel.updateTable(0, displayType, issueType); updateCurrentIssue(); } catch ( Throwable e ) { Dialogs.showError(shell, "Error resetting the table.\n"+e.getMessage(), null); } }
@Override public void widgetSelected(SelectionEvent e) { if (tableSorter != null) { tableSorter.setColumn(index); } int dir = table.getSortDirection(); if (table.getSortColumn() == column) { dir = dir == SWT.UP ? SWT.DOWN : SWT.UP; } else { dir = SWT.DOWN; } table.setSortDirection(dir); table.setSortColumn(column); result.refresh(); } });
@Override public void widgetSelected(SelectionEvent e) { fViewerComparator.setColumn(fColumnIndex); int dir= fViewerComparator.getDirection(); fTableViewer.getTable().setSortDirection(dir); fTableViewer.getTable().setSortColumn(fTableColumn); fTableViewer.refresh(); } }
private void updateSortIcon() { int index = m_tableModel.getSortIndex(); if (index < 0) { index = NlsTable.INDEX_COLUMN_KEYS; m_tableModel.setSortIndex(index); } TableColumn col = m_table.getColumn(index); if (col == null) { return; } else if (col.equals(m_sortColumn)) { int sortDir = SWT.UP; if (m_table.getSortDirection() == SWT.UP) { sortDir = SWT.DOWN; } m_table.setSortDirection(sortDir); } else { m_sortColumn = col; m_table.setSortColumn(m_sortColumn); m_table.setSortDirection(SWT.UP); } }
@Override public void widgetSelected(SelectionEvent e) { fViewerComparator.setColumn(fColumnIndex); int dir= fViewerComparator.getDirection(); fTableViewer.getTable().setSortDirection(dir); fTableViewer.getTable().setSortColumn(fTableColumn); fTableViewer.refresh(); } }
public void setSortColumn(final TableColumn ftc, String name, boolean reverse) { SWTAsync.assertGUI(); if (ftc != null) { if (!GUI.isMac()) { table.setSortDirection(!reverse ? SWT.UP : SWT.DOWN); table.setSortColumn(ftc); if (name != null) ftc.setText(name); } else { if (name != null) // ftc.setText(name + (reverse?" (reverse)":"")); ftc.setText(name); } } else table.setSortDirection(SWT.NONE); }
/** * Sets the sorting direction for this sorter to use * * @param direction */ public void setDirection(int direction) { this.column.getParent().setSortColumn(this.column); this.direction = direction; this.column.getParent().setSortDirection(this.direction); if (this.cviewer.getComparator() == this) { this.cviewer.refresh(); } else { this.cviewer.setComparator(this); } }
public void setSortColumn(final TableColumn ftc, String name, boolean reverse) { SWTAsync.assertGUI(); if (ftc != null) { if (!GUI.isMac()) { table.setSortDirection(!reverse ? SWT.UP : SWT.DOWN); table.setSortColumn(ftc); if (name != null) ftc.setText(name); } else { if (name != null) // ftc.setText(name + (reverse?" (reverse)":"")); ftc.setText(name); } } else table.setSortDirection(SWT.NONE); }
/** * Update the sort information on both the comparator and the table. * * @param columnIndex * the index to sort by * @since 3.4 */ private void updateTableSorting(final int columnIndex) { TableComparator comparator = (TableComparator) vendorInfo .getComparator(); // toggle direction if it's the same column if (columnIndex == comparator.getSortColumn()) { comparator.setAscending(!comparator.isAscending()); } comparator.setSortColumn(columnIndex); vendorInfo.getTable().setSortColumn( vendorInfo.getTable().getColumn(columnIndex)); vendorInfo.getTable().setSortDirection( comparator.isAscending() ? SWT.UP : SWT.DOWN); vendorInfo.refresh(false); }