Coverage Report - org.jtheque.films.view.impl.panels.principals.AbstractPrincipalDataPanel
 
Classes in this File Line Coverage Branch Coverage Complexity
AbstractPrincipalDataPanel
0 %
0/16
N/A
1
 
 1  
 package org.jtheque.films.view.impl.panels.principals;
 2  
 
 3  
 import org.jdesktop.swingx.JXTree;
 4  
 import org.jtheque.core.managers.view.able.components.IModel;
 5  
 import org.jtheque.primary.controller.able.FormBean;
 6  
 import org.jtheque.primary.view.able.ToolbarView;
 7  
 import org.jtheque.primary.view.impl.components.panels.PrincipalDataPanel;
 8  
 import org.jtheque.primary.view.impl.renderers.JThequeTreeCellRenderer;
 9  
 import org.jtheque.primary.view.impl.sort.SortManager;
 10  
 
 11  
 /*
 12  
  * This file is part of JTheque.
 13  
  *            
 14  
  * JTheque is free software: you can redistribute it and/or modify
 15  
  * it under the terms of the GNU General Public License as published by
 16  
  * the Free Software Foundation, either version 3 of the License. 
 17  
  *
 18  
  * JTheque is distributed in the hope that it will be useful,
 19  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 20  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 21  
  * GNU General Public License for more details.
 22  
  *
 23  
  * You should have received a copy of the GNU General Public License
 24  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 25  
  */
 26  
 
 27  
 public abstract class AbstractPrincipalDataPanel<M extends IModel> extends PrincipalDataPanel<M> {
 28  
     private ToolbarView toolBar;
 29  
     private JXTree tree;
 30  
 
 31  
     private final String dataType;
 32  
 
 33  0
     private static final SortManager SORTER = new SortManager();
 34  
     
 35  
     public AbstractPrincipalDataPanel(String dataType) {
 36  0
         super();
 37  
         
 38  0
         this.dataType = dataType;
 39  0
     }
 40  
 
 41  
     @Override
 42  
     public final Object getImpl() {
 43  0
         return this;
 44  
     }
 45  
 
 46  
     @Override
 47  
     public final ToolbarView getToolbarView() {
 48  0
         return toolBar;
 49  
     }
 50  
 
 51  
     @Override
 52  
     public void clear() {
 53  
         //Nothing to do by default
 54  0
     }
 55  
     
 56  
     @Override
 57  
     protected final JXTree getTree() {
 58  0
         return tree;
 59  
     }
 60  
 
 61  
     @Override
 62  
     public final String getDataType() {
 63  0
         return dataType;
 64  
     }
 65  
     
 66  
     final void setToolBar(ToolbarView toolBar) {
 67  0
         this.toolBar = toolBar;
 68  0
     }
 69  
 
 70  
     final void initTree(){
 71  0
         tree = new JXTree(getTreeModel());
 72  0
         tree.setCellRenderer(new JThequeTreeCellRenderer());
 73  0
         tree.putClientProperty("JTree.lineStyle", "None");
 74  0
     }
 75  
 
 76  
     static SortManager getSorter() {
 77  0
         return SORTER;
 78  
     }
 79  
 
 80  
     public abstract void fillFormBean(FormBean fb);
 81  
 
 82  
     public abstract void setCurrent(Object object);
 83  
 }