Coverage Report - org.jtheque.core.managers.view.impl.frame.LicenceView
 
Classes in this File Line Coverage Branch Coverage Complexity
LicenceView
0 %
0/9
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.Managers;
 20  
 import org.jtheque.core.managers.view.able.ILicenceView;
 21  
 import org.jtheque.core.managers.view.able.components.IModel;
 22  
 import org.jtheque.core.managers.view.impl.actions.about.PrintLicenseAction;
 23  
 import org.jtheque.core.managers.view.impl.frame.abstraction.SwingBuildedDialogView;
 24  
 import org.jtheque.core.utils.ui.PanelBuilder;
 25  
 import org.jtheque.utils.io.FileUtils;
 26  
 import org.jtheque.utils.ui.GridBagUtils;
 27  
 
 28  
 /**
 29  
  * A view to display the licence.
 30  
  *
 31  
  * @author Baptiste Wicht
 32  
  */
 33  
 public final class LicenceView extends SwingBuildedDialogView<IModel> implements ILicenceView {
 34  
     private static final int DEFAULT_WIDTH = 800;
 35  
     private static final int DEFAULT_HEIGHT = 600;
 36  
 
 37  
     /**
 38  
      * Construct a new LicenceView. 
 39  
      */
 40  
     public LicenceView(){
 41  0
         super();
 42  
 
 43  0
         build();
 44  0
     }
 45  
 
 46  
     @Override
 47  
     protected void initView(){
 48  0
         setTitleKey("licence.view.title", Managers.getCore().getApplication().getName());
 49  0
     }
 50  
 
 51  
     @Override
 52  
     protected void buildView(PanelBuilder builder){
 53  0
         builder.addScrolledTextArea(FileUtils.getTextOf(Managers.getCore().getApplication().getLicenceFilePath()),
 54  
                 builder.gbcSet(0, 0, GridBagUtils.BOTH, GridBagUtils.BELOW_BASELINE_LEADING, 1.0, 1.0));
 55  
 
 56  0
         builder.addButtonBar(builder.gbcSet(0, 1, GridBagUtils.HORIZONTAL),
 57  
                 new PrintLicenseAction(), getCloseAction("licence.actions.close"));
 58  
 
 59  0
         getManager().configureView(this, "licence", DEFAULT_WIDTH, DEFAULT_HEIGHT);
 60  0
     }
 61  
 }