Coverage Report - org.jtheque.core.managers.view.impl.frame.ModuleView
 
Classes in this File Line Coverage Branch Coverage Complexity
ModuleView
0 %
0/16
N/A
1
 
 1  
 package org.jtheque.core.managers.view.impl.frame;
 2  
 
 3  
 /*
 4  
  * This file is part of JTheque.
 5  
  *
 6  
  * JTheque is free software: you can redistribute it and/or modify
 7  
  * it under the terms of the GNU General Public License as published by
 8  
  * the Free Software Foundation, either version 3 of the License.
 9  
  *
 10  
  * JTheque is distributed in the hope that it will be useful,
 11  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  
  * GNU General Public License for more details.
 14  
  *
 15  
  * You should have received a copy of the GNU General Public License
 16  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 17  
  */
 18  
 
 19  
 import org.jtheque.core.managers.module.beans.ModuleContainer;
 20  
 import org.jtheque.core.managers.update.Updatable;
 21  
 import org.jtheque.core.managers.view.able.components.IModel;
 22  
 import org.jtheque.core.managers.view.able.components.IModulesPanelView;
 23  
 import org.jtheque.core.managers.view.able.components.IUpdatablesPanelView;
 24  
 import org.jtheque.core.managers.view.able.update.IModuleView;
 25  
 import org.jtheque.core.managers.view.impl.components.LayerTabbedPane;
 26  
 import org.jtheque.core.managers.view.impl.components.panel.ModulesPanel;
 27  
 import org.jtheque.core.managers.view.impl.components.panel.UpdatablesPanel;
 28  
 import org.jtheque.core.managers.view.impl.frame.abstraction.SwingBuildedDialogView;
 29  
 import org.jtheque.core.utils.ui.PanelBuilder;
 30  
 import org.jtheque.utils.ui.GridBagUtils;
 31  
 
 32  
 import javax.swing.JComponent;
 33  
 
 34  
 /**
 35  
  * A view to display the modules.
 36  
  *
 37  
  * @author Baptiste Wicht
 38  
  */
 39  
 public final class ModuleView extends SwingBuildedDialogView<IModel> implements IModuleView {
 40  
     private IModulesPanelView modulesPanel;
 41  
     private IUpdatablesPanelView updatablesPanel;
 42  
 
 43  
     /**
 44  
      * Construct a new ModuleView. 
 45  
      */
 46  
     public ModuleView(){
 47  0
         super();
 48  
 
 49  0
         build();
 50  0
     }
 51  
 
 52  
     @Override
 53  
     protected void initView(){
 54  0
         setTitleKey("module.view.title");
 55  0
     }
 56  
 
 57  
     @Override
 58  
     protected void buildView(PanelBuilder builder){
 59  0
         LayerTabbedPane tabbed = new LayerTabbedPane();
 60  
 
 61  0
         modulesPanel = new ModulesPanel();
 62  0
         updatablesPanel = new UpdatablesPanel();
 63  
 
 64  0
         tabbed.addInternationalizedTab("modules.view.tab.modules", (JComponent) modulesPanel);
 65  0
         tabbed.addInternationalizedTab("modules.view.tab.updatables", (JComponent) updatablesPanel);
 66  
 
 67  0
         builder.add(tabbed, builder.gbcSet(0, 0, GridBagUtils.BOTH));
 68  0
     }
 69  
 
 70  
     @Override
 71  
     public ModuleContainer getSelectedModule() {
 72  0
         return modulesPanel.getSelectedModule();
 73  
     }
 74  
 
 75  
     @Override
 76  
     public Updatable getSelectedUpdatable() {
 77  0
         return updatablesPanel.getSelectedUpdatable();
 78  
     }
 79  
 
 80  
     @Override
 81  
     public void refreshList() {
 82  0
         modulesPanel.refresh();
 83  0
     }
 84  
 }