Package org.snmp4j.agent.mo

Examples of org.snmp4j.agent.mo.MOMutableTableModel


    this.overridePriority = overridePriority;
  }

  public boolean changeRowIndex(OID oldIndex, OID newIndex) {
    if (model instanceof MOMutableTableModel) {
      MOMutableTableModel mutableModel = (MOMutableTableModel) model;
      MOTableRow r = mutableModel.removeRow(oldIndex);
      if (r == null) {
        return false;
      }
      r.getIndex().setValue(newIndex.getValue());
      MOTableRow existingRow = mutableModel.addRow(r);
      if (existingRow != null) {
        mutableModel.removeRow(newIndex);
        r.getIndex().setValue(oldIndex.getValue());
        mutableModel.addRow(r);
        mutableModel.addRow(existingRow);
        return false;
      }
      fireRowChanged(new MOTableRowEvent(this, this, r,
                                         MOTableRowEvent.UPDATED, false));
      return true;
View Full Code Here


        return this;
    }

    public MOTable build() {
        DefaultMOTable ifTable = new DefaultMOTable(tableRootOid, indexDef, columns.toArray(new MOColumn[0]));
        MOMutableTableModel model = (MOMutableTableModel) ifTable.getModel();
        int i = 1;

        for (Variable[] variables : tableRows) {
            model.addRow(new DefaultMOMutableRow2PC(new OID(String.valueOf(i)), variables));
            i++;
        }
        ifTable.setVolatile(true);
        return ifTable;
    }
View Full Code Here

TOP

Related Classes of org.snmp4j.agent.mo.MOMutableTableModel

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.