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

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

?? filedialog.java

?? 源碼為Eclipse開源開發平臺桌面開發工具SWT的源代碼,
?? JAVA
字號:
/******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html *  * Contributors: *     IBM Corporation - initial API and implementation *******************************************************************************/package org.eclipse.swt.widgets;import org.eclipse.swt.internal.win32.*;import org.eclipse.swt.*;/** * Instances of this class allow the user to navigate * the file system and select or enter a file name. * <dl> * <dt><b>Styles:</b></dt> * <dd>SAVE, OPEN, MULTI</dd> * <dt><b>Events:</b></dt> * <dd>(none)</dd> * </dl> * <p> * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the SWT implementation. * </p> */public class FileDialog extends Dialog {	String [] filterNames = new String [0];	String [] filterExtensions = new String [0];	String [] fileNames = new String [0];	String filterPath = "", fileName = "";	static final String FILTER = "*.*";	static int BUFFER_SIZE = 1024 * 32;/** * Constructs a new instance of this class given only its parent. * * @param parent a shell which will be the parent of the new instance * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li> * </ul> * @exception SWTException <ul> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> * </ul> */public FileDialog (Shell parent) {	this (parent, SWT.PRIMARY_MODAL);}/** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this * class, or must be built by <em>bitwise OR</em>'ing together  * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. * Style bits are also inherited from superclasses. * </p> * * @param parent a shell which will be the parent of the new instance * @param style the style of dialog to construct * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li> * </ul> * @exception SWTException <ul> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> * </ul> */public FileDialog (Shell parent, int style) {	super (parent, style);	checkSubclass ();}/** * Returns the path of the first file that was * selected in the dialog relative to the filter path *  * @return the relative path of the file */public String getFileName () {	return fileName;}/** * Returns the paths of all files that were selected * in the dialog relative to the filter path. *  * @return the relative paths of the files */public String [] getFileNames () {	return fileNames;}/** * Returns the file extensions which the dialog will * use to filter the files it shows. * * @return the file extensions filter */public String [] getFilterExtensions () {	return filterExtensions;}/** * Returns the file names which the dialog will * use to filter the files it shows. * * @return the file name filter */public String [] getFilterNames () {	return filterNames;}/** * Returns the directory path that the dialog will use. * File names in this path will appear in the dialog, * filtered according to the filter extensions. * * @return the directory path string *  * @see #setFilterExtensions */public String getFilterPath () {	return filterPath;}/** * Makes the dialog visible and brings it to the front * of the display. * * @return a string describing the absolute path of the first selected file, *         or null if the dialog was cancelled or an error occurred * * @exception SWTException <ul> *    <li>ERROR_WIDGET_DISPOSED - if the dialog has been disposed</li> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog</li> * </ul> */public String open () {	int hHeap = OS.GetProcessHeap ();		/* Get the owner HWND for the dialog */	int hwndOwner = 0;	if (parent != null) hwndOwner = parent.handle;	/* Convert the title and copy it into lpstrTitle */	if (title == null) title = "";		/* Use the character encoding for the default locale */	TCHAR buffer3 = new TCHAR (0, title, true);	int byteCount3 = buffer3.length () * TCHAR.sizeof;	int lpstrTitle = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount3);	OS.MoveMemory (lpstrTitle, buffer3, byteCount3); 	/* Compute filters and copy into lpstrFilter */	String strFilter = "";	if (filterNames == null) filterNames = new String [0];	if (filterExtensions == null) filterExtensions = new String [0];	for (int i=0; i<filterExtensions.length; i++) {		String filterName = filterExtensions [i];		if (i < filterNames.length) filterName = filterNames [i];		strFilter = strFilter + filterName + '\0' + filterExtensions [i] + '\0';	}	if (filterExtensions.length == 0) {		strFilter = strFilter + FILTER + '\0' + FILTER + '\0';	}	/* Use the character encoding for the default locale */	TCHAR buffer4 = new TCHAR (0, strFilter, true);	int byteCount4 = buffer4.length () * TCHAR.sizeof;	int lpstrFilter = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount4);	OS.MoveMemory (lpstrFilter, buffer4, byteCount4);		/* Convert the fileName and filterName to C strings */	if (fileName == null) fileName = "";	/* Use the character encoding for the default locale */	TCHAR name = new TCHAR (0, fileName, true);	/*	* Copy the name into lpstrFile and ensure that the	* last byte is NULL and the buffer does not overrun.	*/	int nMaxFile = OS.MAX_PATH;	if ((style & SWT.MULTI) != 0) nMaxFile = Math.max (nMaxFile, BUFFER_SIZE);	int byteCount = nMaxFile * TCHAR.sizeof;	int lpstrFile = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);	int byteCountFile = Math.min (name.length () * TCHAR.sizeof, byteCount - TCHAR.sizeof);	OS.MoveMemory (lpstrFile, name, byteCountFile);	/*	* Copy the path into lpstrInitialDir and ensure that	* the last byte is NULL and the buffer does not overrun.	*/	if (filterPath == null) filterPath = "";	/* Use the character encoding for the default locale */	TCHAR path = new TCHAR (0, filterPath.replace ('/', '\\'), true);	int byteCount5 = OS.MAX_PATH * TCHAR.sizeof;	int lpstrInitialDir = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount5);	int byteCountDir = Math.min (path.length () * TCHAR.sizeof, byteCount5 - TCHAR.sizeof);	OS.MoveMemory (lpstrInitialDir, path, byteCountDir);	/* Create the file dialog struct */	OPENFILENAME struct = new OPENFILENAME ();	struct.lStructSize = OPENFILENAME.sizeof;	struct.Flags = OS.OFN_HIDEREADONLY | OS.OFN_NOCHANGEDIR;	if ((style & SWT.MULTI) != 0) {		struct.Flags |= OS.OFN_ALLOWMULTISELECT | OS.OFN_EXPLORER;	}	struct.hwndOwner = hwndOwner;	struct.lpstrTitle = lpstrTitle;	struct.lpstrFile = lpstrFile;	struct.nMaxFile = nMaxFile;	struct.lpstrInitialDir = lpstrInitialDir;	struct.lpstrFilter = lpstrFilter;	struct.nFilterIndex = 0;	/*	* Set the default extension to an empty string.  If the	* user fails to type an extension and this extension is	* empty, Windows uses the current value of the filter	* extension at the time that the dialog is closed.	*/	int lpstrDefExt = 0;	boolean save = (style & SWT.SAVE) != 0;	if (save) {		lpstrDefExt = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, TCHAR.sizeof);		struct.lpstrDefExt = lpstrDefExt;	}		/* Make the parent shell be temporary modal */	Shell oldModal = null;	Display display = null;	if ((style & (SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL)) != 0) {		display = parent.getDisplay ();		oldModal = display.getModalDialogShell ();		display.setModalDialogShell (parent);	}		/*	* Open the dialog.  If the open fails due to an invalid	* file name, use an empty file name and open it again.	*/	boolean success = (save) ? OS.GetSaveFileName (struct) : OS.GetOpenFileName (struct);	if (OS.CommDlgExtendedError () == OS.FNERR_INVALIDFILENAME) {		OS.MoveMemory (lpstrFile, new TCHAR (0, "", true), TCHAR.sizeof);		success = (save) ? OS.GetSaveFileName (struct) : OS.GetOpenFileName (struct);	}	/* Clear the temporary dialog modal parent */	if ((style & (SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL)) != 0) {		display.setModalDialogShell (oldModal);	}		/* Set the new path, file name and filter */	fileNames = new String [0];	String fullPath = null;	if (success) {				/* Use the character encoding for the default locale */		TCHAR buffer = new TCHAR (0, struct.nMaxFile);		int byteCount1 = buffer.length () * TCHAR.sizeof;		OS.MoveMemory (buffer, lpstrFile, byteCount1);				/*		* Bug in WinCE.  For some reason, nFileOffset and nFileExtension		* are always zero on WinCE HPC. nFileOffset is always zero on		* WinCE PPC when using GetSaveFileName.  nFileOffset is correctly		* set on WinCE PPC when using OpenFileName.  The fix is to parse		* lpstrFile to calculate nFileOffset.		* 		* Note: WinCE does not support multi-select file dialogs.		*/		int nFileOffset = struct.nFileOffset;		if (OS.IsWinCE && nFileOffset == 0) {			int index = 0; 			while (index < buffer.length ()) {				int ch = buffer.tcharAt (index);				if (ch == 0) break;				if (ch == '\\') nFileOffset = index + 1;				index++;			}		}		if (nFileOffset > 0) {					/* Use the character encoding for the default locale */			TCHAR prefix = new TCHAR (0, nFileOffset - 1);			int byteCount2 = prefix.length () * TCHAR.sizeof;			OS.MoveMemory (prefix, lpstrFile, byteCount2);			filterPath = prefix.toString (0, prefix.length ());						/*			* Get each file from the buffer.  Files are delimited			* by a NULL character with 2 NULL characters at the end.			*/			int count = 0;			fileNames = new String [(style & SWT.MULTI) != 0 ? 4 : 1];			int start = nFileOffset;			do {				int end = start;				while (end < buffer.length () && buffer.tcharAt (end) != 0) end++;				String string = buffer.toString (start, end - start);				start = end;				if (count == fileNames.length) {					String [] newFileNames = new String [fileNames.length + 4];					System.arraycopy (fileNames, 0, newFileNames, 0, fileNames.length);					fileNames = newFileNames;				}				fileNames [count++] = string;				if ((style & SWT.MULTI) == 0) break;				start++;			} while (start < buffer.length () && buffer.tcharAt (start) != 0);						if (fileNames.length > 0) fileName = fileNames  [0];			String separator = "";			int length = filterPath.length ();			if (length > 0 && filterPath.charAt (length - 1) != '\\') {				separator = "\\";			}			fullPath = filterPath + separator + fileName;			if (count < fileNames.length) {				String [] newFileNames = new String [count];				System.arraycopy (fileNames, 0, newFileNames, 0, count);				fileNames = newFileNames;			}		}	}		/* Free the memory that was allocated. */	OS.HeapFree (hHeap, 0, lpstrFile);	OS.HeapFree (hHeap, 0, lpstrFilter);	OS.HeapFree (hHeap, 0, lpstrInitialDir);	OS.HeapFree (hHeap, 0, lpstrTitle);	if (lpstrDefExt != 0) OS.HeapFree (hHeap, 0, lpstrDefExt);	/*	* This code is intentionally commented.  On some	* platforms, the owner window is repainted right	* away when a dialog window exits.  This behavior	* is currently unspecified.	*///	if (hwndOwner != 0) OS.UpdateWindow (hwndOwner);		/* Answer the full path or null */	return fullPath;}/** * Set the initial filename which the dialog will * select by default when opened to the argument, * which may be null.  The name will be prefixed with * the filter path when one is supplied. *  * @param string the file name */public void setFileName (String string) {	fileName = string;}/** * Set the file extensions which the dialog will * use to filter the files it shows to the argument, * which may be null. * * @param extensions the file extension filter */public void setFilterExtensions (String [] extensions) {	filterExtensions = extensions;}/** * Sets the file names which the dialog will * use to filter the files it shows to the argument, * which may be null. * * @param names the file name filter */public void setFilterNames (String [] names) {	filterNames = names;}/** * Sets the directory path that the dialog will use * to the argument, which may be null. File names in this * path will appear in the dialog, filtered according * to the filter extensions. * * @param string the directory path *  * @see #setFilterExtensions */public void setFilterPath (String string) {	filterPath = string;}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
老司机免费视频一区二区| 欧洲色大大久久| 亚洲国产毛片aaaaa无费看| 精品福利视频一区二区三区| 欧美日韩三级一区| 成人亚洲一区二区一| 洋洋成人永久网站入口| 亚洲视频综合在线| 欧美国产日韩一二三区| 日韩欧美一二三四区| 欧美人妖巨大在线| 欧美日韩国产大片| 欧美日本一道本在线视频| 日本高清不卡视频| 91美女片黄在线观看| 国产一区二区三区观看| 麻豆成人久久精品二区三区红 | 日韩一区二区中文字幕| 91亚洲精品一区二区乱码| 国产一区二区看久久| 另类人妖一区二区av| 青青青伊人色综合久久| 五月天久久比比资源色| 午夜伦欧美伦电影理论片| 无吗不卡中文字幕| 国产成人在线网站| 首页国产丝袜综合| 欧美aa在线视频| 国产麻豆精品theporn| 国产成人综合精品三级| 国产suv精品一区二区883| 国产91清纯白嫩初高中在线观看 | 久久 天天综合| 韩国精品主播一区二区在线观看| 美女网站视频久久| 狠狠色丁香婷婷综合| 国产成人在线看| 色婷婷av一区二区三区gif| 精品视频在线看| 日韩一区二区三区电影在线观看| 久久婷婷久久一区二区三区| 国产亚洲精品7777| 亚洲天堂免费在线观看视频| 一区二区三区国产精华| 首页国产欧美日韩丝袜| 国产久卡久卡久卡久卡视频精品| 波多野结衣亚洲一区| 在线不卡中文字幕播放| 久久美女高清视频| 亚洲精品欧美综合四区| 美女一区二区在线观看| av电影天堂一区二区在线| 91福利国产成人精品照片| 日韩一区二区三区视频在线| 日本一区二区免费在线| 一区二区三区在线影院| 另类小说图片综合网| 色综合久久天天| 91色在线porny| 欧美精品久久99| 国产人成一区二区三区影院| 亚洲夂夂婷婷色拍ww47| 国内成人免费视频| 在线精品视频一区二区| 日韩精品一区二区三区三区免费 | 日韩一级在线观看| 国产精品丝袜久久久久久app| 午夜精品一区在线观看| 国产精品1区2区3区在线观看| 在线一区二区三区四区| 国产精品视频看| 亚洲电影一级黄| 波多野结衣的一区二区三区| 欧美一卡在线观看| 亚洲黄网站在线观看| 久久国产视频网| 91精品国产色综合久久不卡电影| 中文字幕一区二区三区在线观看| 午夜国产精品影院在线观看| 国产·精品毛片| 2017欧美狠狠色| 蜜臀av性久久久久蜜臀aⅴ| 99精品视频免费在线观看| 久久久99精品久久| 极品少妇xxxx偷拍精品少妇| 欧美日韩色一区| 亚洲免费视频中文字幕| a在线播放不卡| 久久众筹精品私拍模特| 免费在线观看精品| 91麻豆精品国产91久久久久久 | 视频在线观看一区二区三区| av午夜一区麻豆| 国产亚洲一区二区三区在线观看| 日韩国产精品久久久久久亚洲| 91在线丨porny丨国产| 国产精品看片你懂得| 成人av动漫在线| 欧美国产日韩一二三区| 成人高清在线视频| 日本一区二区成人| 成人午夜精品一区二区三区| 欧美r级在线观看| 韩国一区二区在线观看| 欧美成人一区二区三区| 韩国一区二区视频| 久久影院电视剧免费观看| 国产一区不卡在线| 久久婷婷色综合| 成人黄色免费短视频| 国产精品久久久久久久蜜臀| 丰满岳乱妇一区二区三区| 国产精品免费视频一区| 91免费看片在线观看| 亚洲国产精品v| 91视频在线看| 午夜欧美大尺度福利影院在线看| 欧美亚日韩国产aⅴ精品中极品| 亚洲成av人片一区二区梦乃| 欧美一级日韩免费不卡| 国产酒店精品激情| 国产精品久久久久国产精品日日| 99re在线精品| 亚洲欧洲国产日韩| 欧美亚洲一区二区三区四区| 美国精品在线观看| 欧美国产日韩亚洲一区| 欧美亚洲综合色| 精品在线视频一区| 亚洲图片你懂的| 欧美三级视频在线观看| 国内精品第一页| 一区二区三区日韩欧美| 日韩一区二区三区av| 成人黄色在线视频| 偷窥少妇高潮呻吟av久久免费| 精品美女被调教视频大全网站| 91香蕉国产在线观看软件| 日本视频在线一区| 欧美极品美女视频| 欧美精品v国产精品v日韩精品 | jizz一区二区| 青青国产91久久久久久| 精品久久久久久久久久久久包黑料 | 成人av网站免费| 五月天婷婷综合| 国产人久久人人人人爽| 这里只有精品电影| 成人一区二区三区视频| 婷婷久久综合九色国产成人| 国产精品毛片a∨一区二区三区| 99热99精品| 久久激五月天综合精品| 亚洲黄色性网站| 日本一区二区在线不卡| 日韩欧美国产系列| 在线看国产日韩| 波多野结衣中文一区| 国产一区二区不卡老阿姨| 国产精品你懂的在线| 欧美成人精品1314www| 欧美日韩国产小视频在线观看| 蜜桃av噜噜一区| 亚洲一区二区三区自拍| 成人免费一区二区三区在线观看| 日韩精品一区二区三区在线| 欧美性大战xxxxx久久久| 欧美在线free| 欧美日韩精品免费观看视频| 欧美久久高跟鞋激| 欧美日本在线播放| 91精品国产91久久久久久最新毛片 | 国产欧美一区在线| 国产精品区一区二区三| 亚洲人成在线观看一区二区| 亚洲精品免费在线| 午夜一区二区三区视频| 日本亚洲最大的色成网站www| 日韩电影在线免费看| 精品一区二区在线看| 粉嫩在线一区二区三区视频| 成人午夜大片免费观看| 色综合天天综合狠狠| 欧美人与z0zoxxxx视频| 精品成人一区二区| 成人欧美一区二区三区白人| 亚洲精品免费播放| 免费成人小视频| 粉嫩13p一区二区三区| 日本道免费精品一区二区三区| 在线观看一区二区精品视频| 欧美美女一区二区三区| 久久久精品国产免大香伊| 亚洲男人天堂av网| 看电视剧不卡顿的网站| av午夜一区麻豆| 91精品黄色片免费大全| 中文无字幕一区二区三区| 一区二区在线电影| 久久精品噜噜噜成人av农村|