当前位置: 首页>>代码示例>>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;未经允许,请勿转载。