本文整理汇总了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);
}
示例2: createMenu
public void createMenu() {
menuBar = new Menu(shell, SWT.BAR);
createFileMenu();
createEditMenu();
createPlaybackMenu();
createViewMenu();
createHelpMenu();
shell.setMenuBar(menuBar);
}
示例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);
}