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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? fileviewer.java

?? 利用SWT作為開發(fā)用戶界面
?? JAVA
?? 第 1 頁 / 共 4 頁
字號(hào):
			if (simulateOnly) {				//System.out.println(getResourceString("simulate.DirectoriesCreated.text",				//	new Object[] { newFile.getPath() }));			} else {				if (! newFile.mkdirs()) return false;			}			File[] subFiles = oldFile.listFiles();			if (subFiles != null) {				if (progressDialog != null) {					progressDialog.addWorkUnits(subFiles.length);				}				for (int i = 0; i < subFiles.length; i++) {					File oldSubFile = subFiles[i];					File newSubFile = new File(newFile, oldSubFile.getName());					if (! copyFileStructure(oldSubFile, newSubFile)) return false;					if (progressDialog != null) {						progressDialog.addProgress(1);						if (progressDialog.isCancelled()) return false;					}				}			}		} else {			/*			 * Copy a file			 */			if (simulateOnly) {				//System.out.println(getResourceString("simulate.CopyFromTo.text",				//	new Object[] { oldFile.getPath(), newFile.getPath() }));			} else {				FileReader in = null;				FileWriter out = null;				try {					in = new FileReader(oldFile);					out = new FileWriter(newFile);								int count;					while ((count = in.read()) != -1) out.write(count);				} catch (FileNotFoundException e) {					return false;				} catch (IOException e) {					return false;				} finally {					try {						if (in != null) in.close();						if (out != null) out.close();					} catch (IOException e) {						return false;					}				}			}		}		return true;	}	/**	 * Deletes a file or entire directory structure.	 * 	 * @param oldFile the location of the old file or directory	 * @return true iff the operation succeeds without errors	 */	boolean deleteFileStructure(File oldFile) {		if (oldFile == null) return false;				if (oldFile.isDirectory()) {			/*			 * Delete a directory			 */			if (progressDialog != null) {				progressDialog.setDetailFile(oldFile, ProgressDialog.DELETE);			}			File[] subFiles = oldFile.listFiles();			if (subFiles != null) {				if (progressDialog != null) {					progressDialog.addWorkUnits(subFiles.length);				}				for (int i = 0; i < subFiles.length; i++) {					File oldSubFile = subFiles[i];					if (! deleteFileStructure(oldSubFile)) return false;					if (progressDialog != null) {						progressDialog.addProgress(1);						if (progressDialog.isCancelled()) return false;					}				}			}		}		if (simulateOnly) {			//System.out.println(getResourceString("simulate.Delete.text",			//	new Object[] { oldFile.getPath(), oldFile.getPath() }));			return true;		} else {			return oldFile.delete();		}	}		/**	 * Sorts files lexicographically by name.	 * 	 * @param files the array of Files to be sorted	 */	static void sortFiles(File[] files) {		/* Very lazy merge sort algorithm */		sortBlock(files, 0, files.length - 1, new File[files.length]);	}	private static void sortBlock(File[] files, int start, int end, File[] mergeTemp) {		final int length = end - start + 1;		if (length < 8) {			for (int i = end; i > start; --i) {				for (int j = end; j > start; --j)  {					if (compareFiles(files[j - 1], files[j]) > 0) {					    final File temp = files[j]; 					    files[j] = files[j-1]; 					    files[j-1] = temp;					}			    }			}			return;		}		final int mid = (start + end) / 2;		sortBlock(files, start, mid, mergeTemp);		sortBlock(files, mid + 1, end, mergeTemp);		int x = start;		int y = mid + 1;		for (int i = 0; i < length; ++i) {			if ((x > mid) || ((y <= end) && compareFiles(files[x], files[y]) > 0)) {				mergeTemp[i] = files[y++];			} else {				mergeTemp[i] = files[x++];			}		}		for (int i = 0; i < length; ++i) files[i + start] = mergeTemp[i];	}	private static int compareFiles(File a, File b) {//		boolean aIsDir = a.isDirectory();//		boolean bIsDir = b.isDirectory();//		if (aIsDir && ! bIsDir) return -1;//		if (bIsDir && ! aIsDir) return 1;		// sort case-sensitive files in a case-insensitive manner		int compare = a.getName().compareToIgnoreCase(b.getName());		if (compare == 0) compare = a.getName().compareTo(b.getName());		return compare;	}		/*	 * This worker updates the table with file information in the background.	 * <p>	 * Implementation notes:	 * <ul>	 * <li> It is designed such that it can be interrupted cleanly.	 * <li> It uses asyncExec() in some places to ensure that SWT Widgets are manipulated in the	 *      right thread.  Exclusive use of syncExec() would be inappropriate as it would require a pair	 *      of context switches between each table update operation.	 * </ul>	 * </p>	 */	/**	 * Stops the worker and waits for it to terminate.	 */	void workerStop() {		if (workerThread == null) return;		synchronized(workerLock) {			workerCancelled = true;			workerStopped = true;			workerLock.notifyAll();		}		while (workerThread != null) {			if (! display.readAndDispatch()) display.sleep();		}	}	/**	 * Notifies the worker that it should update itself with new data.	 * Cancels any previous operation and begins a new one.	 * 	 * @param dir the new base directory for the table, null is ignored	 * @param force if true causes a refresh even if the data is the same	 */	void workerUpdate(File dir, boolean force) {		if (dir == null) return;		if ((!force) && (workerNextDir != null) && (workerNextDir.equals(dir))) return;		synchronized(workerLock) {			workerNextDir = dir;			workerStopped = false;			workerCancelled = true;			workerLock.notifyAll();		}		if (workerThread == null) {			workerThread = new Thread(workerRunnable);			workerThread.start();		}	}	/**	 * Manages the worker's thread	 */	private final Runnable workerRunnable = new Runnable() {		public void run() {			while (! workerStopped) {				synchronized(workerLock) {					workerCancelled = false;					workerStateDir = workerNextDir;				}				workerExecute();				synchronized(workerLock) {					try {						if ((!workerCancelled) && (workerStateDir == workerNextDir)) workerLock.wait();					} catch (InterruptedException e) {					}				}			}			workerThread = null;			// wake up UI thread in case it is in a modal loop awaiting thread termination			// (see workerStop())			display.wake();		}	};		/**	 * Updates the table's contents	 */	private void workerExecute() {		File[] dirList;		// Clear existing information		display.syncExec(new Runnable() {			public void run() {				tableContentsOfLabel.setText(FileViewer.getResourceString("details.ContentsOf.text",					new Object[] { workerStateDir.getPath() }));				table.removeAll();				table.setData(TABLEDATA_DIR, workerStateDir);			}		});		dirList = getDirectoryList(workerStateDir);				for (int i = 0; (! workerCancelled) && (i < dirList.length); i++) {			workerAddFileDetails(dirList[i]);		}	}			/**	 * Adds a file's detail information to the directory list	 */	private void workerAddFileDetails(final File file) {		final String nameString = file.getName();		final String dateString = dateFormat.format(new Date(file.lastModified()));		final String sizeString;		final String typeString;		final Image iconImage;				if (file.isDirectory()) {			typeString = getResourceString("filetype.Folder");			sizeString = "";			iconImage = iconCache.stockImages[iconCache.iconClosedFolder];		} else {			sizeString = getResourceString("filesize.KB",				new Object[] { new Long((file.length() + 512) / 1024) });						int dot = nameString.lastIndexOf('.');			if (dot != -1) {				String extension = nameString.substring(dot);				Program program = Program.findProgram(extension);				if (program != null) {					typeString = program.getName();					iconImage = iconCache.getIconFromProgram(program);				} else {					typeString = getResourceString("filetype.Unknown", new Object[] { extension.toUpperCase() });					iconImage = iconCache.stockImages[iconCache.iconFile];				}			} else {				typeString = getResourceString("filetype.None");				iconImage = iconCache.stockImages[iconCache.iconFile];			}		}		final String[] strings = new String[] { nameString, sizeString, typeString, dateString };		display.syncExec(new Runnable() {			public void run () {				// guard against the shell being closed before this runs				if (shell.isDisposed()) return;				TableItem tableItem = new TableItem(table, 0);				tableItem.setText(strings);				tableItem.setImage(iconImage);				tableItem.setData(TABLEITEMDATA_FILE, file);			}		});	}		/**	 * Instances of this class manage a progress dialog for file operations.	 */	class ProgressDialog {		public final static int COPY = 0;		public final static int DELETE = 1;		public final static int MOVE = 2;		Shell shell;		Label messageLabel, detailLabel;		ProgressBar progressBar;		Button cancelButton;		boolean isCancelled = false;		final String operationKeyName[] = {			"Copy",			"Delete",			"Move"		};			/**		 * Creates a progress dialog but does not open it immediately.		 * 		 * @param parent the parent Shell		 * @param style one of COPY, MOVE		 */		public ProgressDialog(Shell parent, int style) {			shell = new Shell(parent, SWT.BORDER | SWT.TITLE | SWT.APPLICATION_MODAL);			GridLayout gridLayout = new GridLayout();			shell.setLayout(gridLayout);			shell.setText(getResourceString("progressDialog." + operationKeyName[style] + ".title"));			shell.addShellListener(new ShellAdapter() {				public void shellClosed(ShellEvent e) {					isCancelled = true;				}			});						messageLabel = new Label(shell, SWT.HORIZONTAL);			messageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));			messageLabel.setText(getResourceString("progressDialog." + operationKeyName[style] + ".description"));						progressBar = new ProgressBar(shell, SWT.HORIZONTAL | SWT.WRAP);			progressBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));			progressBar.setMinimum(0);			progressBar.setMaximum(0);						detailLabel = new Label(shell, SWT.HORIZONTAL);			GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);			gridData.widthHint = 400;			detailLabel.setLayoutData(gridData);						cancelButton = new Button(shell, SWT.PUSH);			cancelButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_FILL));			cancelButton.setText(getResourceString("progressDialog.cancelButton.text"));			cancelButton.addSelectionListener(new SelectionAdapter() {				public void widgetSelected(SelectionEvent e) {					isCancelled = true;					cancelButton.setEnabled(false);				}			});		}		/**		 * Sets the detail text to show the filename along with a string		 * representing the operation being performed on that file.		 * 		 * @param file the file to be detailed		 * @param operation one of COPY, DELETE		 */		public void setDetailFile(File file, int operation) {			detailLabel.setText(getResourceString("progressDialog." + operationKeyName[operation] + ".operation",				new Object[] { file }));		}		/**		 * Returns true if the Cancel button was been clicked.		 * 		 * @return true if the Cancel button was clicked.		 */		public boolean isCancelled() {			return isCancelled;		}		/**		 * Sets the total number of work units to be performed.		 * 		 * @param work the total number of work units		 */		public void setTotalWorkUnits(int work) {			progressBar.setMaximum(work);		}		/**		 * Adds to the total number of work units to be performed.		 * 		 * @param work the number of work units to add		 */		public void addWorkUnits(int work) {			setTotalWorkUnits(progressBar.getMaximum() + work);		}		/**		 * Sets the progress of completion of the total work units.		 * 		 * @param work the total number of work units completed		 */		public void setProgress(int work) {			progressBar.setSelection(work);			while (display.readAndDispatch()); // enable event processing		}		/**		 * Adds to the progress of completion of the total work units.		 * 		 * @param work the number of work units completed to add		 */		public void addProgress(int work) {			setProgress(progressBar.getSelection() + work);		}		/**		 * Opens the dialog.		 */		public void open() {			shell.pack();			final Shell parentShell = (Shell) shell.getParent();			Rectangle rect = parentShell.getBounds();			Rectangle bounds = shell.getBounds();			bounds.x = rect.x + (rect.width - bounds.width) / 2;			bounds.y = rect.y + (rect.height - bounds.height) / 2;			shell.setBounds(bounds);			shell.open();		}		/**		 * Closes the dialog and disposes its resources.		 */		public void close() {			shell.close();			shell.dispose();			shell = null;			messageLabel = null;			detailLabel = null;			progressBar = null;			cancelButton = null;		}	}}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩在线播放三区四区| 午夜精品福利在线| 国产成人自拍网| 国产日韩欧美a| 国产精品18久久久| 国产精品网站一区| 99国内精品久久| 一区二区三区中文在线| 一本久久a久久免费精品不卡| 亚洲另类一区二区| 欧美日韩国产影片| 精品亚洲国内自在自线福利| 国产欧美一区二区精品性色| 91精品国产福利在线观看| 午夜精品久久久久久久久久久| 日韩网站在线看片你懂的| 精品免费日韩av| 狠狠网亚洲精品| 色狠狠一区二区| 国产精品国产三级国产a| 国产精品一区二区三区乱码| 国产日韩精品一区二区浪潮av| 亚洲少妇30p| 欧美在线影院一区二区| 国产欧美精品一区二区三区四区| 国产白丝精品91爽爽久久| 亚洲图片另类小说| 91精品蜜臀在线一区尤物| 高清国产午夜精品久久久久久| 亚洲国产精品影院| 日韩女同互慰一区二区| 97国产精品videossex| 午夜影院久久久| 国产午夜亚洲精品羞羞网站| 欧美日韩一区二区在线视频| 国产风韵犹存在线视精品| 亚洲无人区一区| 欧美国产日产图区| 91麻豆精品久久久久蜜臀| 99这里只有久久精品视频| 美女视频免费一区| 亚洲一区在线电影| 亚洲国产精品成人综合| 欧美一级黄色片| 日本高清视频一区二区| 国内精品免费**视频| 亚洲国产成人91porn| 欧美国产乱子伦 | 成人在线综合网| 国产一区二区三区日韩| 亚洲在线视频免费观看| 久久一二三国产| 欧美一区日韩一区| 色天天综合久久久久综合片| 国产91精品一区二区| 久久se精品一区二区| 午夜亚洲国产au精品一区二区| 国产精品久久国产精麻豆99网站| 久久久久久电影| 日韩一区二区在线免费观看| 欧美亚洲丝袜传媒另类| 91偷拍与自偷拍精品| 国产91对白在线观看九色| 久久精品国产网站| 蜜桃视频免费观看一区| 日韩精品成人一区二区三区| 亚洲一区在线观看网站| 亚洲最快最全在线视频| 亚洲日本va午夜在线影院| 国产精品麻豆网站| 国产日韩综合av| 久久婷婷国产综合国色天香 | 欧美精品一区男女天堂| 欧美一区二区女人| 欧美美女喷水视频| 日韩欧美黄色影院| 国产一区美女在线| 亚洲你懂的在线视频| 视频一区中文字幕| 亚洲制服丝袜在线| 亚洲1区2区3区4区| 亚洲v日本v欧美v久久精品| 亚洲精品五月天| 亚洲精品综合在线| 亚洲精品视频在线| 亚洲同性gay激情无套| 亚洲卡通欧美制服中文| 亚洲精品久久久蜜桃| 一区二区激情小说| 午夜久久久久久久久久一区二区| 亚洲综合丝袜美腿| 日日欢夜夜爽一区| 麻豆精品新av中文字幕| 国模套图日韩精品一区二区| 风间由美中文字幕在线看视频国产欧美| 国产一区欧美一区| 99热这里都是精品| 欧美三级乱人伦电影| 337p亚洲精品色噜噜| 精品国产一区久久| 国产精品丝袜91| 亚洲一区二区偷拍精品| 日本视频中文字幕一区二区三区| 九色综合国产一区二区三区| 成人免费福利片| 在线观看日韩电影| 精品三级在线观看| 中文字幕中文字幕一区| 亚洲国产精品久久艾草纯爱| 国产一区二区三区在线观看免费 | 亚洲桃色在线一区| 日韩国产成人精品| 亚洲 欧美综合在线网络| 久久99久久99小草精品免视看| 国产精品自产自拍| 91精品办公室少妇高潮对白| 日韩色视频在线观看| 国产精品色噜噜| 天堂影院一区二区| av激情综合网| 欧美r级在线观看| 一区二区三区日韩| 极品少妇xxxx精品少妇| 日本道精品一区二区三区| 精品电影一区二区| 一区二区三区av电影| 国产二区国产一区在线观看| 欧美喷潮久久久xxxxx| 国产精品成人午夜| 精品亚洲aⅴ乱码一区二区三区| 91在线观看一区二区| 欧美mv日韩mv亚洲| 国产亚洲一区二区在线观看| 亚洲不卡一区二区三区| 成人午夜视频在线观看| 日韩欧美中文字幕一区| 亚洲免费观看高清完整| 国产一区二区三区免费看| 欧美精品一级二级三级| 亚洲欧美综合色| 国产成人综合在线| 日韩欧美一级二级三级| 一区av在线播放| 91色婷婷久久久久合中文| 国产午夜亚洲精品理论片色戒| 日韩电影免费在线| 欧美伊人久久大香线蕉综合69| 国产精品嫩草影院av蜜臀| 精品在线视频一区| 日韩一区二区视频在线观看| 亚洲在线视频网站| 色94色欧美sute亚洲13| 亚洲情趣在线观看| 成人久久久精品乱码一区二区三区 | 亚洲综合一区二区三区| 成人一区二区视频| 久久亚洲免费视频| 久久精品国产精品亚洲综合| 56国语精品自产拍在线观看| 一区二区三区精品在线观看| 色综合天天在线| 亚洲欧美激情一区二区| 成年人网站91| 国产精品剧情在线亚洲| av电影天堂一区二区在线观看| 欧美极品少妇xxxxⅹ高跟鞋| 国产a区久久久| 亚洲欧洲精品一区二区三区不卡| www.欧美色图| 最新日韩av在线| 色伊人久久综合中文字幕| 亚洲久本草在线中文字幕| 色视频一区二区| 亚洲国产一区二区三区| 欧美日韩亚洲综合一区| 亚洲成人激情av| 欧美一区二区日韩| 美腿丝袜在线亚洲一区 | 一本大道久久a久久综合 | 亚洲电影一级片| 欧美精品黑人性xxxx| 日韩avvvv在线播放| 欧美大片在线观看一区二区| 国产一区二区三区四区五区入口| 国产欧美在线观看一区| 成人一级片网址| 一片黄亚洲嫩模| 欧美成人在线直播| 国产成人av一区| 亚洲精品成人精品456| 91麻豆精品国产91久久久资源速度 | 欧美激情中文字幕一区二区| 99久久亚洲一区二区三区青草| 一区二区视频在线看| 7777精品伊人久久久大香线蕉经典版下载| 免费成人在线网站| 久久精品人人爽人人爽| 日本精品一区二区三区高清| 蜜臀91精品一区二区三区| 久久精品在这里|