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

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

?? fileviewer.java

?? 利用SWT作為開發用戶界面
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/******************************************************************************* * Copyright (c) 2000, 2003 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.examples.fileviewer;import org.eclipse.swt.*;import org.eclipse.swt.custom.*;import org.eclipse.swt.dnd.*;import org.eclipse.swt.events.*;import org.eclipse.swt.graphics.*;import org.eclipse.swt.layout.*;import org.eclipse.swt.program.*;import org.eclipse.swt.widgets.*;import java.io.*;import java.text.*;import java.util.*;/** * File Viewer example */public class FileViewer {  	private static ResourceBundle resourceBundle = ResourceBundle.getBundle("examples_fileviewer");	private final static String DRIVE_A = "a:" + File.separator;	private final static String DRIVE_B = "b:" + File.separator;	/* UI elements */ 		private Display display; 	private Shell shell;	private ToolBar toolBar;	private Label numObjectsLabel;	private Label diskSpaceLabel;		private File currentDirectory = null;	private boolean initial = true;		/* Drag and drop optimizations */	private boolean isDragging = false; // if this app is dragging	private boolean isDropping = false; // if this app is dropping	private File[]  processedDropFiles = null; // so Drag only deletes what it needs to	private File[]  deferredRefreshFiles = null;      // to defer notifyRefreshFiles while we do DND	private boolean deferredRefreshRequested = false; // to defer notifyRefreshFiles while we do DND	private ProgressDialog progressDialog = null; // progress dialog for locally-initiated operations	/* Combo view */	private static final String COMBODATA_ROOTS = "Combo.roots";		// File[]: Array of files whose paths are currently displayed in the combo	private static final String COMBODATA_LASTTEXT = "Combo.lastText";		// String: Previous selection text string	private Combo combo;	/* Tree view */	private IconCache iconCache = new IconCache();	private static final String TREEITEMDATA_FILE = "TreeItem.file";		// File: File associated with tree item	private static final String TREEITEMDATA_IMAGEEXPANDED = "TreeItem.imageExpanded";		// Image: shown when item is expanded	private static final String TREEITEMDATA_IMAGECOLLAPSED = "TreeItem.imageCollapsed";		// Image: shown when item is collapsed	private static final String TREEITEMDATA_STUB = "TreeItem.stub";		// Object: if not present or null then the item has not been populated	private Tree tree;	private Label treeScopeLabel;	/* Table view */	private static final DateFormat dateFormat = DateFormat.getDateTimeInstance(		DateFormat.MEDIUM, DateFormat.MEDIUM);	private static final String TABLEITEMDATA_FILE = "TableItem.file";		// File: File associated with table row	private static final String TABLEDATA_DIR = "Table.dir";		// File: Currently visible directory	private static final int[] tableWidths = new int[] {150, 60, 75, 150};	private final String[] tableTitles = new String [] {		FileViewer.getResourceString("table.Name.title"),		FileViewer.getResourceString("table.Size.title"),		FileViewer.getResourceString("table.Type.title"),		FileViewer.getResourceString("table.Modified.title")	};	private Table table;	private Label tableContentsOfLabel;	/* Table update worker */	// Control data	private final Object workerLock = new Object();		// Lock for all worker control data and state	private volatile Thread  workerThread = null;		// The worker's thread	private volatile boolean workerStopped = false;		// True if the worker must exit on completion of the current cycle	private volatile boolean workerCancelled = false;		// True if the worker must cancel its operations prematurely perhaps due to a state update	// Worker state information -- this is what gets synchronized by an update	private volatile File workerStateDir = null;	// State information to use for the next cycle	private volatile File workerNextDir = null;	/* Simulate only flag */	// when true, disables actual filesystem manipulations and outputs results to standard out	private boolean simulateOnly = true;	/**	 * Runs main program.	 */	public static void main (String [] args) {		Display display = new Display ();		FileViewer application = new FileViewer();		Shell shell = application.open(display);		while (! shell.isDisposed()) {			if (! display.readAndDispatch()) display.sleep();		}		application.close();		display.dispose();		System.out.println("OS:"+System.getProperty("os.name"));	}	/**	 * Opens the main program.	 */	public Shell open(Display display) {				// Create the window		this.display = display;		iconCache.initResources(display);		shell = new Shell();		createShellContents();		notifyRefreshFiles(null);		shell.open();		return shell;	}	/**	 * Closes the main program.	 */	void close() {		workerStop();		iconCache.freeResources();	}		/**	 * Returns a string from the resource bundle.	 * We don't want to crash because of a missing String.	 * Returns the key if not found.	 */	static String getResourceString(String key) {		try {			return resourceBundle.getString(key);		} catch (MissingResourceException e) {			return key;		} catch (NullPointerException e) {			return "!" + key + "!";		}				}	/**	 * Returns a string from the resource bundle and binds it	 * with the given arguments. If the key is not found,	 * return the key.	 */	static String getResourceString(String key, Object[] args) {		try {			return MessageFormat.format(getResourceString(key), args);		} catch (MissingResourceException e) {			return key;		} catch (NullPointerException e) {			return "!" + key + "!";		}	}	/**	 * Construct the UI	 * 	 * @param container the ShellContainer managing the Shell we are rendering inside	 */	private void createShellContents() {		shell.setText(getResourceString("Title", new Object[] { "" }));			shell.setImage(iconCache.stockImages[iconCache.shellIcon]);		Menu bar = new Menu(shell, SWT.BAR);		shell.setMenuBar(bar);		createFileMenu(bar);		createHelpMenu(bar);		GridLayout gridLayout = new GridLayout();		gridLayout.numColumns = 3;		gridLayout.marginHeight = gridLayout.marginWidth = 0;		shell.setLayout(gridLayout);		GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);		gridData.widthHint = 185;		createComboView(shell, gridData);		gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);		gridData.horizontalSpan = 2;		createToolBar(shell, gridData);		SashForm sashForm = new SashForm(shell, SWT.NONE);		sashForm.setOrientation(SWT.HORIZONTAL);		gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);		gridData.horizontalSpan = 3;		sashForm.setLayoutData(gridData);		createTreeView(sashForm);		createTableView(sashForm);		sashForm.setWeights(new int[] { 2, 5 });		numObjectsLabel = new Label(shell, SWT.BORDER);		gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);		gridData.widthHint = 185;		numObjectsLabel.setLayoutData(gridData);				diskSpaceLabel = new Label(shell, SWT.BORDER);		gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);		gridData.horizontalSpan = 2;		diskSpaceLabel.setLayoutData(gridData);	}		/**	 * Creates the File Menu.	 * 	 * @param parent the parent menu	 */	private void createFileMenu(Menu parent) {		Menu menu = new Menu(parent);		MenuItem header = new MenuItem(parent, SWT.CASCADE);		header.setText(getResourceString("menu.File.text"));		header.setMenu(menu);		final MenuItem simulateItem = new MenuItem(menu, SWT.CHECK);		simulateItem.setText(getResourceString("menu.File.SimulateOnly.text"));		simulateItem.setSelection(simulateOnly);		simulateItem.addSelectionListener(new SelectionAdapter () {			public void widgetSelected(SelectionEvent e) {				simulateOnly = simulateItem.getSelection();			}		});		MenuItem item = new MenuItem(menu, SWT.PUSH);		item.setText(getResourceString("menu.File.Close.text"));		item.addSelectionListener(new SelectionAdapter () {			public void widgetSelected(SelectionEvent e) {				shell.close();			}		});	}		/**	 * Creates the Help Menu.	 * 	 * @param parent the parent menu	 */	private void createHelpMenu(Menu parent) {		Menu menu = new Menu(parent);		MenuItem header = new MenuItem(parent, SWT.CASCADE);		header.setText(getResourceString("menu.Help.text"));		header.setMenu(menu);		MenuItem item = new MenuItem(menu, SWT.PUSH);		item.setText(getResourceString("menu.Help.About.text"));				item.addSelectionListener(new SelectionAdapter () {			public void widgetSelected(SelectionEvent e) {				MessageBox box = new MessageBox(shell, SWT.ICON_INFORMATION | SWT.OK);				box.setText(getResourceString("dialog.About.title"));				box.setMessage(getResourceString("dialog.About.description",					new Object[] { System.getProperty("os.name") }));				box.open();			}		});	}	/**	 * Creates the toolbar	 * 	 * @param shell the shell on which to attach the toolbar	 * @param layoutData the layout data	 */	private void createToolBar(final Shell shell, Object layoutData) {		toolBar = new ToolBar(shell, SWT.NULL);		toolBar.setLayoutData(layoutData);		ToolItem item = new ToolItem(toolBar, SWT.SEPARATOR);		item = new ToolItem(toolBar, SWT.PUSH);		item.setImage(iconCache.stockImages[iconCache.cmdParent]);		item.setToolTipText(getResourceString("tool.Parent.tiptext"));		item.addSelectionListener(new SelectionAdapter () {			public void widgetSelected(SelectionEvent e) {				doParent();			}		});		item = new ToolItem(toolBar, SWT.PUSH);		item.setImage(iconCache.stockImages[iconCache.cmdRefresh]);		item.setToolTipText(getResourceString("tool.Refresh.tiptext"));		item.addSelectionListener(new SelectionAdapter () {			public void widgetSelected(SelectionEvent e) {				doRefresh();			}		});		SelectionAdapter unimplementedListener = new SelectionAdapter() {			public void widgetSelected(SelectionEvent e) {				MessageBox box = new MessageBox(shell, SWT.ICON_INFORMATION | SWT.OK);				box.setText(getResourceString("dialog.NotImplemented.title"));				box.setMessage(getResourceString("dialog.ActionNotImplemented.description"));				box.open();			}		};		item = new ToolItem(toolBar, SWT.SEPARATOR);		item = new ToolItem(toolBar, SWT.PUSH);		item.setImage(iconCache.stockImages[iconCache.cmdCut]);		item.setToolTipText(getResourceString("tool.Cut.tiptext"));		item.addSelectionListener(unimplementedListener);		item = new ToolItem(toolBar, SWT.PUSH);		item.setImage(iconCache.stockImages[iconCache.cmdCopy]);		item.setToolTipText(getResourceString("tool.Copy.tiptext"));		item.addSelectionListener(unimplementedListener);		item = new ToolItem(toolBar, SWT.PUSH);		item.setImage(iconCache.stockImages[iconCache.cmdPaste]);		item.setToolTipText(getResourceString("tool.Paste.tiptext"));		item.addSelectionListener(unimplementedListener);		item = new ToolItem(toolBar, SWT.SEPARATOR);		item = new ToolItem(toolBar, SWT.PUSH);		item.setImage(iconCache.stockImages[iconCache.cmdDelete]);		item.setToolTipText(getResourceString("tool.Delete.tiptext"));		item.addSelectionListener(unimplementedListener);		item = new ToolItem(toolBar, SWT.PUSH);		item.setImage(iconCache.stockImages[iconCache.cmdRename]);		item.setToolTipText(getResourceString("tool.Rename.tiptext"));		item.addSelectionListener(unimplementedListener);		item = new ToolItem(toolBar, SWT.SEPARATOR);		item = new ToolItem(toolBar, SWT.PUSH);		item.setImage(iconCache.stockImages[iconCache.cmdSearch]);		item.setToolTipText(getResourceString("tool.Search.tiptext"));		item.addSelectionListener(unimplementedListener);		item = new ToolItem(toolBar, SWT.PUSH);		item.setImage(iconCache.stockImages[iconCache.cmdPrint]);		item.setToolTipText(getResourceString("tool.Print.tiptext"));		item.addSelectionListener(unimplementedListener);	}	/**	 * Creates the combo box view.	 * 	 * @param parent the parent control	 */	private void createComboView(Composite parent, Object layoutData) {		combo = new Combo(parent, SWT.NONE);		combo.setLayoutData(layoutData);		combo.addSelectionListener(new SelectionAdapter() {			public void widgetSelected(SelectionEvent e) {				final File[] roots = (File[]) combo.getData(COMBODATA_ROOTS);				if (roots == null) return;				int selection = combo.getSelectionIndex();				if (selection >= 0 && selection < roots.length) {					notifySelectedDirectory(roots[selection]);				}			}			public void widgetDefaultSelected(SelectionEvent e) {				final String lastText = (String) combo.getData(COMBODATA_LASTTEXT);				String text = combo.getText();				if (text == null) return;				if (lastText != null && lastText.equals(text)) return;				combo.setData(COMBODATA_LASTTEXT, text);				notifySelectedDirectory(new File(text));			}		});	}	/**	 * Creates the file tree view.	 * 	 * @param parent the parent control	 */	private void createTreeView(Composite parent) {		Composite composite = new Composite(parent, SWT.NONE);		GridLayout gridLayout = new GridLayout();		gridLayout.numColumns = 1;		gridLayout.marginHeight = gridLayout.marginWidth = 2;		gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0;		composite.setLayout(gridLayout);		treeScopeLabel = new Label(composite, SWT.BORDER);		treeScopeLabel.setText(FileViewer.getResourceString("details.AllFolders.text"));		treeScopeLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));		tree = new Tree(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);		tree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));		tree.addSelectionListener(new SelectionListener() {			public void widgetSelected(SelectionEvent event) {				final TreeItem[] selection = tree.getSelection();				if (selection != null && selection.length != 0) {					TreeItem item = selection[0];					File file = (File) item.getData(TREEITEMDATA_FILE);									notifySelectedDirectory(file);				}			}			public void widgetDefaultSelected(SelectionEvent event) {				final TreeItem[] selection = tree.getSelection();				if (selection != null && selection.length != 0) {					TreeItem item = selection[0];					item.setExpanded(true);					treeExpandItem(item);				}			}		});		tree.addTreeListener(new TreeAdapter() {			public void treeExpanded(TreeEvent event) {				final TreeItem item = (TreeItem) event.item;				final Image image = (Image) item.getData(TREEITEMDATA_IMAGEEXPANDED);				if (image != null) item.setImage(image);				treeExpandItem(item);			}			public void treeCollapsed(TreeEvent event) {				final TreeItem item = (TreeItem) event.item;				final Image image = (Image) item.getData(TREEITEMDATA_IMAGECOLLAPSED);				if (image != null) item.setImage(image);			}		});

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美肥大bbwbbw高潮| 欧美色图天堂网| 韩国成人福利片在线播放| 日本一区二区动态图| 亚洲欧美日韩中文播放| 2014亚洲片线观看视频免费| 在线视频中文字幕一区二区| 成人一区二区在线观看| 麻豆国产欧美一区二区三区| 午夜在线电影亚洲一区| 亚洲男人电影天堂| 亚洲免费观看视频| 亚洲视频综合在线| 欧美日韩免费电影| 亚洲午夜一区二区三区| 日本一区二区三区在线不卡| 26uuu国产日韩综合| 欧美成人综合网站| 精品欧美乱码久久久久久| 日韩精品综合一本久道在线视频| 欧美精品v日韩精品v韩国精品v| 欧美日韩亚洲综合一区二区三区| 国产日韩欧美麻豆| 日本一区二区电影| 亚洲天堂久久久久久久| 亚洲一区在线观看网站| 亚洲国产成人av网| 免费一区二区视频| 国产东北露脸精品视频| 97se亚洲国产综合在线| 欧美日韩卡一卡二| 欧美大片在线观看| 国产精品久久久久aaaa| 一区二区三区不卡视频在线观看| 午夜欧美视频在线观看| 国产高清不卡二三区| 91精品1区2区| 精品日本一线二线三线不卡| 亚洲男同性视频| 人妖欧美一区二区| www.久久精品| 91精品福利在线一区二区三区 | 日韩电影免费一区| 国产大片一区二区| 91精品国产色综合久久不卡电影| 久久久久久久久久久电影| 欧美成人aa大片| 91精品国产综合久久久久久| 国产喷白浆一区二区三区| 午夜av一区二区三区| 成人网页在线观看| 日韩丝袜美女视频| 午夜精品久久久久久久| 成人黄色在线看| 久久在线观看免费| 美腿丝袜亚洲综合| 欧美日韩国产天堂| 亚洲午夜精品一区二区三区他趣| 豆国产96在线|亚洲| wwwwxxxxx欧美| 久久国产视频网| 欧美r级在线观看| 久久精品999| 欧美一级片在线| 精品在线观看免费| 欧美成人欧美edvon| 精品一区二区成人精品| 日韩视频在线观看一区二区| 奇米一区二区三区av| 日韩一级视频免费观看在线| 天堂蜜桃一区二区三区| 日韩精品在线看片z| 麻豆91在线看| 欧美国产成人精品| 久久久99精品久久| 风间由美一区二区av101 | 久久午夜国产精品| 国产在线视频不卡二| 久久精品亚洲一区二区三区浴池| 国产一区二区主播在线| 中文子幕无线码一区tr| 暴力调教一区二区三区| 亚洲成av人影院在线观看网| 91麻豆精品国产综合久久久久久 | 91免费小视频| 亚洲国产欧美另类丝袜| 日韩一区二区三区高清免费看看| 麻豆国产91在线播放| 亚洲视频在线一区二区| 日韩一区二区三区在线观看| 国产成人av网站| 亚洲午夜久久久久中文字幕久| 日韩视频免费直播| av午夜一区麻豆| 麻豆精品久久久| 亚洲午夜激情网站| 国产日韩欧美不卡| 日韩限制级电影在线观看| 久久综合狠狠综合| 欧美人与性动xxxx| 波多野结衣亚洲一区| 国内精品伊人久久久久av影院| 亚洲欧美日韩在线| 国产亚洲污的网站| 日韩午夜在线影院| 91国在线观看| 99re热这里只有精品免费视频| 久久99热国产| 日本网站在线观看一区二区三区 | 国产午夜久久久久| 91精品国产欧美一区二区成人| 91福利视频久久久久| 日本高清不卡一区| 91网站最新地址| av不卡一区二区三区| 成人黄色a**站在线观看| 成人性生交大片免费看中文 | 中文字幕一区不卡| 国产人妖乱国产精品人妖| 久久精品亚洲乱码伦伦中文 | 亚洲成人自拍网| 五月天亚洲精品| 日本不卡一区二区三区高清视频| 亚洲国产日韩av| 美腿丝袜一区二区三区| 欧美xxxxx裸体时装秀| 日本网站在线观看一区二区三区 | 美女一区二区久久| 久久爱另类一区二区小说| 看片网站欧美日韩| 国产精品一二三| 99久久精品99国产精品| 色天天综合久久久久综合片| 欧美日韩国产另类一区| 这里只有精品99re| 精品捆绑美女sm三区| 国产日韩欧美亚洲| 舔着乳尖日韩一区| 国产精品一区在线| 色老汉av一区二区三区| 欧美一区二区高清| 中文字幕在线观看不卡视频| 亚洲gay无套男同| 国产精品综合二区| 色综合中文字幕国产 | 欧美成人乱码一区二区三区| 中文字幕在线不卡一区二区三区| 日本不卡一二三| 91日韩一区二区三区| 欧美精品一区二区三区蜜臀| 亚洲欧美精品午睡沙发| 国产精品一二一区| 3d动漫精品啪啪1区2区免费 | 日韩一区二区三区免费观看 | 亚洲一区二区中文在线| 国产综合久久久久久久久久久久| 欧美制服丝袜第一页| 国产精品午夜春色av| 韩日精品视频一区| 欧美性大战久久久久久久| 国产精品久线在线观看| 国产精品一区二区在线播放| 欧美一区二区在线免费播放| 亚洲一区二区精品久久av| av男人天堂一区| 国产精品嫩草99a| 国产成人激情av| 欧美国产精品v| 成人h动漫精品| 国产精品成人免费精品自在线观看| 久久精品国产精品青草| 宅男在线国产精品| 免费看欧美美女黄的网站| 欧美日本免费一区二区三区| 日本最新不卡在线| 日韩欧美在线123| 国产精品白丝av| 中文字幕色av一区二区三区| 91在线一区二区| 亚洲大片在线观看| 91精品国产免费久久综合| 久久99精品久久只有精品| 欧美成人猛片aaaaaaa| 成人午夜激情片| 亚洲一区在线电影| 久久久亚洲综合| 色哟哟日韩精品| 久久成人免费网| 亚洲免费伊人电影| 日韩欧美一级二级| 成人免费av在线| 婷婷中文字幕综合| 国产肉丝袜一区二区| 欧美影院一区二区三区| 国产最新精品免费| 亚洲精品视频在线看| 欧美成人国产一区二区| av成人老司机| 久久成人综合网| 亚洲成人免费av|