org.moyoman.module
Class ModeConfig

java.lang.Object
  |
  +--org.moyoman.module.ModeConfig

public class ModeConfig
extends Object

This class provides methods for configuring the mode information. The mode and module information are related, so a change to mode information can also lead to a change in module information.


Field Summary
private  ModuleConfig mc
          The ModuleConfig object.
 
Constructor Summary
protected ModeConfig()
          Create a new ModeConfig object.
 
Method Summary
protected  void addMode(String newModeName, Mode oldMode)
          Create a new user defined mode.
protected  void cancel()
          Cancel any changes that have occurred since the last save() or cancel() call.
protected  void deleteMode(Mode mode)
          Delete the specified mode.
protected  void save()
          Save any changes that have occurred since the last save() or cancel() call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mc

private ModuleConfig mc
The ModuleConfig object.

Constructor Detail

ModeConfig

protected ModeConfig()
              throws InternalErrorException
Create a new ModeConfig object.

Throws:
InternalErrorException - Thrown if the operation fails for any reason.
Method Detail

addMode

protected void addMode(String newModeName,
                       Mode oldMode)
                throws DataAlreadyExistsException,
                       NoSuchDataException
Create a new user defined mode. The ordering of modules in the new mode will be exactly the same as in the old mode. No files are updated until the save() method is called.

Parameters:
newModeName - The name of the new mode.
Throws:
Exception - Thrown if the old mode does not exist, or if the new mode already exists.
DataAlreadyExistsException
NoSuchDataException

deleteMode

protected void deleteMode(Mode mode)
                   throws PermissionsException,
                          NoSuchDataException
Delete the specified mode.

Parameters:
mode - The mode to be deleted.
Throws:
PermissionsException - - Thrown if the mode is a standard mode.
NoSuchDataException - - Thrown if the mode does not exist.

cancel

protected void cancel()
               throws InternalErrorException
Cancel any changes that have occurred since the last save() or cancel() call.

Throws:
InternalErrorException - - Thrown if the operation fails for any reason.

save

protected void save()
             throws InternalErrorException
Save any changes that have occurred since the last save() or cancel() call.

Throws:
InternalErrorException - - Thrown if the operation fails for any reason.