Example #1
0
 @Override
 public void setValueAt(Object aValue, int row, int column) {
   Filter f = filters.get(row);
   switch (column) {
     case COL_ENABLED:
       f.enable = (Boolean) aValue;
       savePrefs();
       updateFilters();
       fireTableRowsUpdated(row, row);
       break;
     case COL_HIDING:
       f.hiding = (Boolean) aValue;
       savePrefs();
       updateFilters();
       break;
     case COL_TEXT:
       f.text = (String) aValue;
       savePrefs();
       break;
     case COL_INVERTED:
       f.inverted = (Boolean) aValue;
       savePrefs();
       updateFilters();
       break;
   }
   if (column != 0) {
     fireTableCellUpdated(row, column);
   }
 }
Example #2
0
 private void savePrefs() {
   Collection<FilterPreferenceEntry> entries = new ArrayList<FilterPreferenceEntry>();
   for (Filter flt : filters) {
     entries.add(flt.getPreferenceEntry());
   }
   Main.pref.putListOfStructs("filters.entries", entries, FilterPreferenceEntry.class);
 }