19 package org.turro.occurrence;
21 import java.util.ArrayList;
22 import java.util.List;
23 import org.turro.string.Strings;
24 import org.turro.elephant.util.Messages;
25 import org.turro.reflection.Instances;
26 import org.zkoss.bind.BindUtils;
27 import org.zkoss.bind.annotation.BindingParam;
28 import org.zkoss.bind.annotation.Command;
29 import org.zkoss.bind.annotation.NotifyChange;
37 private String occurrence;
38 private String substitution;
48 this.occurrence = occurrence;
56 this.substitution = substitution;
59 @NotifyChange(
"model")
63 @NotifyChange(
"model")
64 @Command(
"substitute")
66 if(api !=
null && !Strings.isBlank(substitution)) {
67 api.changeOccurrences(substitution);
75 api.removeOccurrences();
76 BindUtils.postNotifyChange(
null,
null,
OccurrencesVM.this,
"model");
82 List<IOccurrenceAPI> list =
new ArrayList<>();
83 if(!Strings.isBlank(occurrence)) {
85 if(oapi.hasOccurrences(occurrence)) {
static Messages confirmDeletion()
Messages add(String word)
void substitute(@BindingParam("api") IOccurrenceAPI api)
void setOccurrence(String occurrence)
void remove(@BindingParam("api") IOccurrenceAPI api)
void setSubstitution(String substitution)
List< IOccurrenceAPI > getModel()