Bug 338825 Rename Display.getAppMenuBar() to getMenuBar().
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet348.java
newWindow.setText("New Window");
			newWindow.setAccelerator(SWT.MOD1 | 'N');
			newWindow.addListener(SWT.Selection, new Listener() {
				public void handleEvent(Event event) {
					Shell s = createShell();
					s.open();
				}
			});
			if (!SWT.getPlatform().equals("cocoa")) {
				MenuItem exit = new MenuItem(menu, SWT.PUSH);
				exit.setText("Exit");
				exit.addListener(SWT.Selection, new Listener() {
					public void handleEvent(Event event) {
						Display d = Display.getCurrent();
						Shell[] shells = d.getShells();
						for (Shell shell : shells) {
							shell.close();
						}
					}
				});
			}
			if (!hasAppMenuBar) s.setMenuBar(bar);
			createdScreenBar = true;
		}
	}
	
	static Shell createShell() {
		final Shell shell = new Shell(SWT.SHELL_TRIM);
		createMenuBar(shell);