Package javax.swing.event

Examples of javax.swing.event.TableModelEvent


            if (indexOf != -1) {
                itensFiltrados.set(indexOf, item);
            }
        }
        for (int i = 0; i < tableModelListeners.size(); i++) {
            TableModelEvent event = new TableModelEvent(this, convertedRow, convertedRow, TableModelEvent.ALL_COLUMNS, TableModelEvent.UPDATE);
            tableModelListeners.get(i).tableChanged(event);

        }
    }
View Full Code Here


    public void clear() {
        itens.clear();
        itensFiltrados.clear();
        for (int i = 0; i < tableModelListeners.size(); i++) {
            TableModelEvent event = new TableModelEvent(this);
            tableModelListeners.get(i).tableChanged(event);

        }
        dispararSizeChanged();
    }
View Full Code Here

    }

    private void atualizarFiltro() {
        if (!itensFiltrados.isEmpty()) {
            for (int i = 0; i < tableModelListeners.size(); i++) {
                TableModelEvent event = new TableModelEvent(this, -1, itensFiltrados.size() - 1, TableModelEvent.ALL_COLUMNS, TableModelEvent.DELETE);
                tableModelListeners.get(i).tableChanged(event);
            }
        }
        itensFiltrados.clear();
        String[] tokenFiltro = filtro.split(" ");
        for (int i = 0; i < itens.size(); i++) {
            E item = itens.get(i);
            boolean todos = true;
            for (int j = 0; todos && j < tokenFiltro.length; j++) {
                todos &= item.getTextoParaPesquisa().contains(tokenFiltro[j]);
            }
            if (todos) {
                itensFiltrados.add(item);
            }
        }
        for (int i = 0; i < tableModelListeners.size(); i++) {
            TableModelEvent event = new TableModelEvent(this);//, 0, itensFiltrados.size() - 1, TableModelEvent.ALL_COLUMNS, TableModelEvent.UPDATE);
            if (!itensFiltrados.isEmpty()) {
//             event = new TableModelEvent(this, 0, 0, TableModelEvent.ALL_COLUMNS, TableModelEvent.DELETE);
                tableModelListeners.get(i).tableChanged(event);
            }
View Full Code Here

    public void setFiltro(String text) {
        if (text.isEmpty()) {
            filtro = null;
            for (int i = 0; i < tableModelListeners.size(); i++) {
                TableModelEvent event = new TableModelEvent(this, 0, itens.size() - 1, TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT);
                if (!itensFiltrados.isEmpty()) {
//             event = new TableModelEvent(this, 0, 0, TableModelEvent.ALL_COLUMNS, TableModelEvent.DELETE);
                    tableModelListeners.get(i).tableChanged(event);
                }
View Full Code Here

            dados.add(itens.remove(i));
        }
        itens.addAll(novaPosicao, dados);
        if (filtro == null) {
            for (int i = 0; i < tableModelListeners.size(); i++) {
                TableModelEvent event = new TableModelEvent(this, 0, itens.size() - 1, TableModelEvent.ALL_COLUMNS, TableModelEvent.UPDATE);
                tableModelListeners.get(i).tableChanged(event);
            }
        } else {
            atualizarFiltro();
        }
View Full Code Here

        for (int i = linhas.length; i >= 0; i--) {
            itens.remove(linhas[i]);
        }
        if (filtro == null) {
            for (int i = 0; i < tableModelListeners.size(); i++) {
                TableModelEvent event = new TableModelEvent(this, itens.size() - 1, itens.size() - 1, TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT);
                tableModelListeners.get(i).tableChanged(event);
            }
        } else {
            atualizarFiltro();
        }
View Full Code Here

     * @param servers an array containing the ServerInfo structs of the
     * servers to display.
     */
    public void setServers(ServerInfo[] servers){
    m_servers = servers;
    fireTableChanged(new TableModelEvent(this));
    }
View Full Code Here

     * @param poas an array containing the POAs to display.
     */
    public void setPOAs(POAInfo[] poas){
    if (m_poas != poas){
        m_poas = poas;
        fireTableChanged(new TableModelEvent(this));
    }
    }
View Full Code Here

  {
    MyTableModelListener listener = new MyTableModelListener();
    MyTableModel m = new MyTableModel();
    m.addTableModelListener(listener);
    m.fireTableRowsUpdated(3, 7);
    TableModelEvent e = listener.getEvent();
    harness.check(e.getFirstRow(), 3);
    harness.check(e.getLastRow(), 7);
    harness.check(e.getColumn(), -1);
    harness.check(e.getType(), TableModelEvent.UPDATE);
  }
View Full Code Here

  {
    MyTableModelListener listener = new MyTableModelListener();
    MyTableModel m = new MyTableModel();
    m.addTableModelListener(listener);
    m.fireTableStructureChanged();
    TableModelEvent e = listener.getEvent();
    harness.check(e.getFirstRow(), -1);
    harness.check(e.getLastRow(), -1);
    harness.check(e.getColumn(), -1);
    harness.check(e.getType(), TableModelEvent.UPDATE);
  }
View Full Code Here

TOP

Related Classes of javax.swing.event.TableModelEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.