Example usage for org.apache.commons.jcs.access CacheAccess remove

List of usage examples for org.apache.commons.jcs.access CacheAccess remove

Introduction

In this page you can find the example usage for org.apache.commons.jcs.access CacheAccess remove.

Prototype

@Override
public void remove(K name) 

Source Link

Document

Removes a single item by name.

Usage

From source file:org.openstreetmap.josm.gui.preferences.imagery.CacheContentsPanel.java

private static JTable getTableForCache(final CacheAccess<String, BufferedImageCacheEntry> cache,
        final TableModel tableModel) {
    final JTable ret = new JTable(tableModel);

    ButtonColumn buttonColumn = new ButtonColumn(new AbstractAction() {
        @Override/*from  w w w.  j  ava 2 s.  com*/
        public void actionPerformed(ActionEvent e) {
            int row = ret.convertRowIndexToModel(ret.getEditingRow());
            tableModel.setValueAt("0", row, 1);
            cache.remove(ret.getValueAt(row, 0).toString() + ':');
        }
    });
    TableColumn tableColumn = ret.getColumnModel().getColumn(2);
    tableColumn.setCellRenderer(buttonColumn);
    tableColumn.setCellEditor(buttonColumn);
    return ret;
}