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


Java SWT.BAR屬性代碼示例

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


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

示例1: createApplicationMenu

private void createApplicationMenu() {
    Menu menuBar = new Menu(getShell(), SWT.BAR);
    MenuItem helpMenuHeader = new MenuItem(menuBar, SWT.CASCADE);
    helpMenuHeader.setText("&pgSqlBlocks");

    Menu helpMenu = new Menu(getShell(), SWT.DROP_DOWN);
    helpMenuHeader.setMenu(helpMenu);

    MenuItem helpGetHelpItem = new MenuItem(helpMenu, SWT.PUSH);
    helpGetHelpItem.setText(resourceBundle.getString("about"));
    helpGetHelpItem.addListener(SWT.Selection, e -> new AboutDlg(getShell()).open());
    getShell().setMenuBar(menuBar);

    MenuItem exitMenuItem = new MenuItem(helpMenu, SWT.PUSH);
    exitMenuItem.setText(resourceBundle.getString("exit"));
    exitMenuItem.addListener(SWT.Selection, e -> getShell().close());
    getShell().setMenuBar(menuBar);
}
 
開發者ID:technology16,項目名稱:pgsqlblocks,代碼行數:18,代碼來源:ApplicationView.java

示例2: createMenu

public void createMenu() {
	menuBar = new Menu(shell, SWT.BAR);
	createFileMenu();
	createEditMenu();
	createPlaybackMenu();
	createViewMenu();
	createHelpMenu();

	shell.setMenuBar(menuBar);
}
 
開發者ID:juanerasmoe,項目名稱:pmTrans,代碼行數:10,代碼來源:MenuManager.java

示例3: createMenus

private void createMenus(final Shell parent) {

		//The Main Menu
		menuBar = parent.getDisplay().getMenuBar();
		if (menuBar == null) {
			menuBar = new Menu(parent, SWT.BAR);
			parent.setMenuBar(menuBar);
		}else{
			Utils.disposeSWTObjects((Object[])menuBar.getItems());
		}


		addFileMenu();

		/* ======= View, Transfers, Torrent, Tools menus =====
		 * hig compliance for OSX dictates that more granular actions are positioned farther
		 * on the right of the menu and more general actions are closer to the left
		 * NOTE: we keep the original menu order (for non-OSX) in-tact so as to not disturb existing non-OSX users
		 */
		if (Constants.isOSX) {
			addViewMenu(parent);
			addTransferMenu();
			addTorrentMenu(parent);
		} else {
			addTransferMenu();
			addTorrentMenu(parent);
			addViewMenu(parent);

			/*
			 * The Tools menu is only present on non-OSX systems
			 */
			addToolsMenu(parent);
		}

		addPluginsMenu(parent);

		// ========== Windows menu (OSX only)================
		if (Constants.isOSX) {
			addWindowMenu(parent);
		}

		// =========== Debug menu (development only)=========
		if (Constants.isCVSVersion()) {
			DebugMenuHelper.createDebugMenuItem(menuBar);
		}

		addCommunityMenu( parent);
		
		addV2HelpMenu(parent);

		/*
		 * Enabled/disable menus based on what ui mode we're in
		 * NOTE: This is largely superfluous here since all menu items in the classic UI
		 * are available at all time; this method is left here for completeness should we
		 * add dynamic behavior to the menu in the future.
		 */
		MenuFactory.updateEnabledStates(menuBar);

	}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:59,代碼來源:MainMenuV2.java


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