Coverage Report - org.jtheque.core.managers.view.WindowManager
 
Classes in this File Line Coverage Branch Coverage Complexity
WindowManager
0 %
0/15
0 %
0/4
1.286
 
 1  
 package org.jtheque.core.managers.view;
 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.IConfigView;
 21  
 import org.jtheque.core.managers.view.able.ILicenceView;
 22  
 import org.jtheque.core.managers.view.able.IMainView;
 23  
 import org.jtheque.core.managers.view.able.IMessageView;
 24  
 import org.jtheque.core.managers.view.able.IViewManager;
 25  
 import org.jtheque.core.managers.view.able.components.TabComponent;
 26  
 import org.jtheque.core.managers.view.able.update.IModuleView;
 27  
 
 28  
 import javax.annotation.Resource;
 29  
 import javax.swing.JComponent;
 30  
 
 31  
 /**
 32  
  * A window manager implementation.
 33  
  *
 34  
  * @author Baptiste Wicht
 35  
  */
 36  0
 public final class WindowManager implements Views {
 37  
     @Resource
 38  
     private ILicenceView licenceView;
 39  
 
 40  
     @Resource
 41  
     private IConfigView configView;
 42  
 
 43  
     @Resource
 44  
     private IModuleView moduleView;
 45  
 
 46  
     @Resource
 47  
     private IMessageView messageView;
 48  
 
 49  
     @Override
 50  
     public void setSelectedView(TabComponent component) {
 51  0
         getMainView().setSelectedComponent(component.getComponent());
 52  0
     }
 53  
 
 54  
     @Override
 55  
     public TabComponent getSelectedView() {
 56  0
         TabComponent selected = null;
 57  
 
 58  0
         JComponent component = getMainView().getSelectedComponent();
 59  
 
 60  0
         for (TabComponent tab : Managers.getManager(IViewManager.class).getTabComponents()) {
 61  0
             if (tab.getComponent().equals(component)) {
 62  0
                 selected = tab;
 63  0
                 break;
 64  
             }
 65  
         }
 66  
 
 67  0
         return selected;
 68  
     }
 69  
 
 70  
     @Override
 71  
     public IMainView getMainView() {
 72  0
         return SplashManager.getInstance().getMainView();
 73  
     }
 74  
 
 75  
     @Override
 76  
     public ILicenceView getLicenceView() {
 77  0
         return licenceView;
 78  
     }
 79  
 
 80  
     @Override
 81  
     public IConfigView getConfigView() {
 82  0
         return configView;
 83  
     }
 84  
 
 85  
     @Override
 86  
     public IModuleView getModuleView() {
 87  0
         return moduleView;
 88  
     }
 89  
 
 90  
     @Override
 91  
     public IMessageView getMessagesView() {
 92  0
         return messageView;
 93  
     }
 94  
 }