亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dwrutil.java

?? dwr 源文件 dwr 源文件 dwr 源文件
?? JAVA
字號:
/*
 * Copyright 2005 Joe Walker
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.directwebremoting.proxy.dwrutil;

import java.util.Collection;
import java.util.Map;

import org.directwebremoting.MarshallException;
import org.directwebremoting.OutboundVariable;
import org.directwebremoting.ScriptSession;
import org.directwebremoting.proxy.ScriptProxy;

/**
 * DwrUtil is a server-side proxy that allows Java programmers to call client
 * side Javascript from Java.
 * <p>
 * Each DwrUtil object is associated with a list of ScriptSessions and the
 * proxy code is creates will be dynamically forwarded to all those browsers.
 * <p>
 * Currently this class contains only the write-only DOM manipulation functions
 * from DwrUtil. It is possible that we could add the read methods, however
 * the complexity in the callback and the fact that you are probably not going
 * to need it means that we'll leave it for another day. Specifically,
 * <code>getValue</code>, <code>getValues</code> and <code>getText</code> have
 * been left out as being read functions and <code>useLoadingMessage</code> etc
 * have been left out as not being DOM related.
 * @author Joe Walker [joe at getahead dot ltd dot uk]
 */
public class DwrUtil extends ScriptProxy
{
    /**
     * Build a DwrUtil that acts on a single ScriptSession.
     * @param scriptSession The page to affect
     */
    public DwrUtil(ScriptSession scriptSession)
    {
        addScriptSession(scriptSession);
    }

    /**
     * Build a DwrUtil that acts on a number of ScriptSessions
     * @param dests A collection of ScriptSessions that we should act on.
     */
    public DwrUtil(Collection dests)
    {
        addScriptSessions(dests);
    }

    /**
     * Set the value an HTML element to the specified value.
     * <p>
     * <a href="http://getahead.ltd.uk/dwr/browser/util/setvalue">More</a>.
     * @param elementId The HTML element to update (by id)
     * @param value The text to insert into the HTML element
     * @throws MarshallException 
     */
    public void setValue(String elementId, String value) throws MarshallException
    {
        setValue(elementId, value, false);
    }

    /**
     * Set the value an HTML element to the specified value.
     * <p>
     * <a href="http://getahead.ltd.uk/dwr/browser/util/setvalue">More</a>.
     * @param elementId The HTML element to update (by id)
     * @param value The text to insert into the HTML element
     * @param escapeHtml Should we escape HTML characters?
     * @throws MarshallException If the data can not be marshalled
     */
    public void setValue(String elementId, String value, boolean escapeHtml) throws MarshallException
    {
        OutboundVariable elementIdOv = getWebContext().toJavascript(elementId);
        OutboundVariable valueOv = getWebContext().toJavascript(value);
        String options = escapeHtml ? ", {escapeHtml:true}" : ""; //$NON-NLS-1$ //$NON-NLS-2$

        StringBuffer script = new StringBuffer();
        script.append(elementIdOv.getInitCode())
            .append(valueOv.getInitCode())
            .append("DWRUtil.setValue(") //$NON-NLS-1$
            .append(elementIdOv.getAssignCode())
            .append(',')
            .append(valueOv.getAssignCode())
            .append(options)
            .append(");"); //$NON-NLS-1$

        addScript(script.toString());
    }

    /**
     * Given a map, call setValue() for all the entries in the map using the
     * entry key as an element id.
     * <p>
     * <a href="http://getahead.ltd.uk/dwr/browser/util/setvalues">More</a>.
     * @param values The map of elementIds to values to alter
     * @param escapeHtml Should we escape HTML characters?
     * @throws MarshallException If the data can not be marshalled
     */
    public void setValues(Map values, boolean escapeHtml) throws MarshallException
    {
        OutboundVariable valuesOv = getWebContext().toJavascript(values);
        String options = escapeHtml ? "{escapeHtml:true}" : "null"; //$NON-NLS-1$ //$NON-NLS-2$

        StringBuffer script = new StringBuffer();
        script.append(valuesOv.getInitCode())
            .append("DWRUtil.setValues(") //$NON-NLS-1$
            .append(valuesOv.getAssignCode())
            .append(',')
            .append(options)
            .append(");"); //$NON-NLS-1$

        addScript(script.toString());
    }

