Skip to main content



      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 09:35
Eclipse UserFriend
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 Jul 08 20:49:10 EDT 2025

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

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

Back to the top