javax.swing.table.TableStringConverter Java Examples

The following examples show how to use javax.swing.table.TableStringConverter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EncodeTableModel.java    From JuiceboxLegacy with MIT License 6 votes vote down vote up
public EncodeTableModel(String[] headings, List<EncodeFileRecord> records) {

        this.records = records;

        List<String> tmp = new ArrayList<String>();
        tmp.add("");  // Checkbox heading
        for (String h : headings) {
            String heading = h.trim();
            if (heading.length() > 0 && !"path".equals(heading)) {
                tmp.add(heading);
            }
        }
        //tmp.add("path");
        columnHeadings = tmp.toArray(new String[tmp.size()]);


        sorter = new TableRowSorter<EncodeTableModel>(this);

        sorter.setStringConverter(new TableStringConverter() {
            @Override
            public String toString(TableModel model, int row, int column) {
                final Object value = model.getValueAt(row, column);
                return value == null ? "" : value.toString();
            }
        });
    }
 
Example #2
Source File: EncodeTableModel.java    From Juicebox with MIT License 6 votes vote down vote up
public EncodeTableModel(String[] headings, List<EncodeFileRecord> records) {

        this.records = records;

        List<String> tmp = new ArrayList<>();
        tmp.add("");  // Checkbox heading
        for (String h : headings) {
            String heading = h.trim();
            if (heading.length() > 0 && !"path".equals(heading)) {
                tmp.add(heading);
            }
        }
        //tmp.add("path");
        columnHeadings = tmp.toArray(new String[tmp.size()]);


        sorter = new TableRowSorter<>(this);

        sorter.setStringConverter(new TableStringConverter() {
            @Override
            public String toString(TableModel model, int row, int column) {
                final Object value = model.getValueAt(row, column);
                return value == null ? "" : value.toString();
            }
        });
    }
 
Example #3
Source File: ProfilerTable.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected TableRowSorter createRowSorter() {
    ProfilerRowSorter s = new ProfilerRowSorter(getModel());
    s.setStringConverter(new TableStringConverter() {
        public String toString(TableModel model, int row, int column) {
            return getModelStringValue(row, column);
        }
    });
    s.setDefaultSortOrder(SortOrder.DESCENDING);
    s.setSortColumn(0);
    return s;
}
 
Example #4
Source File: ProfilerTable.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
protected TableRowSorter createRowSorter() {
    ProfilerRowSorter s = new ProfilerRowSorter(getModel());
    s.setStringConverter(new TableStringConverter() {
        public String toString(TableModel model, int row, int column) {
            return getModelStringValue(row, column);
        }
    });
    s.setDefaultSortOrder(SortOrder.DESCENDING);
    s.setSortColumn(0);
    return s;
}