锘??xml version="1.0" encoding="utf-8" standalone="yes"?>狠狠做深爱婷婷久久综合一区,亚洲精品在线观看网站,欧美一区二区久久久http://www.aygfsteel.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.aygfsteel.com/iwinyeah/archive/2008/03/17/187974.htmliwinyeahiwinyeahMon, 17 Mar 2008 06:06:00 GMThttp://www.aygfsteel.com/iwinyeah/archive/2008/03/17/187974.htmlhttp://www.aygfsteel.com/iwinyeah/comments/187974.htmlhttp://www.aygfsteel.com/iwinyeah/archive/2008/03/17/187974.html#Feedback0http://www.aygfsteel.com/iwinyeah/comments/commentRss/187974.htmlhttp://www.aygfsteel.com/iwinyeah/services/trackbacks/187974.html 緗戠珯: JavaEye  浣滆? iwinyeah  閾炬帴錛?a style="color:red;">http://iwinyeah.javaeye.com/blog/172974  鍙戣〃鏃墮棿: 2008騫?3鏈?7鏃?

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

Action: 瑙勫畾浜?jiǎn)涓庣敤鎴蜂氦浜掔殑View鍙互瑙﹀彂鐨勫姩浣?鍦ㄦ煇涓猇iew鏂板緩涔嬪悗鏄劇ず涔嬪墠,搴斿厛涓哄叾鎸囧畾鍏蜂綋鐨凙ction,褰撶敤鎴鋒寜涓嬩簡(jiǎn)鐩稿簲鐨凜ommand鎸夐挳涔嬪悗錛孷iew灝嗚Command瀵瑰簲鐨凙ction鍙戦佸埌璇iew鐨凜ontroller榪涜澶勭悊銆?
//
public class Action{
    String name; // 鍚嶇О 
    Command command; // 鍛戒護(hù) 
    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鏄睆騫曠浉鍏崇殑鍛戒護(hù)
        }
        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 );
            }
        }
    }

    // 鐢ㄦ埛鍦ㄦ煇涓寚瀹氫簡(jiǎn)鍛戒護(hù)鐨処tem鎸変笅浜?jiǎn)鍛戒护鎸夐挳鏃惰Е鍙戞墽琛屼笌鍏跺厡檨旂殑Action
    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.aygfsteel.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.aygfsteel.com/iwinyeah/archive/2008/03/12/187977.html</guid><wfw:comment>http://www.aygfsteel.com/iwinyeah/comments/187977.html</wfw:comment><comments>http://www.aygfsteel.com/iwinyeah/archive/2008/03/12/187977.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/iwinyeah/comments/commentRss/187977.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.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涓彂鐜頒簡(jiǎn)榪欎釜綾伙紝寰堢鍚堟垜鐨勮姹傘傚叧閿唬鐮佸涓嬶細(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(); } // 濡傛灉榪樻湭鏈夋暟鎹紝榪樿緇х畫(huà)寰涓嬭 } 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.aygfsteel.com/iwinyeah/aggbug/187977.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/iwinyeah/" target="_blank">iwinyeah</a> 2008-03-12 07:03 <a href="http://www.aygfsteel.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"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> 主站蜘蛛池模板: <a href="http://" target="_blank">社旗县</a>| <a href="http://" target="_blank">榆树市</a>| <a href="http://" target="_blank">台山市</a>| <a href="http://" target="_blank">宁城县</a>| <a href="http://" target="_blank">新源县</a>| <a href="http://" target="_blank">龙游县</a>| <a href="http://" target="_blank">荣成市</a>| <a href="http://" target="_blank">赤城县</a>| <a href="http://" target="_blank">朝阳县</a>| <a href="http://" target="_blank">长岛县</a>| <a href="http://" target="_blank">德庆县</a>| <a href="http://" target="_blank">宁明县</a>| <a href="http://" target="_blank">昭觉县</a>| <a href="http://" target="_blank">会理县</a>| <a href="http://" target="_blank">那坡县</a>| <a href="http://" target="_blank">普定县</a>| <a href="http://" target="_blank">进贤县</a>| <a href="http://" target="_blank">昌黎县</a>| <a href="http://" target="_blank">昭觉县</a>| <a href="http://" target="_blank">宜春市</a>| <a href="http://" target="_blank">乌鲁木齐市</a>| <a href="http://" target="_blank">屯昌县</a>| <a href="http://" target="_blank">舟山市</a>| <a href="http://" target="_blank">巫山县</a>| <a href="http://" target="_blank">杭州市</a>| <a href="http://" target="_blank">巧家县</a>| <a href="http://" target="_blank">宜兴市</a>| <a href="http://" target="_blank">新蔡县</a>| <a href="http://" target="_blank">英超</a>| <a href="http://" target="_blank">龙泉市</a>| <a href="http://" target="_blank">德格县</a>| <a href="http://" target="_blank">海伦市</a>| <a href="http://" target="_blank">濮阳市</a>| <a href="http://" target="_blank">麻江县</a>| <a href="http://" target="_blank">北辰区</a>| <a href="http://" target="_blank">永昌县</a>| <a href="http://" target="_blank">壶关县</a>| <a href="http://" target="_blank">海城市</a>| <a href="http://" target="_blank">临猗县</a>| <a href="http://" target="_blank">玉龙</a>| <a href="http://" target="_blank">民乐县</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>