public SortableTableHeaderListener(SortableTableModel model, SortButtonRenderer renderer)
 {
   base.\u002Ector();
   SortableTableHeaderListener tableHeaderListener = this;
   this.model = model;
   this.renderer = renderer;
 }
Exemplo n.º 2
0
 public virtual void setSortableModel(SortableTableModel model)
 {
   this.setModel((TableModel) model);
   this.headerListener.setTableModel(model);
   SortButtonRenderer sortButtonRenderer = new SortButtonRenderer();
   TableColumnModel columnModel = this.getColumnModel();
   for (int index = 0; index < columnModel.getColumnCount(); ++index)
     columnModel.getColumn(index).setHeaderRenderer((TableCellRenderer) sortButtonRenderer);
   model.sortByColumn(0, true);
 }
Exemplo n.º 3
0
 public SortableTable(SortableTableModel model)
 {
   base.\u002Ector((TableModel) model);
   SortableTable sortableTable = this;
   SortButtonRenderer renderer = new SortButtonRenderer();
   TableColumnModel columnModel = this.getColumnModel();
   for (int index = 0; index < columnModel.getColumnCount(); ++index)
     columnModel.getColumn(index).setHeaderRenderer((TableCellRenderer) renderer);
   JTableHeader tableHeader = this.getTableHeader();
   this.headerListener = new SortableTableHeaderListener(model, renderer);
   ((Component) tableHeader).addMouseListener((MouseListener) this.headerListener);
   ((Component) tableHeader).addMouseMotionListener((MouseMotionListener) this.headerListener);
   model.sortByColumn(0, true);
 }