col_names = new String[]{"Priority", "Name", "Source", "Action", "Destination"};
data_table = FXCollections.observableArrayList();
if (root_node == null) {
root_node = new EncryptedNode();
root_node.setId(getTabTitle());
manager.putInStoredData(getId(), root_node);
}
if (root_node.getChilds() != null && !root_node.getChilds().isEmpty()) {
for (int i = 0; i < root_node.getChilds().size(); i++) {
data_table.add(new CellPropertiesManager(root_node.getChilds().get(i)));
}
}
Utility.log("Start Backup On Demand.");
this.escaper = LooB.get().fromStock(Escaper.class);
this.ini = LooB.get().fromStock(IniProperties.class);
latest_bck_res.setVisible(true);
__btn_bck_add = ToolBarAction.newButton("btn_bck_add", "Add Value",
"plus_24.png", (ActionEvent e) -> {
addBackupEntry();
});
__btn_bck_remove = ToolBarAction.newButton("btn_bck_remove", "Delete Value",
"delete_24.png", (ActionEvent e) -> {
deleteSelectedEntry();
});
__btn_bck_remove_all = ToolBarAction.newButton("btn_bck_remove_all", "Delete All Value",
"trash_24.png", (ActionEvent e) -> {
manager.createPopupMessage("bk_del_all_operation", new AnswarePopupMessage() {
@Override
public void onOkAnsware() {
deleteAllEntry();
}
@Override
public void onCancelAnsware() {
}
}).setHeader(RBLoader.ll("Delete All Backups."))
.setContent(RBLoader.ll("Confirm delete all backups ?"))
.setOkCancelButton(RBLoader.ll("Ok"),
RBLoader.ll("Cancel"))
.setIcon(Utility.getImage("help_24.png"))
.show();
});
__btn_bck_start_backup = ToolBarAction.newButton("btn_bck_start_backup", "Start Backup",
"video_play_24.png", (ActionEvent e) -> {
manager.createPopupMessage("bk_start_operation", new AnswarePopupMessage() {
@Override
public void onOkAnsware() {
startBackup();
}
@Override
public void onCancelAnsware() {
}
}).setHeader("Start Backup.")
.setContent("Confirm run backup?\n\n"
+ "Warning: this operation always overwrites every file in the target directory. "
+ "Please, make sure that you have set the correct input value.")
.setOkCancelButton("Ok", "Cancel")
.setIcon(Utility.getImage("help_24.png"))
.show();
});
__btn_bck_info = InfoButton.create("In this section you "
+ "can set one or more actions to be performed for your backup. "
+ "Please click the button insert and set a priority, "
+ "select the source and destination and choose whether "
+ "to perform a recursive zip all files or just a copy.", manager);
registerTableButtons();
__btn_bck_confirm_add = ToolBarAction.newButton("btn_bck_confirm_add", "Ok",
"checkmark_24.png", (ActionEvent e) -> {
String prio = (String) editor.priority_edit.getSelectionModel().getSelectedItem();
String name = editor.name_edit.getText();
String act = (String) editor.action_edit.getSelectionModel().getSelectedItem();
String source = editor.fileordir_edit.getText();
String destination = editor.dest_edit.getText();
if (source != null && source.length() > 0 && destination != null && destination.length() > 0) {
if (name == null) {
name = "";
}
EncryptedNode node = new EncryptedNode();
node.getProperties().put("priority", prio);
node.getProperties().put("name", name);
node.getProperties().put("action", act);
node.getProperties().put("source", source);
node.getProperties().put("destination", destination);
data_table.add(new CellPropertiesManager(node));
addMainTable();
updateTable();