diff options
Diffstat (limited to 'dozentenmodul')
-rwxr-xr-x | dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java index b0f0eefb..c2a8d2bd 100755 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java @@ -55,19 +55,19 @@ public class LdapFilterConfigurator extends LdapFilterConfiguratorLayout { @Override public void valueChanged(ListSelectionEvent e) { LdapFilter item = tblFilters.getSelectedItem2(); + boolean editable = (item == null || item.filterId == 0); + txtAttribute.setEditable(editable); + txtValue.setEditable(editable); + btnAdd.setEnabled(editable); + btnDel.setEnabled(editable); + btnAdd.setText("Ändern"); if (item == null) { clearInputFields(); return; } // share from the list is selected: fill bottom form and change "Add" to "Apply" - boolean editable = (item.filterId == 0); txtAttribute.setText(item.attribute); txtValue.setText(item.value); - txtAttribute.setEditable(editable); - txtValue.setEditable(editable); - btnAdd.setEnabled(editable); - btnDel.setEnabled(editable); - btnAdd.setText("Ändern"); } }); @@ -89,7 +89,7 @@ public class LdapFilterConfigurator extends LdapFilterConfiguratorLayout { } Wrapper<LdapFilter> newEntry = new Wrapper<LdapFilter>(input, false); - List<Wrapper<LdapFilter>> oldList = tblFilters.getData(); + List<Wrapper<LdapFilter>> oldList = new ArrayList<>(tblFilters.getData()); // either we delete the existing share from the data or we are // creating a new one, either way add it to the list and update @@ -102,7 +102,6 @@ public class LdapFilterConfigurator extends LdapFilterConfiguratorLayout { Wrapper<LdapFilter> oldEntry = tblFilters.getSelectedItem(); if (oldEntry != null && oldList.contains(oldEntry)) { // editing existing one, delete it from the internal data - oldList = new ArrayList<>(oldList); oldList.remove(oldEntry); } oldList.add(newEntry); @@ -120,7 +119,7 @@ public class LdapFilterConfigurator extends LdapFilterConfiguratorLayout { return; } try { - List<Wrapper<LdapFilter>> oldList = tblFilters.getData(); + List<Wrapper<LdapFilter>> oldList = new ArrayList<>(tblFilters.getData()); if (!oldList.remove(selection)) { // false if it was not found LOGGER.error("Could not remove non-existent filter '" + selection.toString() |