PureMVC Framework for Haxe: API Documentation
Back | Index
class org.puremvc.haxe.patterns.command.MacroCommand
extends org.puremvc.haxe.patterns.observer.Notifier
implements org.puremvc.haxe.interfaces.ICommand

A base `ICommand` implementation that executes other `ICommand`s.

A `MacroCommand` maintains an list of `ICommand` Class references called SubCommands.

When `execute` is called, the `MacroCommand` instantiates and calls `execute` on each of its SubCommands turn. Each SubCommand will be passed a reference to the original `INotification` that was passed to the `MacroCommand`'s `execute` method.

Unlike `SimpleCommand`, your subclass should not override `execute`, but instead, should override the `initializeMacroCommand` method, calling `addSubCommand` once for each SubCommand to be executed.

function new() : Void

  Constructor.

  You should not need to define a constructor, instead, override the `initializeMacroCommand` method.

  If your subclass does define a constructor, be sure to call `super()`.

function execute(notification : org.puremvc.haxe.interfaces.INotification) : Void

Back | Index