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

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

?? json.java

?? netbeans開發(fā)gwt程式的插件
?? JAVA
字號:
/* * Copyright 2006 Google Inc. *  * 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 com.google.gwt.sample.json.client;import com.google.gwt.json.client.JSONArray;import com.google.gwt.json.client.JSONException;import com.google.gwt.json.client.JSONObject;import com.google.gwt.json.client.JSONParser;import com.google.gwt.json.client.JSONString;import com.google.gwt.json.client.JSONValue;import com.google.gwt.user.client.HTTPRequest;import com.google.gwt.user.client.ResponseTextHandler;import com.google.gwt.user.client.Window;import com.google.gwt.user.client.ui.Button;import com.google.gwt.user.client.ui.ClickListener;import com.google.gwt.user.client.ui.RootPanel;import com.google.gwt.user.client.ui.Tree;import com.google.gwt.user.client.ui.TreeItem;import com.google.gwt.user.client.ui.Widget;import java.util.Iterator;import java.util.Set;/** * Class that acts as a client to a JSON service. Currently, this client just * requests a text which contains a JSON encoding of a search result set from * yahoo. We use a text file to demonstrate how the pieces work without tripping * on cross-site scripting issues. *  * If you would like to make this a more dynamic example, you can associate a * servlet with this example and simply have it hit the yahoo service and return * the results. */public class JSON {  /**   * Class for handling the response text associated with a request for a JSON   * object.   *    */  private class JSONResponseTextHandler implements ResponseTextHandler {    public void onCompletion(String responseText) {      try {        JSONValue jsonValue = JSONParser.parse(responseText);        displayJSONObject(jsonValue);      } catch (JSONException e) {        displayError(responseText);      }      searchButton.setText(SEARCH_BUTTON_DEFAULT_TEXT);    }  }  /*   * Class for handling the fetch button's click event.   */  private class SearchButtonClickListener implements ClickListener {    public void onClick(Widget sender) {      jsonTree.setVisible(false);      doFetchURL();    }  }  /*   * Default URL to use to fetch JSON objects. Note that the contents of this   * JSON result were as a result of requesting the following URL:   *    * http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=potato&results=2&output=json   *    */  private static final String DEFAULT_SEARCH_URL = "search-results.js";  /*   * Text displayed on the fetch button when we are in a default state.   */  private static final String SEARCH_BUTTON_DEFAULT_TEXT = "Search";  /*   * Text displayed on the fetch button when we are waiting for a JSON reply.   */  private static final String SEARCH_BUTTON_WAITING_TEXT = "Waiting for JSON Response...";  private Tree jsonTree = new Tree();  private Button searchButton = new Button();  /**   * Entry point for this simple application. Currently, we build the   * application's form and wait for events.   */  public void onModuleLoad() {    initializeMainForm();  }  /*   * Add the object presented by the JSONValue as a children to the requested   * TreeItem.   */  private void addChildren(TreeItem treeItem, JSONValue jsonValue) {    JSONArray jsonArray;    JSONObject jsonObject;    JSONString jsonString;    if ((jsonArray = jsonValue.isArray()) != null) {      for (int i = 0; i < jsonArray.size(); ++i) {        TreeItem child = treeItem.addItem(getChildText("["            + Integer.toString(i) + "]"));        addChildren(child, jsonArray.get(i));      }    } else if ((jsonObject = jsonValue.isObject()) != null) {      Set keys = jsonObject.keySet();      for (Iterator iter = keys.iterator(); iter.hasNext();) {        String key = (String) iter.next();        TreeItem child = treeItem.addItem(getChildText(key));        addChildren(child, jsonObject.get(key));      }    } else if ((jsonString = jsonValue.isString()) != null) {      // Use stringValue instead of toString() because we don't want escaping      treeItem.addItem(jsonString.stringValue());    } else {      // JSONBoolean, JSONNumber, and JSONNull work well with toString().      treeItem.addItem(getChildText(jsonValue.toString()));    }  }  private void displayError(String responseText) {    jsonTree.removeItems();    jsonTree.setVisible(true);    TreeItem treeItem = jsonTree.addItem("Failed to parse JSON response");    treeItem.addItem(responseText);    treeItem.setStyleName("JSON-JSONResponseObject");    treeItem.setState(true);  }  /*   * Update the treeview of a JSON object.   */  private void displayJSONObject(JSONValue jsonValue) {    jsonTree.removeItems();    jsonTree.setVisible(true);    TreeItem treeItem = jsonTree.addItem("JSON Response");    addChildren(treeItem, jsonValue);    treeItem.setStyleName("JSON-JSONResponseObject");    treeItem.setState(true);  }  /*   * Fetch the requested URL.   */  private void doFetchURL() {    searchButton.setText(SEARCH_BUTTON_WAITING_TEXT);    if (!HTTPRequest.asyncGet(DEFAULT_SEARCH_URL, new JSONResponseTextHandler())) {      // Reset the caption.      //      searchButton.setText(SEARCH_BUTTON_DEFAULT_TEXT);    }  }  /*   * Causes the text of child elements to wrap.   */  private String getChildText(String text) {    return "<span style='white-space:normal'>" + text + "</span>";  }  /**   * Initialize the main form's layout and content.   */  private void initializeMainForm() {    searchButton.setStyleName("JSON-SearchButton");    searchButton.setText(SEARCH_BUTTON_DEFAULT_TEXT);    searchButton.addClickListener(new SearchButtonClickListener());    // Find out where the host page wants the button.    //    RootPanel searchButtonSlot = RootPanel.get("search");    if (searchButtonSlot == null) {      Window.alert("Please define a container element whose id is 'search'");      return;    }    // Find out where the host page wants the tree view.    //    RootPanel treeViewSlot = RootPanel.get("tree");    if (treeViewSlot == null) {      Window.alert("Please define a container element whose id is 'tree'");      return;    }    // Add both widgets.    //    searchButtonSlot.add(searchButton);    treeViewSlot.add(jsonTree);  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
6080午夜不卡| 日韩欧美中文一区| 久久99国产精品久久99| 五月婷婷欧美视频| 亚洲成av人片观看| 午夜精品久久久久久| 日本在线不卡视频一二三区| 性久久久久久久| 日韩主播视频在线| 人禽交欧美网站| 毛片不卡一区二区| 国产精品影视在线| 成人福利在线看| 色婷婷亚洲一区二区三区| 色视频成人在线观看免| 欧美日韩成人在线| 精品国产一区二区三区忘忧草| 精品久久久久久久一区二区蜜臀| 精品三级av在线| 国产人成亚洲第一网站在线播放| 国产精品伦理在线| 亚洲国产成人精品视频| 日韩电影在线免费看| 捆绑变态av一区二区三区| 国产黄人亚洲片| 91啪九色porn原创视频在线观看| 欧美综合一区二区| 欧美嫩在线观看| 国产女主播一区| 亚洲高清视频的网址| 精品一区免费av| 91丝袜美腿高跟国产极品老师 | 91精品久久久久久蜜臀| 精品日韩在线一区| 中文字幕在线播放不卡一区| 亚洲福利一区二区| 国产成人啪午夜精品网站男同| 99re这里只有精品首页| 在线成人av网站| 国产精品无圣光一区二区| 亚洲成人av中文| 国产寡妇亲子伦一区二区| 99久久99久久精品免费观看| 91精品国产麻豆国产自产在线 | 日韩欧美在线一区二区三区| 日本一区二区三区dvd视频在线| 亚洲亚洲人成综合网络| 免费在线欧美视频| 日本精品一级二级| 久久亚洲一级片| 亚洲1区2区3区4区| 99re热视频这里只精品| 欧美xxx久久| 亚洲高清视频在线| 色综合激情五月| 久久久99精品久久| 老色鬼精品视频在线观看播放| yourporn久久国产精品| 亚洲精品一区二区三区四区高清| 亚洲综合免费观看高清完整版在线| 国产制服丝袜一区| 91精品欧美久久久久久动漫| 亚洲少妇屁股交4| 国产很黄免费观看久久| xvideos.蜜桃一区二区| 免费观看在线综合| 666欧美在线视频| 日韩专区中文字幕一区二区| 91黄色免费观看| 亚洲免费观看高清完整| 成年人国产精品| 国产女同互慰高潮91漫画| 国产一区二区三区四区在线观看| 91精品欧美综合在线观看最新| 亚洲中国最大av网站| 日本韩国欧美在线| 亚洲天堂免费看| 不卡视频在线观看| 欧美高清在线一区| 不卡视频一二三四| 一区二区欧美国产| 欧美主播一区二区三区| 亚洲永久精品国产| 欧美乱妇15p| 麻豆精品久久精品色综合| 欧美一级欧美三级在线观看| 日本欧美在线观看| 26uuu精品一区二区| 国产99久久久国产精品潘金| 日本一区二区三区在线不卡| gogo大胆日本视频一区| 国产精品久久99| 欧美视频精品在线| 琪琪一区二区三区| 久久这里只有精品视频网| 国产在线精品一区在线观看麻豆| 国产欧美日本一区视频| av在线综合网| 日韩黄色免费网站| 精品国产免费一区二区三区香蕉| 国产成人亚洲综合a∨婷婷图片| 中文字幕第一区综合| 欧美三级三级三级爽爽爽| 日本va欧美va瓶| 国产日韩v精品一区二区| 97se亚洲国产综合自在线| 亚洲v精品v日韩v欧美v专区 | 久久超碰97中文字幕| 日本一区二区在线不卡| 欧美日韩国产一级片| 狠狠色丁香久久婷婷综| 亚洲久草在线视频| 欧美tk—视频vk| 色综合天天综合狠狠| 免费久久精品视频| 亚洲视频图片小说| 久久综合色天天久久综合图片| gogogo免费视频观看亚洲一| 免费精品视频在线| 亚洲免费视频成人| 国产亚洲精品免费| 欧美人妇做爰xxxⅹ性高电影| 国产成人综合精品三级| 日韩综合在线视频| 一区二区三区在线不卡| 国产日韩亚洲欧美综合| 日韩一级黄色片| 91国产免费观看| 成人综合激情网| 美女看a上一区| 午夜欧美在线一二页| 中文字幕在线免费不卡| 久久久久亚洲蜜桃| 欧美一级搡bbbb搡bbbb| 欧美丝袜丝交足nylons图片| 国产91精品一区二区麻豆亚洲| 偷窥国产亚洲免费视频 | 色成年激情久久综合| 懂色av中文一区二区三区| 免费观看久久久4p| 亚洲第一福利视频在线| 亚洲欧美激情小说另类| 久久久久99精品国产片| 日韩一区二区精品在线观看| 欧美艳星brazzers| 色猫猫国产区一区二在线视频| 成人性生交大片免费看中文| 国产乱子伦一区二区三区国色天香| 亚洲午夜av在线| 亚洲主播在线播放| 亚洲成人免费影院| 亚洲精品视频免费观看| **欧美大码日韩| 亚洲男人的天堂在线观看| 18欧美乱大交hd1984| 亚洲欧美视频在线观看视频| 亚洲欧美日韩成人高清在线一区| 国产精品免费久久久久| 国产精品久久久久久户外露出| 国产午夜亚洲精品理论片色戒| 国产日韩一级二级三级| 亚洲视频一二三| 亚洲视频 欧洲视频| 伊人婷婷欧美激情| 亚洲大片精品永久免费| 免费精品视频在线| 国产精品自拍av| 成人午夜伦理影院| 91原创在线视频| 欧美在线色视频| 欧美一区三区四区| 国产三级精品视频| 亚洲精品写真福利| 另类人妖一区二区av| 国产在线播放一区三区四| 成人免费视频一区二区| 色av成人天堂桃色av| 欧美一级在线视频| 中文字幕制服丝袜一区二区三区| 亚洲精品国产品国语在线app| 香蕉av福利精品导航| 精品一区二区在线免费观看| 成人h动漫精品一区二区| 91婷婷韩国欧美一区二区| 欧美一级专区免费大片| 国产精品乱子久久久久| 亚洲线精品一区二区三区| 精品在线亚洲视频| 色呦呦一区二区三区| 欧美一区二区三区免费观看视频| 国产性天天综合网| 午夜视黄欧洲亚洲| 99精品在线免费| 精品免费国产一区二区三区四区| 国产精品视频在线看| 视频一区免费在线观看| 国产成人精品一区二| 欧美精品乱码久久久久久按摩| 久久久91精品国产一区二区三区| 亚洲成在人线免费|