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 09:35
Jeyhun MAMEDOV is currently offline Jeyhun MAMEDOV
Messages: 9
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 launch CSS Spy for my RCP?
Goto Forum:
  


Current Time: Tue Jul 22 21:46:47 EDT 2014

Powered by FUDForum. Page generated in 0.13353 seconds