    /**
     * Add options to a list from an array or map.
     * <p>
     * <a href="http://getahead.ltd.uk/dwr/browser/lists">More</a>.
     * @param elementId The HTML element to update (by id)
     * @param array An array of strings to use as both value and text of options
     * @throws MarshallException If the data can not be marshalled
     */
    public void addOptions(String elementId, String[] array) throws MarshallException
    {
        OutboundVariable elementIdOv = getWebContext().toJavascript(elementId);
        OutboundVariable arrayOv = getWebContext().toJavascript(array);

        StringBuffer script = new StringBuffer();
        script.append(elementIdOv.getInitCode())
            .append(arrayOv.getInitCode())
            .append("DWRUtil.addOptions(") //$NON-NLS-1$
            .append(elementIdOv.getAssignCode())
            .append(',')
            .append(arrayOv.getAssignCode())
            .append(");"); //$NON-NLS-1$

        addScript(script.toString());
    }

    /**
     * Add options to a list from an array or map.
     * <p>
     * <a href="http://getahead.ltd.uk/dwr/browser/lists">More</a>.
     * @param elementId The HTML element to update (by id)
     * @param array And array of objects from which to create options
     * @param property The object property to use for the option value and text
     * @throws MarshallException If the data can not be marshalled
     */
    public void addOptions(String elementId, Collection array, String property) throws MarshallException
    {
        OutboundVariable elementIdOv = getWebContext().toJavascript(elementId);
        OutboundVariable arrayOv = getWebContext().toJavascript(array);
        OutboundVariable propertyOv = getWebContext().toJavascript(property);

        StringBuffer script = new StringBuffer();
        script.append(elementIdOv.getInitCode())
            .append(arrayOv.getInitCode())
            .append("DWRUtil.addOptions(") //$NON-NLS-1$
            .append(elementIdOv.getAssignCode())
            .append(',')
            .append(arrayOv.getAssignCode())
            .append(',')
            .append(propertyOv.getAssignCode())
            .append(");"); //$NON-NLS-1$

        addScript(script.toString());
    }

    /**
     * Add options to a list from an array or map.
     * <p>
     * <a href="http://getahead.ltd.uk/dwr/browser/lists">More</a>.
     * @param elementId The HTML element to update (by id)
     * @param array And array of objects from which to create options
     * @param valueProperty The object property to use for the option value
     * @param textProperty The object property to use for the option text
     * @throws MarshallException If the data can not be marshalled
     */
    public void addOptions(String elementId, Collection array, String valueProperty, String textProperty) throws MarshallException
    {
        OutboundVariable elementIdOv = getWebContext().toJavascript(elementId);
        OutboundVariable arrayOv = getWebContext().toJavascript(array);
        OutboundVariable valuePropertyOv = getWebContext().toJavascript(valueProperty);
        OutboundVariable textPropertyOv = getWebContext().toJavascript(textProperty);

        StringBuffer script = new StringBuffer();
        script.append(elementIdOv.getInitCode())
            .append(arrayOv.getInitCode())
            .append("DWRUtil.addOptions(") //$NON-NLS-1$
            .append(elementIdOv.getAssignCode())
            .append(',')
            .append(arrayOv.getAssignCode())
            .append(',')
            .append(valuePropertyOv.getAssignCode())
            .append(',')
            .append(textPropertyOv.getAssignCode())
            .append(");"); //$NON-NLS-1$

        addScript(script.toString());
    }

