19 package org.turro.cleanup;
21 import org.turro.elephant.util.Messages;
22 import org.turro.elephant.util.Toasts;
23 import org.turro.entities.Entities;
24 import org.turro.entities.IElephantEntity;
25 import org.turro.log.SystemLogger;
26 import org.turro.reflection.stub.Stubs;
27 import org.turro.string.Phrases;
28 import org.turro.string.Strings;
29 import org.zkoss.bind.BindUtils;
30 import org.zkoss.bind.annotation.BindingParam;
31 import org.zkoss.bind.annotation.Command;
32 import org.zkoss.bind.annotation.NotifyChange;
40 private String entityPath;
46 @NotifyChange(
"console")
48 public void entityPath(@BindingParam(
"entityPath") String entityPath) {
49 this.entityPath = entityPath;
52 @NotifyChange(
"console")
63 BindUtils.postNotifyChange(
null,
null,
CleanupVM.this,
"console");
67 @NotifyChange(
"console")
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");
89 return Phrases.start(
"Proceed with caution!")
91 .add(
"The cleanup process involves removing the selected entity")
92 .add(
"along with those depending on.")
94 .add(
"Try the show option first, in order to see the process")
95 .add(
"before it starts.");
99 return Strings.isBlank(console.message(),
"No process...");
void entityPath(@BindingParam("entityPath") String entityPath)
static List< IElephantCleanup > getFor(Object entity, ICleanupConsole console)
static Messages confirmProcess()
Messages add(String word)
static Toasts message(String message)
static IElephantEntity getController(String path)