@Override
  public String put(String k, String v) {
    for (SimpleEntry<String, String> row : data) {
      if (caseSensitive) {
        if (row.getKey().equals(k)) {
          String oldValue = row.getValue();
          row.setValue(v);
          for (TableModelListener listener : listeners)
            listener.tableChanged(new TableModelEvent(this));
          return oldValue;
        }
      } else {
        if (row.getKey().equalsIgnoreCase(k)) {
          String oldValue = row.getValue();
          row.setValue(v);
          for (TableModelListener listener : listeners)
            listener.tableChanged(new TableModelEvent(this));
          return oldValue;
        }
      }
    }

    data.add(new SimpleEntry<String, String>(k, v));
    fireDataChangeNotification();
    return null;
  }
 public void fireContentsChangedTableModel() {
   // TableModelEvent event = new TableModelEvent(this,0,getRowCount());
   TableModelEvent event =
       new TableModelEvent(
           this, 0, this.getRowCount() - 1, TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT);
   for (TableModelListener listener : tableListeners) {
     listener.tableChanged(event);
   }
 }
Exemple #3
0
 private void fireTableChanged(TableModelEvent event) {
   Object[] listeners;
   synchronized (eventListenerList) {
     listeners = eventListenerList.getListenerList();
   }
   // Process the listeners last to first, notifying
   // those that are interested in this event
   for (int i = listeners.length - 2; i >= 0; i -= 2) {
     if (listeners[i] == TableModelListener.class) {
       TableModelListener listener = ((TableModelListener) listeners[i + 1]);
       if (logger.isDebugEnabled()) {
         logger.debug("Firing TableChange at {}.", listener.getClass().getName());
       }
       try {
         listener.tableChanged(event);
       } catch (Throwable ex) {
         if (logger.isWarnEnabled()) logger.warn("Exception while firing change!", ex);
         IOUtilities.interruptIfNecessary(ex);
       }
     }
   }
 }
 private void notifyTableModelBooleanChange() {
   for (TableModelListener t : tableModelListeners) t.tableChanged(new TableModelEvent(this));
 }
 private void notifyTableModelChange(int index0, int index1) {
   tableBooleanSelection = new boolean[super.size()];
   for (TableModelListener t : tableModelListeners)
     t.tableChanged(new TableModelEvent(this, index0, index1));
 }
 private void notifyListeners(final TableModelEvent tce) {
   for (final TableModelListener listener : this.listeners) {
     listener.tableChanged(tce);
   }
 }
 public void tableChanged(TableModelEvent e) throws RemoteException {
   _listener.tableChanged(e);
 }
 private void notifyListeners(TableModelEvent e) {
   for (TableModelListener l : listeners) {
     l.tableChanged(e);
   }
 }
 private void fireTableChanged() {
   for (TableModelListener listener : listeners) {
     listener.tableChanged(new TableModelEvent(this));
   }
 }
 private void fireCriteriaChanged() {
   TableModelEvent e = new TableModelEvent(this);
   for (TableModelListener l : listeners) l.tableChanged(e);
 }
Exemple #11
0
 public void fireUpdate() {
   for (TableModelListener tableModelListener : tableModelListeners) {
     tableModelListener.tableChanged(new TableModelEvent(this, 0, REGS_COUNT));
   }
 }
 private void fireDataChangeNotification() {
   for (TableModelListener listener : listeners) listener.tableChanged(new TableModelEvent(this));
   for (BoundDataListener listener : boundDataListeners) listener.boundDataChanged(this);
 }