    /**
     * Remove all the options from a select list (specified by id)
     * <p>
     * <a href="http://getahead.ltd.uk/dwr/browser/lists">More</a>.
     * @param elementId The HTML element to update (by id)
     * @throws MarshallException If the data can not be marshalled
     */
    public void removeAllOptions(String elementId) throws MarshallException
    {
        OutboundVariable elementIdOv = getWebContext().toJavascript(elementId);

        StringBuffer script = new StringBuffer();
        script.append(elementIdOv.getInitCode())
            .append("DWRUtil.removeAllOptions(") //$NON-NLS-1$
            .append(elementIdOv.getAssignCode())
            .append(");"); //$NON-NLS-1$

        addScript(script.toString());
    }

    /**
     * Create rows inside a the table, tbody, thead or tfoot element (given by id).
     * <p>
     * <a href="http://getahead.ltd.uk/dwr/browser/tables">More</a>.
     * @param elementId The HTML element to update (by id)
     * @param row The cells to add to the table
     * @throws MarshallException If the data can not be marshalled
     */
    public void addRow(String elementId, Row row) throws MarshallException
    {
        
    }

    /**
     * Remove all the children of a given node.
     * <p>
     * <a href="http://getahead.ltd.uk/dwr/browser/tables">More</a>.
     * @param elementId The HTML element to update (by id)
     * @throws MarshallException If the data can not be marshalled
     */
    public void removeAllRows(String elementId) throws MarshallException
    {
        OutboundVariable elementIdOv = getWebContext().toJavascript(elementId);

        StringBuffer script = new StringBuffer();
        script.append(elementIdOv.getInitCode())
            .append("DWRUtil.removeAllRows(") //$NON-NLS-1$
            .append(elementIdOv.getAssignCode())
            .append(");"); //$NON-NLS-1$

        addScript(script.toString());
    }

    /**
     * Clone a given node.
     * <p>
     * <a href="http://getahead.ltd.uk/dwr/browser/TODO">More</a>.
     * @param elementId The HTML element to update (by id)
     * @throws MarshallException If the data can not be marshalled
     */
    public void cloneNode(String elementId) throws MarshallException
    {
        OutboundVariable elementIdOv = getWebContext().toJavascript(elementId);

        StringBuffer script = new StringBuffer();
        script.append(elementIdOv.getInitCode())
            .append("DWRUtil.cloneNode(") //$NON-NLS-1$
            .append(elementIdOv.getAssignCode())
            .append(");"); //$NON-NLS-1$

        addScript(script.toString());
    }

    /**
     * Clone a given node.
     * <p>
     * <a href="http://getahead.ltd.uk/dwr/browser/TODO">More</a>.
     * @param elementId The HTML element to update (by id)
     * @param idPrefix How do we prefix ids in the cloned version of the node tree
     * @param idSuffix How do we suffix ids in the cloned version of the node tree
     * @throws MarshallException If the data can not be marshalled
     */
    public void cloneNode(String elementId, String idPrefix, String idSuffix) throws MarshallException
    {
        OutboundVariable elementIdOv = getWebContext().toJavascript(elementId);

        StringBuffer options = new StringBuffer();
        options.append("{"); //$NON-NLS-1$
        if (idPrefix != null)
        {
            options.append("idPrefix:'").append(idPrefix).append("'");  //$NON-NLS-1$//$NON-NLS-2$
        }
        if (idPrefix != null && idSuffix != null)
        {
            options.append(","); //$NON-NLS-1$
        }
        if (idSuffix != null)
        {
            options.append("idSuffix:'").append(idSuffix).append("'");  //$NON-NLS-1$//$NON-NLS-2$
        }
        options.append("}"); //$NON-NLS-1$

        StringBuffer script = new StringBuffer();
        script.append(elementIdOv.getInitCode())
            .append("DWRUtil.cloneNode(") //$NON-NLS-1$
            .append(elementIdOv.getAssignCode())
            .append(", ") //$NON-NLS-1$
            .append(options)
            .append(");"); //$NON-NLS-1$

        addScript(script.toString());
    }

