Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Empty Window after second call
Empty Window after second call [message #1841219] Thu, 06 May 2021 19:17 Go to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Hi all,
I've created a dialog with a MWindow. There I placed a "close" button which closes the dialog (at least I think it's closed since it isn't visible ;-) ):
        cancelButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                MUIElement myAppDialog = modelService.find("org.my.project", application);
                myAppDialog.setVisible(false);
            }
        });


Now, if I use this button I can re-open the dialog once again. But if I close the dialog via the red cross, the dialog stays empty after re-opening. What's wrong with this? I've tried to implement a PreDestroy handler, but this didn't solve the problem.

    @PreDestroy
    public void closeWindow() {
        MUIElement myAppDialog = modelService.find("org.my.project", application);
             myAppDialog.setVisible(false);
           myAppDialog.setToBeRendered(false);
    }


Any hints are welcome.

Regards,
Ralf.




[Updated on: Thu, 06 May 2021 19:18]

Report message to a moderator

Re: Empty Window after second call [message #1841229 is a reply to message #1841219] Fri, 07 May 2021 07:02 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
The same question has been asked before, with a kind of workaround as answer: https://www.eclipse.org/forums/index.php/t/1083038/

I haven't used dialog mwindows like this, though I can imagine two causes. Fist, a (dialog) mwindow will show when it is both toBeRendered and visible.
When a mwindow is showed (it was rendered), and then visibility is changed to false, the mwindow is hidden. That is, the shell.setVisible(false) is called on the shell of the mwindow, the shell is not disposed.
When the X is used to close the window, shell.close() is called. A listener is installed that marks the window toBeRendered=false, so in the end the Shell is disposed.

When programmatically opening the mwindow, you should be calling setToBeRendered(true) to ensure that it is rendered. Also make sure to unrender the mwindow when programmatically closing it, otherwise you are keeping resources allocated.



Re: Empty Window after second call [message #1841230 is a reply to message #1841229] Fri, 07 May 2021 07:47 Go to previous message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Ah, ok. Didn't find that post. Thanks for your help.

Regards,
Ralf.
Previous Topic:Eclipse Neon throwing ERRORS?
Next Topic:Database programming, Third party components re-usability
Goto Forum:
  


Current Time: Sat Apr 27 01:46:18 GMT 2024

Powered by FUDForum. Page generated in 0.02864 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top