[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.dsdp.ercp] Re: How to remove close menu
|
The text for the Close command should be read from a language specific
properties file. If it is not, that is a bug. Please open a bugzilla report
if this is the case.
The SWT.CLOSE style is being provided by the eworkbench, so there is no easy
way to remove it w/o replacing your eworkbench plugin (which you could do).
However, you may be able to open your own Shell over the top of the
workbench w/o SWT.CLOSE specified.
"Markus Bach" <markus.bach@xxxxxxxxxxxxx> wrote in message
news:de5c3986e1648020fec065093f430a71$1@xxxxxxxxxxxxxxxxxx
> 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
>