org.jtheque.core.managers.lifecycle
Class LifeCycleManager

java.lang.Object
  extended by org.jtheque.core.managers.lifecycle.LifeCycleManager
All Implemented Interfaces:
Internationalizable, ILifeCycleManager

public final class LifeCycleManager
extends java.lang.Object
implements ILifeCycleManager, Internationalizable

A JTheque application implementation. This class manage the cycle life of JTheque.

Author:
Baptiste Wicht

Constructor Summary
LifeCycleManager()
           
 
Method Summary
 void addFunctionListener(FunctionListener listener)
          Add function listener to receive function events from the application.
 void addTitleListener(TitleListener listener)
          Add title listener to receive title events from the application.
 void chooseCollection(java.lang.String collection, java.lang.String password, boolean create)
          Choose a collection.
 void exit()
          Exit the application.
 java.lang.String getCurrentFunction()
          Return the current function of the application.
 java.lang.String getTitle()
          Return the current title of the application.
 void initCycles()
          Init the cycles.
 void initTitle()
          Init the title.
 boolean isSecondPhaseDone()
          Indicate if the second phase is done or not.
 void launchNextPhase()
          Launch the next phase.
 void refreshText()
          Refresh the text.
 void removeFunctionListener(FunctionListener listener)
          Remove the specified function listener so that it no longer receives function events from the application.
 void removeTitleListner(TitleListener listener)
          Remove the specified title listener so that it no longer receives title events from the application.
 void restart()
          Restart the application.
 void setCurrentFunction(java.lang.String function)
          Set the current function of the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LifeCycleManager

public LifeCycleManager()
Method Detail

initCycles

public void initCycles()
Description copied from interface: ILifeCycleManager
Init the cycles.

Specified by:
initCycles in interface ILifeCycleManager

launchNextPhase

public void launchNextPhase()
Description copied from interface: ILifeCycleManager
Launch the next phase.

Specified by:
launchNextPhase in interface ILifeCycleManager

initTitle

public void initTitle()
Description copied from interface: ILifeCycleManager
Init the title.

Specified by:
initTitle in interface ILifeCycleManager

exit

public void exit()
Description copied from interface: ILifeCycleManager
Exit the application.

Specified by:
exit in interface ILifeCycleManager

restart

public void restart()
Description copied from interface: ILifeCycleManager
Restart the application.

Specified by:
restart in interface ILifeCycleManager

setCurrentFunction

public void setCurrentFunction(java.lang.String function)
Description copied from interface: ILifeCycleManager
Set the current function of the application.

Specified by:
setCurrentFunction in interface ILifeCycleManager
Parameters:
function - The internationalized key of the new current function. S

getCurrentFunction

public java.lang.String getCurrentFunction()
Description copied from interface: ILifeCycleManager
Return the current function of the application.

Specified by:
getCurrentFunction in interface ILifeCycleManager
Returns:
The internationalize key of the current function.

getTitle

public java.lang.String getTitle()
Description copied from interface: ILifeCycleManager
Return the current title of the application.

Specified by:
getTitle in interface ILifeCycleManager
Returns:
The current title.

addTitleListener

public void addTitleListener(TitleListener listener)
Description copied from interface: ILifeCycleManager
Add title listener to receive title events from the application. If the listener is null, no exception is thrown and no action is performed.

Specified by:
addTitleListener in interface ILifeCycleManager
Parameters:
listener - The title listener.

removeTitleListner

public void removeTitleListner(TitleListener listener)
Description copied from interface: ILifeCycleManager
Remove the specified title listener so that it no longer receives title events from the application. If the listener is null, no exception is thrown and no action is performed.

Specified by:
removeTitleListner in interface ILifeCycleManager
Parameters:
listener - The title listener.

addFunctionListener

public void addFunctionListener(FunctionListener listener)
Description copied from interface: ILifeCycleManager
Add function listener to receive function events from the application. If the listener is null, no exception is thrown and no action is performed.

Specified by:
addFunctionListener in interface ILifeCycleManager
Parameters:
listener - The function listener.

removeFunctionListener

public void removeFunctionListener(FunctionListener listener)
Description copied from interface: ILifeCycleManager
Remove the specified function listener so that it no longer receives function events from the application. If the listener is null, no exception is thrown and no action is performed.

Specified by:
removeFunctionListener in interface ILifeCycleManager
Parameters:
listener - The function listener.

chooseCollection

public void chooseCollection(java.lang.String collection,
                             java.lang.String password,
                             boolean create)
Description copied from interface: ILifeCycleManager
Choose a collection.

Specified by:
chooseCollection in interface ILifeCycleManager
Parameters:
collection - The name of the collection.
password - The password of the collection.
create - A boolean flag indicating if we must create the collection or not.

refreshText

public void refreshText()
Description copied from interface: Internationalizable
Refresh the text.

Specified by:
refreshText in interface Internationalizable

isSecondPhaseDone

public boolean isSecondPhaseDone()
Description copied from interface: ILifeCycleManager
Indicate if the second phase is done or not.

Specified by:
isSecondPhaseDone in interface ILifeCycleManager
Returns:
true if the second phase is done else false.


Copyright © 2009 JTheque. All Rights Reserved.