BrightSide Workbench Full Report + Source Code
org.turro.cleanup.CleanupVM Class Reference

Public Member Functions

 CleanupVM ()
 
void entityPath (@BindingParam("entityPath") String entityPath)
 
void show ()
 
void cleanup ()
 
Phrases getCaution ()
 
String getConsole ()
 

Detailed Description

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

Definition at line 38 of file CleanupVM.java.

Constructor & Destructor Documentation

◆ CleanupVM()

org.turro.cleanup.CleanupVM.CleanupVM ( )

Definition at line 43 of file CleanupVM.java.

43  {
44  }

Member Function Documentation

◆ cleanup()

void org.turro.cleanup.CleanupVM.cleanup ( )

Definition at line 69 of file CleanupVM.java.

69  {
70  console = new CleanupConsole();
71  IElephantEntity iee = Entities.getController(entityPath);
72  if(iee.isEmpty()) {
73  Toasts.message("Entity cannot be instantiated.").show();
74  return;
75  }
76  Messages.confirmProcess().add("Cleaup for:").add(iee.getName())
77  .show(() -> {
78  Cleanup.getFor(iee.getEntity(), console).forEach(action -> {
79  String stub = Stubs.json(iee.getEntity());
80  action.cleanEntity(iee.getEntity(), CleanupMode.VERBOSE);
81  SystemLogger.info().entity(iee).comment("cleanup")
82  .data(stub.getBytes()).log();
83  BindUtils.postNotifyChange(null, null, CleanupVM.this, "console");
84  });
85  });
86  }
Here is the call graph for this function:

◆ entityPath()

void org.turro.cleanup.CleanupVM.entityPath ( @BindingParam("entityPath") String  entityPath)

Definition at line 48 of file CleanupVM.java.

48  {
49  this.entityPath = entityPath;
50  }

◆ getCaution()

Phrases org.turro.cleanup.CleanupVM.getCaution ( )

Definition at line 88 of file CleanupVM.java.

88  {
89  return Phrases.start("Proceed with caution!")
90  .paragraph()
91  .add("The cleanup process involves removing the selected entity")
92  .add("along with those depending on.")
93  .paragraph()
94  .add("Try the show option first, in order to see the process")
95  .add("before it starts.");
96  }

◆ getConsole()

String org.turro.cleanup.CleanupVM.getConsole ( )

Definition at line 98 of file CleanupVM.java.

98  {
99  return Strings.isBlank(console.message(), "No process...");
100  }

◆ show()

void org.turro.cleanup.CleanupVM.show ( )

Definition at line 54 of file CleanupVM.java.

54  {
55  console = new CleanupConsole();
56  IElephantEntity iee = Entities.getController(entityPath);
57  if(iee.isEmpty()) {
58  Toasts.message("Entity cannot be instantiated.").show();
59  return;
60  }
61  Cleanup.getFor(iee.getEntity(), console).forEach(action -> {
62  action.cleanEntity(iee.getEntity(), CleanupMode.ONLY_VERBOSE);
63  BindUtils.postNotifyChange(null, null, CleanupVM.this, "console");
64  });
65  }
Here is the call graph for this function:

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