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

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

?? javascriptglobal.java

?? AJAX_aptana_update 關于AJAX的Eclipse插件。可以在這里下載的
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/** * Copyright (c) 2005-2007 Aptana, Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. If redistributing this code, * this entire header must remain intact. */package org.eclipse.eclipsemonkey.lang.javascript;import java.io.BufferedReader;import java.io.ByteArrayInputStream;import java.io.FileInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.StringWriter;import java.util.HashMap;import java.util.Map;import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import javax.xml.parsers.ParserConfigurationException;import org.eclipse.core.runtime.Platform;import org.eclipse.eclipsemonkey.utils.StringUtils;import org.eclipse.jface.dialogs.InputDialog;import org.eclipse.jface.dialogs.MessageDialog;import org.eclipse.jface.window.Window;import org.eclipse.swt.SWT;import org.eclipse.swt.widgets.Display;import org.eclipse.swt.widgets.Shell;import org.eclipse.ui.IWorkbench;import org.eclipse.ui.PlatformUI;import org.eclipse.ui.console.ConsolePlugin;import org.eclipse.ui.console.IConsole;import org.eclipse.ui.console.MessageConsoleStream;import org.mozilla.javascript.Context;import org.mozilla.javascript.Function;import org.mozilla.javascript.Script;import org.mozilla.javascript.Scriptable;import org.mozilla.javascript.ScriptableObject;import org.osgi.framework.Bundle;import org.w3c.dom.Document;import org.xml.sax.SAXException;/** * Provides global functions to JavaScript environment *  * @author Paul Colton * @author Kevin Lindsey */public class JavaScriptGlobal extends ScriptableObject{	/**	 * The "location" property name	 */	public static final String LOCATION_PROPERTY = "location";	//$NON-NLS-1$		/**	 * The "classLoader" property name	 */	public static final String CLASS_LOADER_PROPERTY = "classLoader";	//$NON-NLS-1$		private static final String INCLUDES_PROPERTY = "includes";	//$NON-NLS-1$	private static final long serialVersionUID = -8969608471837413334L;		private static JavaScriptConsole _console;	private static MessageConsoleStream _consoleStream;		private JavaScriptPrintStream _err;	private Map _runningSetTimeouts = new HashMap();	private int _setTimeoutIndex;	/**	 * Provides global functions to the JavaScript environment	 * 	 * @param cx	 *            The currently active script context	 */	public JavaScriptGlobal(Context cx)	{		// create unsealed standard objects		cx.initStandardObjects(this, false);			// create global properties		this.createAllProperties();	}		/**	 * @see org.mozilla.javascript.ScriptableObject#getClassName()	 */	public String getClassName()	{		return "JavaScriptGlobal";	}		/**	 * Returns a reference to the current console, initializing it if it's not created	 * 	 * @return A console stream	 */	public static MessageConsoleStream getConsoleStream()	{		if (_console == null)		{			_console = new JavaScriptConsole("Scripting Console", null); //$NON-NLS-1$			_consoleStream = _console.newMessageStream();			PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable()			{				public void run()				{					_consoleStream.setColor(PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_BLUE));				}			});			ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { _console });			_consoleStream.println("Eclipse Monkey JavaScript Console Started");		}		return _consoleStream;	}		/**	 * Return a list of all property names. All names return by this method must appear within the definition of this	 * class. Sub-classes should override this method to augment the return value to include functions defined within	 * the sub-class itself.	 * 	 * @return Returns a list of function property names to add to this global	 */	protected String[] getFunctionPropertyNames()	{		return new String[] {			"alert", //$NON-NLS-1$			"clearTimeout", //$NON-NLS-1$			"confirm", //$NON-NLS-1$			"execute", //$NON-NLS-1$			"getProperty", //$NON-NLS-1$			"include", //$NON-NLS-1$			"loadBundle", //$NON-NLS-1$			"parseXML", //$NON-NLS-1$			"prompt", //$NON-NLS-1$			"runOnUIThread", //$NON-NLS-1$			"setClassLoader", //$NON-NLS-1$			"setTimeout", //$NON-NLS-1$		};	}		/**	 * Get a list of the full paths of all files in the Active Library view	 * 	 * @param property	 *            The system property name to retrieve	 * @return Returns a string array of full paths	 */	public String getProperty(String property)	{		String result = null;			if (property != null && property.length() > 0)		{			result = System.getProperty(property, "undefined"); //$NON-NLS-1$		}			return result;	}		/**	 * Get all text from the given input stream	 * 	 * @param stream	 *            The input stream	 * @return Returns all text from the input stream	 * @throws IOException	 */	protected static String getText(InputStream stream) throws IOException	{		// create output buffer		StringWriter sw = new StringWriter();		// read contents into a string buffer		try		{			// get buffered reader			InputStreamReader isr = new InputStreamReader(stream);			BufferedReader reader = new BufferedReader(isr);			// create temporary buffer			char[] buf = new char[1024];			// fill buffer			int numRead = reader.read(buf);			// keep reading until the end of the stream			while (numRead != -1)			{				// output temp buffer to output buffer				sw.write(buf, 0, numRead);				// fill buffer				numRead = reader.read(buf);			}		}		finally		{			if (stream != null)			{				stream.close();			}		}		// return string buffer's content		return sw.toString();	}	/**	 * Execute a command-line in the system shell	 * 	 * @param cx	 * @param thisObj	 * @param args	 *            The string command to execute	 * @param funObj	 * @return Returns an object array where the first object is the return code, the second object is the text from	 *         stdout, and the third object is the text from stderr	 */	public static Scriptable execute(Context cx, Scriptable thisObj, Object[] args, Function funObj)	{		Scriptable result = null;			if (args.length > 0)		{			String command = args[0].toString();			String input = StringUtils.EMPTY;				if (args.length > 1)			{				input = args[1].toString();			}				Process p = null;			int retCode = 0;			String stdout = StringUtils.EMPTY;			String stderr = StringUtils.EMPTY;				try			{				p = Runtime.getRuntime().exec(command);				p.getOutputStream().write(input.getBytes());				p.getOutputStream().flush();				p.getOutputStream().close();				retCode = p.waitFor();				// retCode = p.exitValue();				stdout = getText(p.getInputStream());				stderr = getText(p.getErrorStream());				}			catch (IOException e)			{				if (p != null)				{					retCode = p.exitValue();				}			}			catch (InterruptedException e)			{				e.printStackTrace();			}				// create Object			Scriptable scope = ScriptableObject.getTopLevelScope(thisObj);				result = cx.newObject(scope, "Object"); //$NON-NLS-1$				// set property values			result.put("code", result, new Integer(retCode)); //$NON-NLS-1$			result.put("stdout", result, stdout); //$NON-NLS-1$			result.put("stderr", result, stderr); //$NON-NLS-1$		}			// return result		return result;	}	/**	 * Popup an alert box with the specified message	 * 	 * @param message	 *            The message to display in an alert dialog	 */	public void alert(final String message)	{		final Display currentDisplay = Display.getCurrent();		if (currentDisplay != null)		{			currentDisplay.syncExec(new Runnable()			{				public void run()				{					Shell shell = currentDisplay.getActiveShell();					if (shell != null)					{						MessageDialog.openWarning(shell, "Eclipse Monkey Alert", message); //$NON-NLS-1$					}				}			});		}	}	/**	 * Stop a setTimeout from firing its associated function	 * 	 * @param timeoutId	 *            The setTimeout id returned when setTimeout was invoked. If the id is not recognized, this method does	 *            nothing	 */	public void clearTimeout(int timeoutId)	{		synchronized (this._runningSetTimeouts)		{			Integer id = new Integer(timeoutId);			if (this._runningSetTimeouts.containsKey(id))			{				this._runningSetTimeouts.remove(id);			}		}	}	/**	 * Popup an confirm box with the specified message	 * 	 * @param message	 *            The message to display at the confirmation prompt	 * @return boolean	 */	public boolean confirm(final String message)	{		/**		 * inner class for result		 */		class Answer		{			public boolean result = false;		}		// create instance of inner class		final Answer a = new Answer();		// get reply from user		final Display currentDisplay = Display.getCurrent();		if (currentDisplay != null)		{			currentDisplay.syncExec(new Runnable()			{				public void run()				{					Shell shell = currentDisplay.getActiveShell();					if (shell != null)					{						a.result = MessageDialog.openConfirm(shell, "Eclipse Monkey Confirm", message); //$NON-NLS-1$					}				}			});		}		return a.result;	}	/**	 * Create all properties for this global instance	 */	protected void createAllProperties()	{		this.createProperties();		this.createFunctionProperties();	}	/**	 * Create all function properties for this global. Sub-classes can override this method to modify how function	 * properties are added to global; however, most sub-classes will need only to override getFunctionPropertyNames to	 * include the additional function names provided by that instance.	 */	protected void createFunctionProperties()	{		String[] propertyNames = this.getFunctionPropertyNames();		if (propertyNames != null)		{			this.defineFunctionProperties(propertyNames, this.getClass(), READONLY | PERMANENT);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲日本国产| 国产日产欧美一区二区三区 | 成人黄页毛片网站| 欧洲色大大久久| 久久精品一区四区| 五月激情综合婷婷| 成人高清av在线| 精品女同一区二区| 婷婷中文字幕综合| 色悠悠亚洲一区二区| 久久久国产综合精品女国产盗摄| 亚洲最新视频在线播放| 国产高清视频一区| 久久一区二区三区四区| 日韩av电影免费观看高清完整版| 91无套直看片红桃| 国产精品久久精品日日| 国产一区二区电影| www国产精品av| 精品一区二区三区蜜桃| 欧美一二三四区在线| 午夜在线成人av| 欧美在线一区二区三区| 亚洲视频在线一区| 91性感美女视频| 国产精品嫩草久久久久| 国产宾馆实践打屁股91| 久久综合给合久久狠狠狠97色69| 麻豆视频观看网址久久| 日韩一级高清毛片| 日韩av一区二区在线影视| 欧美高清视频不卡网| 亚洲成人中文在线| 3751色影院一区二区三区| 亚洲成av人片在www色猫咪| 91视频.com| 亚洲精品高清在线观看| 色嗨嗨av一区二区三区| 亚洲影院免费观看| 在线电影欧美成精品| 日韩av在线播放中文字幕| 欧美一区二区三区精品| 久久se精品一区二区| 精品国产91洋老外米糕| 国产精品自拍av| 国产精品每日更新在线播放网址| 不卡视频一二三四| 一二三区精品视频| 欧美精品久久一区二区三区| 日韩 欧美一区二区三区| 精品免费国产一区二区三区四区| 蜜桃视频一区二区| 国产日产亚洲精品系列| 色综合久久中文综合久久牛| 亚洲一区二区三区在线| 日韩欧美中文字幕一区| 成人午夜在线免费| 亚洲综合一区二区| 亚洲精品一区二区三区影院| 成人午夜激情视频| 亚洲国产日韩综合久久精品| 日韩欧美电影在线| www.成人网.com| 亚洲第一久久影院| 久久久国产午夜精品| 色综合久久综合网欧美综合网| 日韩有码一区二区三区| 国产色91在线| 欧美精品丝袜中出| 国产在线精品一区在线观看麻豆| 国产精品国产自产拍在线| 欧美精品123区| av一区二区三区在线| 免费久久精品视频| 亚洲欧美区自拍先锋| 日韩一二三四区| 99久久免费精品| 国产在线看一区| 日韩在线观看一区二区| 亚洲精品少妇30p| 欧美国产97人人爽人人喊| 欧美丰满少妇xxxxx高潮对白| 国产精品18久久久久久久久 | 天堂久久一区二区三区| 欧美精品一区二区精品网| 91蜜桃在线观看| 国内不卡的二区三区中文字幕| 亚洲精品乱码久久久久久久久| 欧美成人r级一区二区三区| 在线观看国产91| 成人av在线资源网| 国产精品伊人色| 另类的小说在线视频另类成人小视频在线 | 国产成人精品综合在线观看| 亚洲成人激情自拍| 亚洲精品中文在线影院| 久久九九全国免费| 日韩午夜在线播放| 欧美一区二区性放荡片| 在线观看国产一区二区| 91一区二区在线| av电影在线不卡| www..com久久爱| 成人avav影音| 99久久精品免费看国产免费软件| 国产资源在线一区| 国产经典欧美精品| 狠狠色狠狠色综合系列| 精品制服美女丁香| 美女精品一区二区| 日韩精品一级中文字幕精品视频免费观看 | 粉嫩嫩av羞羞动漫久久久| 久久99精品久久只有精品| 日本中文字幕一区二区有限公司| 亚洲一区中文在线| 亚洲午夜精品在线| 天天亚洲美女在线视频| 午夜精品视频在线观看| 午夜伊人狠狠久久| 日日夜夜精品视频免费 | 国产精品色在线| 中日韩av电影| 亚洲视频精选在线| 一区二区三区精密机械公司| 亚洲综合丝袜美腿| 丝袜美腿亚洲色图| 蜜臀99久久精品久久久久久软件| 免费看日韩精品| 国产高清不卡一区| 9l国产精品久久久久麻豆| 99久久精品国产毛片| 欧美三级电影精品| 日韩欧美一二三区| 国产日韩欧美电影| 一区二区三区日本| 无码av免费一区二区三区试看 | 亚洲高清在线精品| 免费高清不卡av| 成人亚洲一区二区一| 欧美在线一区二区三区| 精品国免费一区二区三区| 国产色产综合色产在线视频| 亚洲精品videosex极品| 青青草视频一区| 高清不卡一二三区| 欧美日韩一区二区在线观看| 精品日韩一区二区三区免费视频| 国产欧美一区二区三区沐欲| 亚洲男人的天堂av| 国内精品视频一区二区三区八戒| 成人性生交大片免费看视频在线 | 91看片淫黄大片一级| 欧美精品视频www在线观看| 久久久久久影视| 一区二区三国产精华液| 日本 国产 欧美色综合| av中文一区二区三区| 91.成人天堂一区| 国产精品理伦片| 美女一区二区三区| 91黄色免费看| 国产午夜精品福利| 免费成人美女在线观看| 色婷婷狠狠综合| 久久久久国产精品麻豆| 午夜私人影院久久久久| 成人黄色片在线观看| 日韩精品一区二| 亚洲一二三区视频在线观看| www.色综合.com| 久久一区二区三区四区| 日韩高清一区在线| 91福利在线免费观看| 国产精品久久网站| 国产高清不卡二三区| 日韩欧美国产一区在线观看| 亚洲欧美另类小说视频| 国产jizzjizz一区二区| 日韩女优av电影在线观看| 亚欧色一区w666天堂| 在线观看日韩精品| 亚洲欧洲无码一区二区三区| 国产成人午夜99999| 日韩美女主播在线视频一区二区三区| 樱桃视频在线观看一区| www.亚洲在线| 欧美韩国日本不卡| 国产毛片精品国产一区二区三区| 欧美日韩你懂得| 一区二区三区成人| 91网址在线看| 亚洲精品国产品国语在线app| 99视频精品在线| 综合欧美亚洲日本| a在线播放不卡| 亚洲精品国产精华液| 在线一区二区视频| 亚洲成人一区二区| 欧美日韩性生活| 日韩精品亚洲专区|