Coverage Report - org.jtheque.films.view.impl.panels.principals.AbstractPrincipalDelegatedView
 
Classes in this File Line Coverage Branch Coverage Complexity
AbstractPrincipalDelegatedView
0 %
0/25
N/A
1
 
 1  
 package org.jtheque.films.view.impl.panels.principals;
 2  
 
 3  
 import org.jtheque.core.managers.view.able.components.IModel;
 4  
 import org.jtheque.core.managers.view.able.components.TabComponent;
 5  
 import org.jtheque.films.view.impl.AbstractDelegatedView;
 6  
 import org.jtheque.primary.od.able.Data;
 7  
 import org.jtheque.primary.view.able.PrincipalDataView;
 8  
 import org.jtheque.primary.view.able.ToolbarView;
 9  
 import org.jtheque.primary.view.impl.listeners.CurrentObjectListener;
 10  
 import org.jtheque.primary.view.impl.listeners.ObjectChangedEvent;
 11  
 
 12  
 import javax.swing.JComponent;
 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  0
 public abstract class AbstractPrincipalDelegatedView extends AbstractDelegatedView implements PrincipalDataView, CurrentObjectListener, TabComponent {
 31  
     private AbstractPrincipalDataPanel<? extends IModel> view;
 32  
 
 33  
     private final int position;
 34  
     private final String titleKey;
 35  
 
 36  
     protected AbstractPrincipalDelegatedView(int position, String titleKey) {
 37  0
         super();
 38  
         
 39  0
         this.position = position;
 40  0
         this.titleKey = titleKey;
 41  0
     }
 42  
 
 43  
     @Override
 44  
     public Integer getPosition() {
 45  0
         return position;
 46  
     }
 47  
 
 48  
     @Override
 49  
     public String getTitleKey() {
 50  0
         return titleKey;
 51  
     }
 52  
     
 53  
     @Override
 54  
     public JComponent getComponent() {
 55  0
         return view; 
 56  
     }
 57  
 
 58  
     @Override
 59  
     public void select(Data data) {
 60  0
         view.select(data);
 61  0
     }
 62  
 
 63  
     @Override
 64  
     public void sort(String sort) {
 65  0
         view.sort(sort);
 66  0
     }
 67  
 
 68  
     @Override
 69  
     public void resort() {
 70  0
         view.resort();
 71  0
     }
 72  
 
 73  
     @Override
 74  
     public void selectFirst() {
 75  0
         view.selectFirst();
 76  0
     }
 77  
 
 78  
     @Override
 79  
     public ToolbarView getToolbarView() {
 80  0
         return view.getToolbarView();
 81  
     }
 82  
     
 83  
     @Override
 84  
     public IModel getModel() {
 85  0
         return view.getModel();
 86  
     }
 87  
 
 88  
     @Override
 89  
     public void clear() {
 90  0
         view.clear();
 91  0
     }
 92  
     
 93  
     @Override
 94  
     public void objectChanged(ObjectChangedEvent event) {
 95  0
         view.setCurrent(event.getObject());
 96  0
     }
 97  
 
 98  
     @Override
 99  
     public AbstractPrincipalDataPanel<? extends IModel> getImplementationView() {
 100  0
         return view;
 101  
     }
 102  
 
 103  
     public void setView(AbstractPrincipalDataPanel<? extends IModel> view) {
 104  0
         this.view = view;
 105  0
     }
 106  
 }