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.swing.interaction;
12  
13  import com.jsql.model.bean.database.AbstractElementDatabase;
14  import com.jsql.view.interaction.InteractionCommand;
15  import com.jsql.view.swing.util.MediatorHelper;
16  
17  /**
18   * Refresh the progress bar of an element in the database tree.
19   */
20  public class UpdateProgress implements InteractionCommand {
21      
22      /**
23       * The element in the database tree to refresh.
24       */
25      private final AbstractElementDatabase dataElementDatabase;
26  
27      /**
28       * The index of progression.
29       */
30      private final int dataCount;
31  
32      /**
33       * @param interactionParams Element in the database tree and progression index
34       */
35      public UpdateProgress(Object[] interactionParams) {
36          
37          this.dataElementDatabase = (AbstractElementDatabase) interactionParams[0];
38          this.dataCount = (Integer) interactionParams[1];
39      }
40  
41      @Override
42      public void execute() {
43          MediatorHelper.treeDatabase().updateProgress(this.dataElementDatabase, this.dataCount);
44      }
45  }