利用者向け情報

開発者向け情報

[sandbox.akabana]/trunk/yui-frameworks/yui-command/src/main/flex/org/seasar/akabana/yui/command/SequenceCommand.as

Parent Directory Parent Directory | Revision Log Revision Log


Revision 696 - (show annotations)
Fri Apr 10 17:28:20 2009 JST (4 years, 1 month ago) by e1arkw
Original Path: trunk/yui/yui-command/src/main/flex/org/seasar/akabana/yui/command/SequenceCommand.as
File size: 1776 byte(s)


1 /*
2 * Copyright 2004-2009 the Seasar Foundation and the Others.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13 * either express or implied. See the License for the specific language
14 * governing permissions and limitations under the License.
15 */
16 package org.seasar.akabana.yui.command
17 {
18 import org.seasar.akabana.yui.command.core.Command;
19 import org.seasar.akabana.yui.command.core.impl.AbstractComplexCommand;
20 import org.seasar.akabana.yui.command.events.CommandEvent;
21
22 public class SequenceCommand extends AbstractComplexCommand
23 {
24 public override function start(...args):Command
25 {
26 currentCommandIndex = 0;
27 commandArguments = args;
28 doStartCommand();
29 return this;
30 }
31
32 protected override function commandCompleteEventHandler(event:CommandEvent):void{
33 if( childCompleteEventHandler != null ){
34 childCompleteEventHandler(event);
35 }
36 currentCommandIndex++;
37 if( currentCommandIndex < commands.length ){
38 doStartCommand();
39 } else {
40 dispatchCompleteEvent();
41 }
42 }
43
44 protected override function commandErrorEventHandler(event:CommandEvent):void{
45 dispatchErrorEvent(event);
46 }
47
48 }
49 }

Repository Top
ViewVC Help  
ViewVC logotype
Powered by ViewVC