Exemplo n.º 1
0
 public ConditionsTableModel() {
   m_conditions = new java.util.ArrayList();
   Condition cond = new Condition();
   cond.setProperty("");
   cond.setOperator(ComparisonOperator.eq);
   cond.setValue("");
   m_conditions.add(cond);
 }
Exemplo n.º 2
0
 public Object getValueAt(int row, int col) {
   Condition cond = (Condition) m_conditions.get(row);
   if (col == 0) {
     return cond.getProperty();
   } else if (col == 1) {
     return getNiceName(cond.getOperator().toString());
   } else {
     return cond.getValue();
   }
 }
Exemplo n.º 3
0
 public void actionPerformed(java.awt.event.ActionEvent e) {
   Condition cond = new Condition();
   /*
   try {
    cond.setProperty(FedoraUtils.getAdvancedSearchFields((tufts.oki.dr.fedora.DR)dr)[0]);
   } catch (Exception ex) {
    */
   cond.setProperty("label");
   //            }
   cond.setOperator(ComparisonOperator.has);
   cond.setValue("");
   m_model.getConditions().add(cond);
   m_model.fireTableDataChanged();
 }
Exemplo n.º 4
0
 public void setValueAt(Object value, int row, int col) {
   Condition cond;
   if (row == -1) cond = new Condition();
   else cond = (Condition) m_conditions.get(row);
   if (col == 0) cond.setProperty((String) value);
   /*
   if(col == 1) {
    try {
   	 cond.setOperator(ComparisonOperator.fromValue(FedoraUtils.getAdvancedSearchOperatorsActuals((tufts.oki.dr.fedora.DR)dr,(String)value)));
    } catch (Exception ex) {
   	 System.out.println("Value = "+value+": Not supported -"+ex);
   	 cond.setOperator(ComparisonOperator.ge);
    }
   }
   */
   if (col == 2) cond.setValue((String) value);
   // row = -1 adds new condions else replace the existing one.
   if (row == -1) m_conditions.add(cond);
   else m_conditions.set(row, cond);
   fireTableCellUpdated(row, col);
 }