Interface Removable<E>
- All Known Subinterfaces:
ListModel<E>
- All Known Implementing Classes:
SimpleListModel
public interface Removable<E>
Ability to remove element from list. Mostly used to remove element in the list view in list-detail view pattern. Setting the setOnRemoveElement is
not necessary even is used when calling removeElement.
class RemovableImpl implements Removable<Model> {
private Consumer<Model> onRemoveElement;
public void removeElement(Model element) {
if (onRemoveElement != null) {
onRemoveElement.accept(element);
}
}
public void setOnRemoveElement(Consumer<Model> command) {
onRemoveElement = command;
}
}
-
Method Summary
Modifier and TypeMethodDescriptionvoidremoveElement(E element) Runs predefined command set bysetOnRemoveElement(java.util.function.Consumer<E>)voidsetOnRemoveElement(Consumer<E> command) Sets the command which should be called inremoveElement(E)
-
Method Details
-
removeElement
Runs predefined command set bysetOnRemoveElement(java.util.function.Consumer<E>) -
setOnRemoveElement
Sets the command which should be called inremoveElement(E)
-