 	@STATE_ACTIVATED = "activated"
 	@STATE_DEACTIVATED = "deactivated"
 
+	@MODE_EXCLUSIVE = 'exclusive'
+	@MODE_MULTI = 'multi'
+
 	#
 	# Options:
 	# defaultChild		Controller
 	#
 	
 	constructor: (options={}) ->
+		@mode = options.mode ||= Controller.MODE_EXCLUSIVE
+
 		@sm = new StateMachine
 		
 		defaultState = options.defaultState
-		
+
 		@sm.addState Controller.STATE_DEACTIVATED, defaultState == Controller.STATE_ACTIVATED ? false : true
 		@sm.addState Controller.STATE_ACTIVATED, defaultState == Controller.STATE_ACTIVATED ? true : false
 		

		unless @lineageIsBusy(c)
			if !c.isActive()
				return ControllerHelper.activateController(c)
	
	@deactivate: (c) ->
		unless @lineageIsBusy(c)
			if c.isActive()
				return ControllerHelper.deactivateController(c)
	
	@toggle: (c) ->
		if c.isActive()
			return @deactivate c

		
		if parent
			if parent.isActive()

				# We only care about sibling states if the parent is in exlusive mode. Multi mode is usful in implementations like lists, where it's desired to mange the transitions of many concurrent children.
				if parent.mode == "exclusive"
					siblings = parent.getChildren()
					#console.log "Siblings: #{siblings}"
					for sibling in siblings
						if sibling.isActive()
							sibling.setOnDeactivatedAction new ControllerAction(c, ControllerAction.TYPE_ACTIVATE)
							return ControllerHelper.deactivateController(sibling)
			else
				parent.setOnActivatedAction new ControllerAction(c, ControllerAction.TYPE_ACTIVATE)
				return ControllerHelper.activateController parent
