[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.dsdp.ercp] How to remove close menu

Hi

If I launch my eSWT application on my mobile device, a default close menu appears. I found the code in the eSWT implementation that is responsible for that:

(Shell.java):
if(Platform.isSmartPhone() && (internal_style & SWT.CLOSE) != 0) {
		shellListener = new ShellListener() {
			public void shellActivated(ShellEvent e) {
				createCloseMenuItem();
			}
			public void shellClosed(ShellEvent e) {
			}
			public void shellDeactivated(ShellEvent e) {
				disposeCloseMenuItem();
			}
			public void shellDeiconified(ShellEvent e) {
			}
			public void shellIconified(ShellEvent e) {
			}
		};
		addShellListener(shellListener);
	}

private void createCloseMenuItem() {
	Menu menu = getMenuBar();
	if(menu == null) {
		menu = new Menu(this, SWT.BAR);
		setMenuBar(menu);
	}
	if(closeMenuItem == null || closeMenuItem.isDisposed()) {
		closeMenuItem = new MenuItem(menu, SWT.CASCADE, 0);
		closeMenuItem.setText(Messages.getString("Shell.0")); //$NON-NLS-1$
		closeMenuItem.addSelectionListener(new SelectionListener() {
			public void widgetDefaultSelected(SelectionEvent e) {
			}
			public void widgetSelected(SelectionEvent e) {
				close();
			}
		});
	}
}

Now my question is, how can I remove this menu? I have my own exit command and another reason is that I need other translations of the label than the provided ones.

I already tried to set a new menu bar but even if i try to get the existing on, I receive a null object:
Menu m = parent.getShell().getMenuBar();


Can somebody help me?

Reagrds
Markus