Coverage Report - org.jtheque.core.managers.view.impl.components.panel.UpdatablesPanel
 
Classes in this File Line Coverage Branch Coverage Complexity
UpdatablesPanel
0 %
0/6
N/A
1
 
 1  
 package org.jtheque.core.managers.view.impl.components.panel;
 2  
 
 3  
 import org.jtheque.core.managers.update.Updatable;
 4  
 import org.jtheque.core.managers.view.able.components.IUpdatablesPanelView;
 5  
 import org.jtheque.core.managers.view.impl.actions.module.UpdateUpdatableAction;
 6  
 import org.jtheque.core.managers.view.impl.components.model.UpdatableListModel;
 7  
 import org.jtheque.core.managers.view.impl.components.renderers.UpdatableListRenderer;
 8  
 import org.jtheque.core.utils.ui.PanelBuilder;
 9  
 import org.jtheque.utils.ui.GridBagUtils;
 10  
 
 11  
 import javax.swing.JList;
 12  
 import javax.swing.JPanel;
 13  
 
 14  
 /*
 15  
  * This file is part of JTheque.
 16  
  *
 17  
  * JTheque is free software: you can redistribute it and/or modify
 18  
  * it under the terms of the GNU General Public License as published by
 19  
  * the Free Software Foundation, either version 3 of the License.
 20  
  *
 21  
  * JTheque is distributed in the hope that it will be useful,
 22  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 23  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 24  
  * GNU General Public License for more details.
 25  
  *
 26  
  * You should have received a copy of the GNU General Public License
 27  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 28  
  */
 29  
 
 30  
 /**
 31  
  * An updatable panel view implementation.
 32  
  *
 33  
  * @author Baptiste Wicht
 34  
  */
 35  
 public final class UpdatablesPanel extends JPanel implements IUpdatablesPanelView {
 36  
     private final JList updatablesList;
 37  
 
 38  
     /**
 39  
      * Construct a new UpdatablesPanel. 
 40  
      */
 41  
     public UpdatablesPanel(){
 42  0
         super();
 43  
 
 44  0
         PanelBuilder builder = new PanelBuilder(this);
 45  
 
 46  0
         updatablesList = builder.addList(new UpdatableListModel(), new UpdatableListRenderer(), builder.gbcSet(0, 0, GridBagUtils.BOTH, GridBagUtils.FIRST_LINE_START));
 47  
 
 48  0
         builder.addButtonBar(builder.gbcSet(0, 1, GridBagUtils.HORIZONTAL, GridBagUtils.FIRST_LINE_START),
 49  
                 new UpdateUpdatableAction());
 50  0
     }
 51  
 
 52  
     @Override
 53  
     public Updatable getSelectedUpdatable() {
 54  0
         return (Updatable) updatablesList.getSelectedValue();
 55  
     }
 56  
 }