Coverage Report - org.jtheque.primary.controller.able.IPrincipalController
 
Classes in this File Line Coverage Branch Coverage Complexity
IPrincipalController
N/A
N/A
1
 
 1  
 package org.jtheque.primary.controller.able;
 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.view.able.controller.Controller;
 20  
 import org.jtheque.primary.od.able.Data;
 21  
 import org.jtheque.primary.view.impl.models.able.IPrincipalDataModel;
 22  
 
 23  
 import javax.swing.event.TreeSelectionListener;
 24  
 import java.util.Collection;
 25  
 
 26  
 /**
 27  
  * @author Baptiste Wicht
 28  
  */
 29  
 public interface IPrincipalController<T extends Data> extends Controller, TreeSelectionListener {
 30  
         /**
 31  
          * Return the state state. This state is active when we show a data on the view.
 32  
          *
 33  
          * @return a new state to set or <code>null</code> if we doesn't must change state.
 34  
          */
 35  
         ControllerState getViewState();
 36  
 
 37  
         /**
 38  
          * Return the auto add state. This state is active when we add automatically a data.
 39  
          *
 40  
          * @return a new state to set or <code>null</code> if we doesn't must change state.
 41  
          */
 42  
         ControllerState getAutoAddState();
 43  
 
 44  
         /**
 45  
          * Return the modify state. This state is active when we modify a data.
 46  
          *
 47  
          * @return a new state to set or <code>null</code> if we doesn't must change state.
 48  
          */
 49  
         ControllerState getModifyState();
 50  
 
 51  
         /**
 52  
          * Return the new object state. This state is active when we add a new data.
 53  
          *
 54  
          * @return a new state to set or <code>null</code> if we doesn't must change state.
 55  
          */
 56  
         ControllerState getNewObjectState();
 57  
 
 58  
         /**
 59  
          * Return the model of the view managed by the controller.
 60  
          *
 61  
          * @return The model of the view.
 62  
          */
 63  
         IPrincipalDataModel<T> getViewModel();
 64  
 
 65  
         /**
 66  
          * Return the associated data type.
 67  
          *
 68  
          * @return The associated data type.
 69  
          */
 70  
         String getDataType();
 71  
 
 72  
         /**
 73  
          * Return the display list.
 74  
          *
 75  
          * @return The display list.
 76  
          */
 77  
         Collection<T> getDisplayList();
 78  
 
 79  
         /**
 80  
          * Save the current data with the informations of the specified form bean.
 81  
          *
 82  
          * @param formBean The form bean.
 83  
          */
 84  
         void save(FormBean formBean);
 85  
 
 86  
         /**
 87  
          * View the specified data.
 88  
          *
 89  
          * @param data The data to view.
 90  
          */
 91  
         void view(T data);
 92  
 
 93  
         /**
 94  
          * Edit manually the current data.
 95  
          */
 96  
         void manualEdit();
 97  
 
 98  
         /**
 99  
          * Create a new data.
 100  
          */
 101  
         void create();
 102  
 
 103  
         /**
 104  
          * Delete the current data.
 105  
          */
 106  
         void deleteCurrent();
 107  
 
 108  
         /**
 109  
          * Cancel the current operation.
 110  
          */
 111  
         void cancel();
 112  
 }