    /**
     * $(ele).className = "X", that we can call from Java easily
     * @param elementId The HTML element to update (by id)
     * @param className The CSS class to set for the element
     */
    public void setClassName(String elementId, String className)
    {
        addScript("DWRUtil.setClassName('" + elementId + "', '" + className + "');"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }

    /**
     * $(ele).className += "X", that we can call from Java easily.
     * @param elementId The HTML element to update (by id)
     * @param className The CSS class to add to the element
     */
    public void addClassName(String elementId, String className)
    {
        addScript("DWRUtil.addClassName('" + elementId + "', '" + className + "');"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }

    /**
     * $(ele).className -= "X", that we can call from Java easily From code originally by Gavin Kistner
     * @param elementId The HTML element to update (by id)
     * @param className The CSS class to remove from the element
     */
    public void removeClassName(String elementId, String className)
    {
        addScript("DWRUtil.removeClassName('" + elementId + "', '" + className + "');"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }

    /**
     * $(ele).className |= "X", that we can call from Java easily.
     * @param elementId The HTML element to update (by id)
     * @param className The CSS class to toggle on/off
     */
    public void toggleClassName(String elementId, String className)
    {
        addScript("DWRUtil.toggleClassName('" + elementId + "', '" + className + "');"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }

    /**
     * Sets a CSS style on an element
     * @param elementId The HTML element to update (by id)
     * @param selector The CSS selector to update
     * @param value The new value for the CSS class on the given element
     */
    public void setStyle(String elementId, String selector, String value)
    {
        addScript("$('" + elementId + "').style." + selector + " = '" + value + "';"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美艳星brazzers| 不卡的电影网站| 日韩一区二区在线免费观看| 香港成人在线视频| 欧美一区三区四区| 久久精品国产一区二区三| 精品少妇一区二区三区在线播放| 久久91精品久久久久久秒播| 久久精品亚洲国产奇米99| 丁香激情综合国产| 亚洲激情中文1区| 欧美精品乱人伦久久久久久| 美女视频网站久久| 久久精品视频免费| 在线视频亚洲一区| 久久国产欧美日韩精品| 亚洲国产成人自拍| 在线观看亚洲专区| 久久国产尿小便嘘嘘尿| 国产精品久久久久影院| 欧美三区在线视频| 紧缚捆绑精品一区二区| 1000精品久久久久久久久| 欧洲色大大久久| 久久99九九99精品| 亚洲特级片在线| 欧美一卡二卡三卡| 91热门视频在线观看| 青青草精品视频| 中文幕一区二区三区久久蜜桃| 91国偷自产一区二区使用方法| 青娱乐精品视频| 亚洲欧美在线视频观看| 7777精品久久久大香线蕉| 国产91精品一区二区麻豆网站 | 51精品秘密在线观看| 国产成人午夜视频| 亚洲国产中文字幕在线视频综合 | 午夜精品成人在线视频| 久久久国产精品不卡| 欧美无人高清视频在线观看| 国产剧情av麻豆香蕉精品| 亚洲国产一区二区三区 | 最好看的中文字幕久久| 日韩久久久久久| 欧美日韩精品一二三区| 春色校园综合激情亚洲| 蜜臀久久99精品久久久画质超高清| 中文字幕亚洲欧美在线不卡| 精品乱码亚洲一区二区不卡| 欧美视频在线一区二区三区| 成人性色生活片| 久久成人麻豆午夜电影| 亚洲成人av电影| 亚洲私人影院在线观看| 国产欧美精品国产国产专区| 精品入口麻豆88视频| 欧美日韩国产一级| 91精品办公室少妇高潮对白| 成人综合在线观看| 国产成人综合在线播放| 久久精品国产久精国产爱| 午夜在线成人av| 亚洲午夜免费电影| 亚洲精品免费一二三区| 亚洲色欲色欲www在线观看| 国产日韩av一区| 久久久久97国产精华液好用吗| 日韩免费性生活视频播放| 欧美精品丝袜中出| 欧美三级欧美一级| 欧美丝袜自拍制服另类| 在线观看亚洲精品视频| 日本精品免费观看高清观看| 92国产精品观看| 91色porny| 欧美亚洲禁片免费| 欧美理论在线播放| 欧美精品在线一区二区三区| 欧美日韩第一区日日骚| 欧美日韩精品一二三区| 欧美日本韩国一区二区三区视频| 欧洲一区在线电影| 欧美在线free| 欧美理论在线播放| 日韩视频永久免费| 国产亚洲欧美一级| 日本一区二区视频在线| 国产精品国产三级国产aⅴ原创| 亚洲欧洲无码一区二区三区| 亚洲三级电影全部在线观看高清| 最好看的中文字幕久久| 亚洲尤物在线视频观看| 日韩精品福利网| 国产自产v一区二区三区c| 高清beeg欧美| 一本到三区不卡视频| 欧美日韩不卡视频| 欧美大黄免费观看| 国产精品美女久久久久aⅴ| 亚洲欧美色图小说| 日日夜夜免费精品| 国产一区二区三区在线观看免费| 成人一区二区三区中文字幕| 欧美系列亚洲系列| 欧美一区二区精美| 中文字幕av不卡| 亚洲一区二区三区中文字幕| 毛片一区二区三区| 成人av综合一区| 欧美色图天堂网| 精品成人免费观看| 中文字幕在线不卡一区| 三级欧美韩日大片在线看| 国产精品一区在线观看乱码| 色综合久久综合中文综合网| 777精品伊人久久久久大香线蕉| 久久夜色精品国产噜噜av| 亚洲激情网站免费观看| 乱一区二区av| 在线免费视频一区二区| 国产午夜一区二区三区| 亚洲无线码一区二区三区| 国产精华液一区二区三区| 日本久久精品电影| 国产婷婷精品av在线| 亚瑟在线精品视频| 成人av在线一区二区三区| 91精品国产麻豆国产自产在线| 国产精品久久久久三级| 麻豆91免费观看| 欧美日韩综合不卡| 亚洲欧美在线视频观看| 精品一区二区三区影院在线午夜| 色综合久久久久综合| 久久香蕉国产线看观看99| 日韩精品电影在线| 欧美性xxxxx极品少妇| 国产精品每日更新| 国产精品一二三四五| 91精品午夜视频| 一区二区三区精品久久久| 高潮精品一区videoshd| 欧美不卡在线视频| 偷拍一区二区三区四区| 91福利资源站| 综合久久给合久久狠狠狠97色| 国产一区二区中文字幕| 日韩欧美国产成人一区二区| 视频一区二区三区中文字幕| 91香蕉国产在线观看软件| 国产视频一区二区三区在线观看| 日本不卡不码高清免费观看| 精品视频在线免费看| 亚洲视频一区在线| 精品理论电影在线| 日韩电影一区二区三区| 99综合电影在线视频| 久久蜜桃av一区精品变态类天堂| 久久精品99国产国产精| 欧美一区国产二区| 日本不卡一区二区三区高清视频| 欧美人狂配大交3d怪物一区| 亚洲成人午夜电影| 欧美精品xxxxbbbb| 婷婷成人激情在线网| 3d动漫精品啪啪1区2区免费| 午夜影院久久久| 日韩欧美一区在线| 蜜桃视频一区二区| 欧美精品一区二区三区蜜桃视频 | 黄色日韩网站视频| 2021中文字幕一区亚洲| 国产精品456露脸| 欧美国产视频在线| 91色婷婷久久久久合中文| 亚洲男同性视频| 欧美午夜电影在线播放| 午夜精品爽啪视频| 日韩视频免费观看高清完整版| 久久国产综合精品| 国产亚洲美州欧州综合国| 北条麻妃一区二区三区| 亚洲图片激情小说| 欧美精品九九99久久| 久热成人在线视频| 国产三级三级三级精品8ⅰ区| 国产69精品久久久久777| 国产精品国产精品国产专区不片| 色噜噜偷拍精品综合在线| 亚洲成人精品在线观看| 欧美日韩高清一区二区不卡| 免费观看成人鲁鲁鲁鲁鲁视频| 久久久美女毛片| 日本福利一区二区| 日韩不卡免费视频| 国产欧美日韩不卡| 欧美日韩国产一区二区三区地区| 精品一区二区免费视频| 中文字幕一区av|