1 /*******************************************************************************
2 * Copyhacked (H) 2012-2025.
3 * This program and the accompanying materials
4 * are made available under no term at all, use it like
5 * you want, but share and discuss it
6 * every time possible with every body.
7 *
8 * Contributors:
9 * ron190 at ymail dot com - initial implementation
10 ******************************************************************************/
11 package com.jsql.view.swing.interaction;
12
13 import com.jsql.model.bean.database.Table;
14 import com.jsql.view.interaction.InteractionCommand;
15 import com.jsql.view.swing.util.MediatorHelper;
16
17 import java.util.List;
18
19 /**
20 * Add the tables to the corresponding database.
21 */
22 public class AddTables implements InteractionCommand {
23
24 /**
25 * Tables retrieved by the view.
26 */
27 private final List<Table> tables;
28
29 /**
30 * @param interactionParams List of tables retrieved by the Model
31 */
32 @SuppressWarnings("unchecked")
33 public AddTables(Object[] interactionParams) {
34 this.tables = (List<Table>) interactionParams[0];
35 }
36
37 @Override
38 public void execute() {
39 MediatorHelper.treeDatabase().addTables(this.tables);
40 }
41 }