@Override boolean applyOptions() { List<String> list = filterTable.getFilterModel().getModel(); FilterSettings.WHITE_LISTED_IP_ADDRESSES.set(list.toArray(new String[list.size()])); spamManager.reloadIPFilter(); return false; }
@Override public void initOptions() { String[] bannedIps = FilterSettings.BLACK_LISTED_IP_ADDRESSES.get(); FilterModel model = new FilterModel(new ArrayList<String>(Arrays.asList(bannedIps))); filterTable.setModel(model); backListCheckBox.setSelected(FilterSettings.USE_NETWORK_FILTER.getValue()); }
@Override boolean applyOptions() { List<String> list = filterTable.getFilterModel().getModel(); FilterSettings.USE_NETWORK_FILTER.setValue(backListCheckBox.isSelected()); FilterSettings.BLACK_LISTED_IP_ADDRESSES.set(list.toArray(new String[list.size()])); spamManager.reloadIPFilter(); return false; }
@Override public void actionPerformed(ActionEvent e) { if (textField.getText() != null && textField.getText().length() > 0) { try { new IP(textField.getText()); table.addIp(textField.getText()); } catch (IllegalArgumentException iae) { } textField.setText(""); } }
@Override public void initOptions() { String[] allowedIps = FilterSettings.WHITE_LISTED_IP_ADDRESSES.get(); FilterModel model = new FilterModel(new ArrayList<String>(Arrays.asList(allowedIps))); filterTable.setModel(model); }
@Override boolean hasChanged() { List model = Arrays.asList(FilterSettings.WHITE_LISTED_IP_ADDRESSES.get()); return !model.equals(filterTable.getFilterModel().getModel()); }
@Override boolean hasChanged() { List model = Arrays.asList(FilterSettings.BLACK_LISTED_IP_ADDRESSES.get()); return backListCheckBox.isSelected() != FilterSettings.USE_NETWORK_FILTER.getValue() || !model.equals(filterTable.getFilterModel().getModel()); }