BrightSide Workbench Full Report + Source Code
org.turro.synonyms.SynonymsVM Class Reference

Public Member Functions

 SynonymsVM ()
 
Synonyms getSelected ()
 
void setSelected (Synonyms selected)
 
String getSearchValue ()
 
void setSearchValue (String searchValue)
 
boolean isSelected (Synonyms synonyms)
 
void update ()
 
void addGroup ()
 
void deleteGroup ()
 
void addWord ()
 
void deleteWord (@BindingParam("word") String word)
 
void selectSynonyms (@BindingParam("selected") Synonyms selected)
 
Set< String > getWordModel ()
 
List< SynonymsgetModel ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 40 of file SynonymsVM.java.

Constructor & Destructor Documentation

◆ SynonymsVM()

org.turro.synonyms.SynonymsVM.SynonymsVM ( )

Definition at line 45 of file SynonymsVM.java.

45  {
46  }

Member Function Documentation

◆ addGroup()

void org.turro.synonyms.SynonymsVM.addGroup ( )

Definition at line 75 of file SynonymsVM.java.

75  {
76  selected = new Synonyms();
77  addWord();
78  }
Here is the call graph for this function:

◆ addWord()

void org.turro.synonyms.SynonymsVM.addWord ( )

Definition at line 90 of file SynonymsVM.java.

90  {
91  if(selected != null) {
92  InputDialog.getInput(Framework.getCurrent().getPage(),
93  I_.get("Synonyms"), "Word",
94  "", null, 0, (Context context) -> {
95  String value = (String) context.get("value");
96  if(!Strings.isBlank(value)) {
97  selected.getWords().add(value);
98  selected = getDao().saveObject(selected);
99  BindUtils.postNotifyChange(null, null, SynonymsVM.this, "model");
100  BindUtils.postNotifyChange(null, null, SynonymsVM.this, "wordModel");
101  }
102  return null;
103  });
104  }
105  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteGroup()

void org.turro.synonyms.SynonymsVM.deleteGroup ( )

Definition at line 82 of file SynonymsVM.java.

82  {
83  if(selected != null) {
84  getDao().deleteObject(selected);
85  selected = null;
86  }
87  }
void deleteObject(Object obj)
Definition: Dao.java:162
Here is the call graph for this function:

◆ deleteWord()

void org.turro.synonyms.SynonymsVM.deleteWord ( @BindingParam("word") String  word)

Definition at line 109 of file SynonymsVM.java.

109  {
110  if(selected != null) {
111  if(selected.getWords().remove(word)) {
112  if(selected.isEmpty()) {
113  getDao().deleteObject(selected);
114  selected = null;
115  } else {
116  selected = getDao().saveObject(selected);
117  }
118  }
119  }
120  }
Here is the call graph for this function:

◆ getModel()

List<Synonyms> org.turro.synonyms.SynonymsVM.getModel ( )

Definition at line 133 of file SynonymsVM.java.

133  {
134  if(!Strings.isBlank(searchValue)) {
135  return Synonyms.getSynonyms(searchValue, 0);
136  } else {
137  return getDao().getResultList("select s from Synonyms s");
138  }
139  }
Here is the call graph for this function:

◆ getSearchValue()

String org.turro.synonyms.SynonymsVM.getSearchValue ( )

Definition at line 56 of file SynonymsVM.java.

56  {
57  return searchValue;
58  }

◆ getSelected()

Synonyms org.turro.synonyms.SynonymsVM.getSelected ( )

Definition at line 48 of file SynonymsVM.java.

48  {
49  return selected;
50  }

◆ getWordModel()

Set<String> org.turro.synonyms.SynonymsVM.getWordModel ( )

Definition at line 128 of file SynonymsVM.java.

128  {
129  if(selected == null) return null;
130  return selected.getWords();
131  }
Here is the call graph for this function:

◆ isSelected()

boolean org.turro.synonyms.SynonymsVM.isSelected ( Synonyms  synonyms)

Definition at line 64 of file SynonymsVM.java.

64  {
65  return selected != null && synonyms != null &&
66  selected.getId() != null && synonyms.getId() != null &&
67  selected.getId().equals(synonyms.getId());
68  }
Here is the call graph for this function:

◆ selectSynonyms()

void org.turro.synonyms.SynonymsVM.selectSynonyms ( @BindingParam("selected") Synonyms  selected)

Definition at line 124 of file SynonymsVM.java.

124  {
125  this.selected = selected;
126  }

◆ setSearchValue()

void org.turro.synonyms.SynonymsVM.setSearchValue ( String  searchValue)

Definition at line 60 of file SynonymsVM.java.

60  {
61  this.searchValue = searchValue;
62  }

◆ setSelected()

void org.turro.synonyms.SynonymsVM.setSelected ( Synonyms  selected)

Definition at line 52 of file SynonymsVM.java.

52  {
53  this.selected = selected;
54  }

◆ update()

void org.turro.synonyms.SynonymsVM.update ( )

Definition at line 72 of file SynonymsVM.java.

72 {}

The documentation for this class was generated from the following file: