锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产亚洲精品国产,久久精品国产亚洲Aⅴ香蕉,亚洲国产精品成人http://www.tkk7.com/iwinyeah/category/30292.htmlzh-cnSun, 23 Mar 2008 01:15:06 GMTSun, 23 Mar 2008 01:15:06 GMT60[瀵煎叆]OpenBaseMovil Action <--> View <--> Controllerhttp://www.tkk7.com/iwinyeah/archive/2008/03/17/187974.htmliwinyeahiwinyeahMon, 17 Mar 2008 06:06:00 GMThttp://www.tkk7.com/iwinyeah/archive/2008/03/17/187974.htmlhttp://www.tkk7.com/iwinyeah/comments/187974.htmlhttp://www.tkk7.com/iwinyeah/archive/2008/03/17/187974.html#Feedback0http://www.tkk7.com/iwinyeah/comments/commentRss/187974.htmlhttp://www.tkk7.com/iwinyeah/services/trackbacks/187974.html 緗戠珯: JavaEye  浣滆? iwinyeah  閾炬帴錛?a style="color:red;">http://iwinyeah.javaeye.com/blog/172974  鍙戣〃鏃墮棿: 2008騫?3鏈?7鏃?

澹版槑錛氭湰鏂囩郴JavaEye緗戠珯鍙戝竷鐨勫師鍒涘崥瀹㈡枃绔狅紝鏈粡浣滆呬功闈㈣鍙紝涓ョ浠諱綍緗戠珯杞澆鏈枃錛屽惁鍒欏繀灝嗚拷絀舵硶寰嬭矗浠伙紒

Action: 瑙勫畾浜嗕笌鐢ㄦ埛浜や簰鐨刅iew鍙互瑙﹀彂鐨勫姩浣?鍦ㄦ煇涓猇iew鏂板緩涔嬪悗鏄劇ず涔嬪墠,搴斿厛涓哄叾鎸囧畾鍏蜂綋鐨凙ction,褰撶敤鎴鋒寜涓嬩簡鐩稿簲鐨凜ommand鎸夐挳涔嬪悗錛孷iew灝嗚Command瀵瑰簲鐨凙ction鍙戦佸埌璇iew鐨凜ontroller榪涜澶勭悊銆?
//
public class Action{
    String name; // 鍚嶇О 
    Command command; // 鍛戒護 
    int code; // 浠g爜 (灝嗙敱璇iew鐨勪紶閫掑埌鍏禖ontroller浣跨敤)
    Item item; // 鏁版嵁欏?
    boolean defaultAction; // 鏄惁鏄粯璁ょ殑Action 
    //...鐪佺暐
}


璇風(fēng)湅View鐨勫熀綾葷殑浠g爜鑺傞?
public abstract class AbstractView{

    //...鐪佺暐

    // 涓鴻View澧炲姞Action
    public void addAction( final Action action, final boolean active )
    {
        if( !actions.containsKey( action.getName() ) )
        {
            // 灝咥ction瀛樺叆Actions琛ㄤ腑
            actions.put( action.getName(), action );
            if( active )
            {
                activateAction( action );
            }
        }
    }

    // 浣緼ction鐢熸晥鍙敤
    private void activateAction( final Action action )
    {
        final Command command = action.getCommand();
        activeActions.put( command, action );
        final Item item = action.getItem();
        if( item == null )
        {
            addCommand( command ); // 璇ction鏄睆騫曠浉鍏崇殑鍛戒護
        }
        else
        {
            item.addCommand( command ); // 璇ction鏄暟鎹」鐩稿叧鐨勫懡浠?
            if( action.isDefaultAction() )
            {
                item.setDefaultCommand( command );
            }
        }
    }

    //...鐪佺暐

    // 鐢ㄦ埛鎸変笅鐩稿簲鐨勫懡浠ら敭鍚?瑙﹀彂鎵ц涓庡叾鍏寵仈鐨凙ction
    public void commandAction(
            final Command       command,
            final Displayable   displayable
    )
    {
        if( !handleAction( command ) )
        {
            if( displayable instanceof Choice )
            {
                AbstractController.commandAction(
                        this,
                        command,
                        (Choice) displayable
                );
            }
            else
            {
                AbstractController.commandAction( this, command );
            }
        }
    }

    // 鐢ㄦ埛鍦ㄦ煇涓寚瀹氫簡鍛戒護鐨処tem鎸変笅浜嗗懡浠ゆ寜閽椂瑙﹀彂鎵ц涓庡叾鍏寵仈鐨凙ction
    public void commandAction( final Command command, final Item item )
    {
        if( !handleAction( command ) )
        {
            AbstractController.commandAction( this, command );
        }
    }

    // 鏍規(guī)嵁鎵瑙﹀彂鐨勫懡浠ゆ煡鎵懼叧鑱旂殑Action,騫舵柊瀹冨彂閫佸埌Controller榪涜澶勭悊
    public boolean handleAction( final Command command )
    {
        if( activeActions.containsKey( command ) )
        {
            final Action action = (Action) activeActions.get( command );
            // 浠ction浠g爜涓哄弬鏁扮敓鎴怌ontrollerEvent騫朵紶閫掑埌controller澶勭悊
            final ControllerEvent event = new ControllerEvent(
                    action.getCode(),
                    this
            );
            controller.handle( event );
            return true;
        }
        else
        {
            return false;
        }
    }

    //...鐪佺暐

}

鏈枃鐨勮璁轟篃寰堢簿褰╋紝嫻忚璁ㄨ>>


JavaEye鎺ㄨ崘




鏂囩珷鏉ユ簮:http://iwinyeah.javaeye.com/blog/172974

iwinyeah 2008-03-17 14:06 鍙戣〃璇勮
]]>
[瀵煎叆]OpenBaseMovil StreamParser 嫻佹爣璇嗙鍒嗘鍣?/title><link>http://www.tkk7.com/iwinyeah/archive/2008/03/12/187977.html</link><dc:creator>iwinyeah</dc:creator><author>iwinyeah</author><pubDate>Tue, 11 Mar 2008 23:03:00 GMT</pubDate><guid>http://www.tkk7.com/iwinyeah/archive/2008/03/12/187977.html</guid><wfw:comment>http://www.tkk7.com/iwinyeah/comments/187977.html</wfw:comment><comments>http://www.tkk7.com/iwinyeah/archive/2008/03/12/187977.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/iwinyeah/comments/commentRss/187977.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/iwinyeah/services/trackbacks/187977.html</trackback:ping><description><![CDATA[ <br/> 緗戠珯: <a >JavaEye</a>  浣滆? <a >iwinyeah</a>  閾炬帴錛?a style="color:red;">http://iwinyeah.javaeye.com/blog/170335</a>  鍙戣〃鏃墮棿: 2008騫?3鏈?2鏃? <br/><br/> 澹版槑錛氭湰鏂囩郴JavaEye緗戠珯鍙戝竷鐨勫師鍒涘崥瀹㈡枃绔狅紝鏈粡浣滆呬功闈㈣鍙紝涓ョ浠諱綍緗戠珯杞澆鏈枃錛屽惁鍒欏繀灝嗚拷絀舵硶寰嬭矗浠伙紒 <br/><br/> 鍦ㄥ鐞嗚祫婧愭枃浠舵椂錛屾垜浠ュ墠鐨勫仛娉曟槸涓嬈℃ц鍏ヨ祫婧愭枃浠訛紝鐒跺悗鍐嶈繘琛屽鐞嗭紝鍦ㄥ鐞嗗ぇ鏂囦歡鏃訛紝榪欑鏂規(guī)硶瀵圭敱浜庡鏈哄櫒鍐呭瓨娑堣楄緝澶ц屽瓨鍦ㄩ殣鎮(zhèn)o紝鍒氭兂灝嗗畠鏀逛負(fù)閫愬瓧璇誨叆鐨勬柟寮忥紝鍦∣penBaseMovil涓彂鐜頒簡榪欎釜綾伙紝寰堢鍚堟垜鐨勮姹傘傚叧閿唬鐮佸涓嬶細(xì) <br /><pre name="code" class="java"> //... 鐪佺暐 public static final String WHITESPACE = "\r\n\t "; public String next(final String delimiters, final boolean keepWhitespace, final boolean allowComments, final boolean reuseDelimiter, final boolean processEscape) throws IOException { try { final StringBuffer token = new StringBuffer(); startLine = endLine; startChar = endChar; int c = in.read(); endChar++; int status = INITIAL; while (c != -1) { // 鑻ヨ繕鏈鍒版枃浠跺熬 if (c == '\n') { endLine++; endChar = 0; } switch (status) { case INITIAL: if (delimiters.indexOf(c) > -1) { // 濡傛灉鏄垎闅旂 lastDelimiter = (char) c; if (isWhiteSpace(c)) { // 濡傛灉鍚屾椂涔熸槸絀虹櫧絎﹀茍涓旀爣璇嗙闀垮害澶т簬闆跺垯榪斿洖鏍囪瘑絎? if (token.length() > 0) { if (reuseDelimiter) { // 濡傛灉瑕侀噸鐢ㄥ垎闅旂鍒欏皢瀹冩帹鍥炶緭鍏ユ祦涓? in.revert((char) c); } return token.toString(); } // 濡傛灉榪樻湭鏈夋暟鎹紝榪樿緇х畫寰涓嬭 } else { // 濡傛灉涓嶆槸絀虹櫧絎﹀垯鏃犺鏍囪瘑絎﹂暱搴︽槸鍚︿負(fù)闆訛紝閮借榪斿洖 if (reuseDelimiter) { in.revert((char) c); } return token.toString(); } } else if (processEscape && c == '\\') { status = ESCAPE; // 璁捐漿涔夊瓧絎︽爣蹇? } else if (allowComments && c == '/') { status = COMMENT_START; // 璁炬敞閲婃爣蹇? } else if (isWhiteSpace(c)) { if (keepWhitespace) { // 濡傛灉絀虹櫧絎︿篃瑕佺敤錛屾妸瀹冨姞鍏ユ爣璇嗙涓? token.append((char) c); } } else { token.append((char) c); } break; case ESCAPE: // 澶勭悊杞箟瀛楃 switch (c) { case 'n': token.append('\n'); break; case 'r': token.append('\r'); break; case 't': token.append('\t'); break; case 'b': token.append('\b'); break; case 'f': token.append('\f'); break; default: token.append((char) c); break; } status = INITIAL; // 璁炬甯告儏鍐墊爣蹇? break; case COMMENT_START: // 澶勭悊娉ㄩ噴 if (c == '/') { status = LINE_COMMENT; // 鏄寮忔敞閲? } else if (c == '*') { status = BLOCK_COMMENT; // 鏄潡寮忔敞閲? } else { status = INITIAL; // 濡傛灉閮戒笉鏄垯鎶婃敞閲婅搗濮嬬鍜屽垰璇誨叆鐨勫瓧絎﹂兘鍔犲叆鍒版爣璇嗙涓? token.append('/').append((char) c); } break; case LINE_COMMENT: if (c == '\n') { status = INITIAL; // 濡傛灉褰撳墠涓鴻娉ㄩ噴鐘舵佸垯瑕佷竴鐩磋鍒拌灝炬墠鎭㈠姝e父鎯呭喌鏍囧織 } break; case BLOCK_COMMENT: if (c == '*') { status = COMMENT_END; // 濡傛灉褰撳墠涓哄潡娉ㄩ噴鐘舵佸垯瑕佷竴鐩磋鍒?鍙瘋涓哄潡娉ㄩ噴緇撴潫鐘舵? } break; case COMMENT_END: if (c == '/') { status = INITIAL; // 鍦ㄥ潡緇撴潫鐘舵佷笅璇誨埌/鍒欎負(fù)鍧楃粨鏉? } else { status = BLOCK_COMMENT; // 鍚﹀垯鍧楁敞閲婅繕鏈粨鏉燂紝鎭㈠涓哄潡娉ㄩ噴鐘舵? } break; } c = in.read(); // 璇誨叆涓嬩竴瀛楃 } // 濡傛灉璇誨埌鏂囦歡灝炬椂錛屾爣璇嗙闀垮害澶т簬闆訛紝鍒欒繑鍥炴爣璇嗙錛屽惁鍒欒繑鍥濶ULL鍊? return token.length() > 0 ? token.toString() : null; } catch (IOException e) { throw new IOException("Error reading input L=" + startLine + " C=" + startChar); } } //... 鐪佺暐 </pre> <br /> <br />涓嶈繃浠庝唬鐮佸彲浠ョ湅鍑猴紝瀹冨茍涓嶆敮鎸侀潪Ascii緙栫爜鏍煎紡鐨勬枃浠訛紝榪樿榪涜榪涗竴姝ョ殑鏀歸犮? <br />鎴戠殑璁″垝鏄疭tringBuffer 鐢╞yte[]浠f浛錛屽鍔爏etEncode(String encode)鏂規(guī)硶,榪斿洖瀛楃涓叉椂浣跨敤 new String(byte[], encode) <br/> <span style="color:red;"> <a style="color:red;">鏈枃鐨勮璁轟篃寰堢簿褰╋紝嫻忚璁ㄨ>></a> </span> <br/><br/><br/> <span style="color:#E28822;">JavaEye鎺ㄨ崘</span> <br/> <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">涓闄㈣蔣浠躲佽綆楁満宸ョ▼紜曞+;涓腐杞歡紜曞+銆佺鐞嗙被紜曞+鍗氬+鎷涚敓</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">WebSphere 浜у搧瀹舵棌鏂扮壒鎬х郴鍒楃粡鍏告帹鑽?/span></a></li></ul> <br/><br/><br/> <br>鏂囩珷鏉ユ簮:<a >http://iwinyeah.javaeye.com/blog/170335</a> <img src ="http://www.tkk7.com/iwinyeah/aggbug/187977.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/iwinyeah/" target="_blank">iwinyeah</a> 2008-03-12 07:03 <a href="http://www.tkk7.com/iwinyeah/archive/2008/03/12/187977.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://77110524.com" target="_blank">国产成人精品久久亚洲</a>| <a href="http://glhrsydc.com" target="_blank">国产午夜免费福利红片</a>| <a href="http://zgbeian.com" target="_blank">亚洲自偷自偷在线制服</a>| <a href="http://45-po.com" target="_blank">看成年女人免费午夜视频</a>| <a href="http://caoliushequ9.com" target="_blank">国产精品免费一级在线观看</a>| <a href="http://8mav938.com" target="_blank">亚洲一卡一卡二新区无人区</a>| <a href="http://102sds.com" target="_blank">免费网站看v片在线香蕉</a>| <a href="http://xyjxnhcl.com" target="_blank">暖暖在线视频免费视频</a>| <a href="http://gbn21.com" target="_blank">亚洲精品无码不卡在线播HE</a>| <a href="http://sy8989.com" target="_blank">在线看片免费人成视频久网下载</a>| <a href="http://ss8kk.com" target="_blank">亚洲精品乱码久久久久久久久久久久 </a>| <a href="http://acccx.com" target="_blank">国产成人AV免费观看</a>| <a href="http://8aa3.com" target="_blank">亚洲乱码无码永久不卡在线</a>| <a href="http://wwwly6080.com" target="_blank">黄网站免费在线观看</a>| <a href="http://91packing.com" target="_blank">久久精品国产精品亚洲艾草网 </a>| <a href="http://yanshimlxg.com" target="_blank">麻豆一区二区免费播放网站 </a>| <a href="http://daohang123456.com" target="_blank">成人男女网18免费视频</a>| <a href="http://8888kkk.com" target="_blank">亚洲精品一卡2卡3卡四卡乱码</a>| <a href="http://0755host.com" target="_blank">国产极品美女高潮抽搐免费网站</a>| <a href="http://wilbysec.com" target="_blank">黄页网址在线免费观看 </a>| <a href="http://xieehuomh.com" target="_blank">毛片免费在线观看网站</a>| <a href="http://c7vl.com" target="_blank">亚洲欧美日韩中文无线码</a>| <a href="http://www4438xx2.com" target="_blank">日本午夜免费福利视频</a>| <a href="http://nb46.com" target="_blank">曰韩无码AV片免费播放不卡</a>| <a href="http://whspmd.com" target="_blank">国产亚洲无线码一区二区</a>| <a href="http://ikybh.com" target="_blank">青青草无码免费一二三区</a>| <a href="http://xabcjzx.com" target="_blank">亚洲偷自拍拍综合网</a>| <a href="http://xzzkf.com" target="_blank">久久久久国产精品免费免费不卡</a>| <a href="http://hwafarda.com" target="_blank">亚洲日本乱码一区二区在线二产线</a>| <a href="http://www-15706.com" target="_blank">成全视频在线观看免费高清动漫视频下载</a>| <a href="http://cih60o.com" target="_blank">国产亚洲欧美日韩亚洲中文色</a>| <a href="http://blblkj.com" target="_blank">国产亚洲精品国看不卡</a>| <a href="http://qiwangxuan.com" target="_blank">在线观看国产一区亚洲bd</a>| <a href="http://thegaybdsm.com" target="_blank">亚洲欧洲精品成人久久奇米网</a>| <a href="http://rbthy.com" target="_blank">日本免费一区二区三区 </a>| <a href="http://pjwys.com" target="_blank">67194熟妇在线永久免费观看</a>| <a href="http://9hao66.com" target="_blank">亚洲综合无码无在线观看</a>| <a href="http://phlinhng.com" target="_blank">亚洲福利中文字幕在线网址</a>| <a href="http://25v8.com" target="_blank">84pao国产成视频免费播放</a>| <a href="http://616kb.com" target="_blank">亚洲国产一二三精品无码</a>| <a href="http://fl6fe.com" target="_blank">国产在线a免费观看</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>