Beispiel #1
0
    public void setRow(int index, TicketLineInfo oLine) {

      String[] row = (String[]) m_rows.get(index);
      for (int i = 0; i < m_acolumns.length; i++) {
        try {
          ScriptEngine script = ScriptFactory.getScriptEngine(ScriptFactory.VELOCITY);
          script.put("ticketline", oLine);
          row[i] = script.eval(m_acolumns[i].value).toString();
        } catch (ScriptException e) {
          row[i] = null;
        }
        fireTableCellUpdated(index, i);
      }
    }
Beispiel #2
0
    public void insertRow(int index, TicketLineInfo oLine) {

      String[] row = new String[m_acolumns.length];
      for (int i = 0; i < m_acolumns.length; i++) {
        try {
          ScriptEngine script = ScriptFactory.getScriptEngine(ScriptFactory.VELOCITY);
          script.put("ticketline", oLine);
          row[i] = script.eval(m_acolumns[i].value).toString();
        } catch (ScriptException e) {
          row[i] = null;
        }
      }

      m_rows.add(index, row);
      fireTableRowsInserted(index, index);
    }