BrightSide Workbench Full Report + Source Code
org.turro.students.model.CategoriesVM Class Reference

Public Member Functions

void save ()
 
void delete ()
 
void add ()
 
TalentCategory getSelected ()
 
void setSelected (TalentCategory selected)
 
List getModel ()
 

Detailed Description

Member Function Documentation

◆ add()

void org.turro.students.model.CategoriesVM.add ( )

Definition at line 64 of file Elephant/elephant-students/src/main/java/org/turro/students/model/CategoriesVM.java.

64  {
65  Dialogs.title(I_.get("Category"))
66  .width("400px")
67  .height("220px")
68  .addField(DialogField.field("Name"))
69  .onOk((dialogs) -> {
70  String name = dialogs.getValue("Name", String.class);
71  if(!Strings.isBlank(name)) {
72  TalentCategory category = new TalentCategory();
73  category.setName(name);
74  selected = dao.get().saveEntity(category);
75  BindUtils.postNotifyChange(null, null, CategoriesVM.this, "model", "selected");
76  }
77  })
78  .emptyCancel()
79  .show();
80  }
Here is the call graph for this function:

◆ delete()

void org.turro.students.model.CategoriesVM.delete ( )

Definition at line 52 of file Elephant/elephant-students/src/main/java/org/turro/students/model/CategoriesVM.java.

52  {
53  if(selected != null && !hasChallenges(selected)) {
54  Messages.confirmDeletion().add(selected.getName())
55  .show(() -> {
56  dao.get().deleteEntity(selected);
57  selected = null;
58  BindUtils.postNotifyChange(null, null, CategoriesVM.this, "model", "selected");
59  });
60  }
61  }
Here is the call graph for this function:

◆ getModel()

List org.turro.students.model.CategoriesVM.getModel ( )

Definition at line 96 of file Elephant/elephant-students/src/main/java/org/turro/students/model/CategoriesVM.java.

96  {
97  return SqlClause.select("pc").from("TalentCategory pc")
98  .dao(dao.get())
99  .resultList(TalentCategory.class);
100  }

◆ getSelected()

TalentCategory org.turro.students.model.CategoriesVM.getSelected ( )

Definition at line 86 of file Elephant/elephant-students/src/main/java/org/turro/students/model/CategoriesVM.java.

86  {
87  return selected;
88  }

◆ save()

void org.turro.students.model.CategoriesVM.save ( )

Definition at line 46 of file Elephant/elephant-students/src/main/java/org/turro/students/model/CategoriesVM.java.

46  {
47  selected = dao.get().saveEntity(selected);
48  Notifications.reset();
49  }
Here is the call graph for this function:

◆ setSelected()

void org.turro.students.model.CategoriesVM.setSelected ( TalentCategory  selected)

Definition at line 90 of file Elephant/elephant-students/src/main/java/org/turro/students/model/CategoriesVM.java.

90  {
91  this.selected = selected;
92  }

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