當前位置: 首頁>>代碼示例>>Java>>正文


Java SWT.F4屬性代碼示例

本文整理匯總了Java中org.eclipse.swt.SWT.F4屬性的典型用法代碼示例。如果您正苦於以下問題:Java SWT.F4屬性的具體用法?Java SWT.F4怎麽用?Java SWT.F4使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.eclipse.swt.SWT的用法示例。


在下文中一共展示了SWT.F4屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createToolbarCommandHandler

/**
 * The toolbar command handler contains the global toolbar
 * actions. The intent is that the listener is then added to 
 * multiple visual components.
 */
public Listener createToolbarCommandHandler() {
	return new Listener() {
		public void handleEvent(Event event) {
			if (event.type == SWT.KeyUp) {
				if ((event.stateMask & SWT.CTRL) != 0) {	// CTRL+key
					switch (event.character) {
						case CTRL_C:
							getContentTypeAdapter().copy();
							break;
						case CTRL_A:
							getContentTypeAdapter().selectAll();
							break;
						case CTRL_P:
							getContentTypeAdapter().print();
							break;
					}
				} else if ((event.stateMask & SWT.ALT) == 0) { // key alone
					switch (event.keyCode) {
						case SWT.F2:	// the "native" file format (image, text, etc)
							getNativeFilterAdapter().display();
							setFilterToolItemSelection(true, false, false);
							break;
						case SWT.F3:	// Hex format
							getHexFilterAdapter().display();
							setFilterToolItemSelection(false, true, false);
							break;
						case SWT.F4:	// "Raw" hex format
							getRawDumpFilterAdapter().display();
							setFilterToolItemSelection(false, false, true);
							break;
					}
				}
			}
		}
	};
}
 
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:41,代碼來源:FileViewerWindow.java

示例2: createToolbarCommandHandler

/**
 * The toolbar command handler contains the global toolbar
 * actions.  This does not include file-specific actions.
 * The intent is that the listener is then added to multiple
 * visual components (i.e., the file listing as well as the
 * directory listing).
 */
private Listener createToolbarCommandHandler() {
	return new Listener() {
		public void handleEvent(Event event) {
			if (event.type == SWT.KeyUp) {
				if ((event.stateMask & SWT.CTRL) != 0) {	// CTRL key held
					if ((event.stateMask & SWT.SHIFT) != 0) {	// SHIFT key held
						switch (event.character) {
							case CTRL_S:	// Save As...
								saveAs();
								break;
						}
					} else {
						switch (event.character) {
							case CTRL_I:	// Import Wizard
								importFiles();
								break;
							case CTRL_P:	// Print...
								print();
								break;
							case CTRL_S:	// Save
								if (getSaveToolItem().isEnabled()) {
									save();
								}
								break;
						}
					}
				} else {	// No CTRL key
				    if ((event.stateMask & SWT.ALT) != SWT.ALT) {	// Ignore ALT key combinations like alt-F4!
					switch (event.keyCode) {
						case SWT.F2:	// Standard file display
							changeCurrentFormat(FormattedDisk.FILE_DISPLAY_STANDARD);
							break;
						case SWT.F3:	// Native file display
							changeCurrentFormat(FormattedDisk.FILE_DISPLAY_NATIVE);
							break;
						case SWT.F4:	// Detail file display
							changeCurrentFormat(FormattedDisk.FILE_DISPLAY_DETAIL);
							break;
						case SWT.F5:	// Show deleted files
							setShowDeletedFiles(!getShowDeletedFilesToolItem().getSelection());
							getShowDeletedFilesToolItem().setSelection(isShowDeletedFiles());
							fillFileTable(getCurrentFileList());
							break;
						}
					}
				}
			}
		}
	};
}
 
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:57,代碼來源:DiskExplorerTab.java


注:本文中的org.eclipse.swt.SWT.F4屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。