Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Proper way to open window second time, after closing it once
Proper way to open window second time, after closing it once [message #1346183] Sat, 10 May 2014 13:35
Jeyhun MAMEDOV is currently offline Jeyhun MAMEDOVFriend
Messages: 21
Registered: March 2014
Junior Member
Hi I have problem with opening window second after closing it once

The code

EModelService mds
MApplication app

MTrimmedWindow wnd = (MTrimmedWindow)mds.find("my.window.id", app);
if (wnd == null) return;
wnd.setVisible(true);
wnd.setToBeRendered(true);
mds.bringToTop(wnd);


runs only once. after window has been closed, this code do not work.
my fix is to clone window and assign parent of main window where code
runs to cloned one.

EModelService mds
MApplication app
MWindow mainWind

MTrimmedWindow wnd = (MTrimmedWindow)mds.find("my.window.id", app);
if (wnd == null) return;
MTrimmedWindow mtw = (MTrimmedWindow)mds.cloneElement(wnd, wind);
mtw.setParent(mainWind.getParent());
mtw.setVisible(true);
mtw.setToBeRendered(true);
mds.bringToTop(mtw);

I seems to me that it is a hack, and I do not like it.
Is this a proper way? May be I should add something to onCloseHandler to
second window for to just hide it, not close (free).
Previous Topic:dynamic PopupMenu on Part
Next Topic:How to pass objects parameters from wizard to MPart?
Goto Forum:
  


Current Time: Tue Mar 19 05:10:22 GMT 2024

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

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

Back to the top