ConForM.CoopnTools.CoKer
Class CoopnEnvMgr

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.CoopnEnvMgr
Direct Known Subclasses:
CheckerEnvMgr, CoalaCheckerEnvMgr, CodeEnvMgr, ConsEnvMgr, CoopnInstEnvMgr, DocEnvMgr, DocVEnvMgr, EditEnvMgr, EvaluatorEnvMgr, FormatterEnvMgr, HLPNEnvMgr, InterpretorEnvMgr, JavaProtoEnvMgr, ListingEnvMgr, ModuleEnvMgr, PackEnvMgr, SimulatorEnvMgr, SpecEnvMgr, ViewerEnvMgr

public class CoopnEnvMgr
extends java.lang.Object

Management of CO-OPN tools environments. This class allows to create new environments, to initialise them according to either the command line or an apposite display, and to print the help text.

See Also:
ProjectEnv

Field Summary
protected  boolean atLeastOneModule
           
protected  boolean atMostOneModule
           
protected  CoopnEnv env
           
protected  java.io.PrintWriter errStream
           
protected  boolean noModules
           
 
Constructor Summary
CoopnEnvMgr(CoopnEnv env)
          Creates a new environment manager based on an existing environment.
CoopnEnvMgr(CoopnUser name)
          Creates a new environment manager, along with a new environment.
CoopnEnvMgr(java.lang.String name)
          Creates a new environment manager, along with a new environment.
 
Method Summary
protected  void addOption(CoopnOption option)
           
 void checkEnvForModuleNumber(CoopnEnv env)
          Check the environment consistency with regards to the asked module number in this environment manager.
protected  CoopnEnv createEnvFromName(java.lang.String name)
           
protected  CoopnEnv createEnvFromUser(CoopnUser name)
           
 CoopnEnv getEnv()
          Returns the associated environment.
 void helpCoopnTools(boolean error)
          Prints an help text.
 void initCoopnTools(CoopnEnv env)
          Initialise the environment of a CoopnTool.
 void initCoopnTools(java.lang.String[] args)
          Initialise the environment of a CoopnTool.
 void modifyEnv()
          Modify the environment of a CoopnTool.
protected  boolean updateEnv(java.util.Map decodedOptions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

env

protected CoopnEnv env

errStream

protected java.io.PrintWriter errStream

noModules

protected boolean noModules

atMostOneModule

protected boolean atMostOneModule

atLeastOneModule

protected boolean atLeastOneModule
Constructor Detail

CoopnEnvMgr

public CoopnEnvMgr(java.lang.String name)
            throws CoopnEnvException
Creates a new environment manager, along with a new environment.
Parameters:
name - the tool name
Throws:
CoopnEnvException - error during the creation of the manager. In this case, the error stream is appended with the descriptions of the errors.

CoopnEnvMgr

public CoopnEnvMgr(CoopnUser name)
            throws CoopnEnvException
Creates a new environment manager, along with a new environment.
Parameters:
name - the user name
Throws:
CoopnEnvException - error during the creation of the manager. In this case, the error stream is appended with the descriptions of the errors.

CoopnEnvMgr

public CoopnEnvMgr(CoopnEnv env)
            throws CoopnEnvException
Creates a new environment manager based on an existing environment.
Parameters:
env - an environment used as the base of the new one
Throws:
CoopnEnvException - error during the creation of the manager. In this case, the error stream is appended with the descriptions of the errors.
Method Detail

getEnv

public CoopnEnv getEnv()
                throws CoopnEnvException
Returns the associated environment.
Throws:
CoopnEnvException - error during the creation of the manager. In this case, the error stream is appended with the descriptions of the errors.

initCoopnTools

public void initCoopnTools(java.lang.String[] args)
                    throws CoopnEnvException
Initialise the environment of a CoopnTool. The environment is completed either from an array of strings representing the command line, or from a dialog window.
Parameters:
args - the command line
Throws:
CoopnEnvException - one or more errors occured during the initialisation of the environment. In this case, the error stream is appended with the descriptions of the errors.

initCoopnTools

public void initCoopnTools(CoopnEnv env)
                    throws CoopnEnvException
Initialise the environment of a CoopnTool. The environment is completed from an existing one.
Parameters:
env - the existing environment
Throws:
CoopnEnvException - one or more errors occured during the initialisation of the environment. In this case, the error stream is appended with the descriptions of the errors.

modifyEnv

public void modifyEnv()
Modify the environment of a CoopnTool. The environment is completed from an existing one.
Parameters:
env - the existing environment

checkEnvForModuleNumber

public void checkEnvForModuleNumber(CoopnEnv env)
                             throws CoopnEnvException
Check the environment consistency with regards to the asked module number in this environment manager.
Parameters:
env - the environment to check
Throws:
CoopnEnvException - inconsistency.

helpCoopnTools

public void helpCoopnTools(boolean error)
Prints an help text. Useful for tools without specific environment.
Parameters:
error - uses error output instead of env.out

createEnvFromName

protected CoopnEnv createEnvFromName(java.lang.String name)

createEnvFromUser

protected CoopnEnv createEnvFromUser(CoopnUser name)

addOption

protected final void addOption(CoopnOption option)

updateEnv

protected boolean updateEnv(java.util.Map decodedOptions)