View Javadoc
1   /*******************************************************************************
2    * Copyhacked (H) 2012-2020.
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 about 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.terminal.interaction;
12  
13  import com.jsql.util.AnsiColorUtil;
14  import com.jsql.view.interaction.InteractionCommand;
15  import org.apache.logging.log4j.LogManager;
16  import org.apache.logging.log4j.Logger;
17  
18  import java.util.Arrays;
19  
20  /**
21   * Create a new tab for the values.
22   */
23  public class CreateValuesTab implements InteractionCommand {
24      
25      private static final Logger LOGGER = LogManager.getRootLogger();
26  
27      /**
28       * 2D array of values.
29       */
30      private final String[][] data;
31  
32      /**
33       * @param interactionParams Names of columns, table's values and corresponding table
34       */
35      public CreateValuesTab(Object[] interactionParams) {
36          this.data = (String[][]) interactionParams[1];  // 2D array of values
37      }
38  
39      @Override
40      public void execute() {
41          
42          LOGGER.debug(() -> AnsiColorUtil.addGreenColor(this.getClass().getSimpleName()));
43          LOGGER.debug(() -> Arrays.deepToString(this.data));
44      }
45  }