Coverage Report - org.jtheque.core.managers.lifecycle.ILifeCycleManager
 
Classes in this File Line Coverage Branch Coverage Complexity
ILifeCycleManager
N/A
N/A
1
 
 1  
 package org.jtheque.core.managers.lifecycle;
 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.lifecycle.listeners.FunctionListener;
 20  
 import org.jtheque.core.managers.lifecycle.listeners.TitleListener;
 21  
 
 22  
 /**
 23  
  * A JTheque application.
 24  
  *
 25  
  * @author Baptiste Wicht
 26  
  */
 27  
 public interface ILifeCycleManager {
 28  
     /**
 29  
      * Exit the application.
 30  
      */
 31  
     void exit();
 32  
 
 33  
     /**
 34  
      * Restart the application.
 35  
      */
 36  
     void restart();
 37  
 
 38  
     /**
 39  
      * Return the current title of the application.
 40  
      *
 41  
      * @return The current title.
 42  
      */
 43  
     String getTitle();
 44  
 
 45  
     /**
 46  
      * Add title listener to receive title events from the application. If the listener is null, no exception is
 47  
      * thrown and no action is performed.
 48  
      *
 49  
      * @param listener The title listener.
 50  
      */
 51  
     void addTitleListener(TitleListener listener);
 52  
 
 53  
     /**
 54  
      * Remove the specified title listener so that it no longer receives title events from the application. If
 55  
      * the listener is null, no exception is thrown and no action is performed.
 56  
      *
 57  
      * @param listener The title listener.
 58  
      */
 59  
     void removeTitleListener(TitleListener listener);
 60  
 
 61  
     /**
 62  
      * Add function listener to receive function events from the application. If the listener is null, no exception
 63  
      * is thrown and no action is performed.
 64  
      *
 65  
      * @param listener The function listener.
 66  
      */
 67  
     void addFunctionListener(FunctionListener listener);
 68  
 
 69  
     /**
 70  
      * Remove the specified function listener so that it no longer receives function events from the application. If
 71  
      * the listener is null, no exception is thrown and no action is performed.
 72  
      *
 73  
      * @param listener The function listener.
 74  
      */
 75  
     void removeFunctionListener(FunctionListener listener);
 76  
 
 77  
     /**
 78  
      * Return the current function of the application.
 79  
      *
 80  
      * @return The internationalize key of the current function.
 81  
      */
 82  
     String getCurrentFunction();
 83  
 
 84  
     /**
 85  
      * Set the current function of the application.
 86  
      *
 87  
      * @param function The internationalized key of the new current function. S
 88  
      */
 89  
     void setCurrentFunction(String function);
 90  
 
 91  
     /**
 92  
      * Indicate if the second phase is done or not.
 93  
      *
 94  
      * @return true if the second phase is done else false.
 95  
      */
 96  
     boolean isSecondPhaseDone();
 97  
 
 98  
     /**
 99  
      * Choose a collection.
 100  
      *
 101  
      * @param name     The name of the collection.
 102  
      * @param password The password of the collection.
 103  
      * @param create   A boolean flag indicating if we must create the collection or not.
 104  
      */
 105  
     void chooseCollection(String name, String password, boolean create);
 106  
 
 107  
     /**
 108  
      * Launch the next phase.
 109  
      */
 110  
     void launchNextPhase();
 111  
 
 112  
     /**
 113  
      * Init the title.
 114  
      */
 115  
     void initTitle();
 116  
 
 117  
     /**
 118  
      * Init the cycles.
 119  
      */
 120  
     void initCycles();
 121  
 }