Skip to main content



      Home
Home » Eclipse Projects » e(fx)clipse » New window on different screen(when main window is on other screen than primary)
New window on different screen [message #1698855] Thu, 18 June 2015 08:31 Go to next message
Eclipse UserFriend
Hello,
I run application on second screen (or I move it to second screen), then I want to open second window
MWindow window = modelSrv.createModelElement( MWindow.class );
window.getPersistedState().put( "efx.window.stagemodality", Modality.APPLICATION_MODAL.toString() );
MPart part = partSrv.createPart( TEST54_APP_PARTDESCRIPTOR_0 );
window.getChildren().add( part );
window.setWidth( 200 );
window.setHeight( 200 );
app.getChildren().add( window );
Unfortunetally second window will be appear on primary window - but parent window is on second screen.
Whether it is intentional? Or should be appear on screen, where parent window is?
Re: New window on different screen [message #1698872 is a reply to message #1698855] Thu, 18 June 2015 09:20 Go to previous messageGo to next message
Eclipse UserFriend
You are adding the window to the application, so you get a secondary top
level window who has no parent window! If the new window should be a
child of the first you need to add it to the parents windows child list.

In general you are responsible for the location of the window by default
it will be opened at 0/0 so if you want to at a different location you
need to set the x/y coordinates appropriately!

Tom

On 18.06.15 14:31, Bartlomiej Cichocki wrote:
> Hello,
> I run application on second screen (or I move it to second screen), then
> I want to open second window
> MWindow window = modelSrv.createModelElement( MWindow.class );
> window.getPersistedState().put( "efx.window.stagemodality",
> Modality.APPLICATION_MODAL.toString() );
> MPart part = partSrv.createPart( TEST54_APP_PARTDESCRIPTOR_0 );
> window.getChildren().add( part );
> window.setWidth( 200 );
> window.setHeight( 200 );
> app.getChildren().add( window );Unfortunetally second window will be
> appear on primary window - but parent window is on second screen.
> Whether it is intentional? Or should be appear on screen, where parent
> window is?
Re: New window on different screen [message #1698877 is a reply to message #1698872] Thu, 18 June 2015 09:39 Go to previous messageGo to next message
Eclipse UserFriend
I uderstand, but parent is still null:
app.getChildren().get( 0 ).getWindows().add( window );
System.out.println( window.getParent() ); -- null; why?
Re: New window on different screen [message #1698950 is a reply to message #1698877] Fri, 19 June 2015 03:15 Go to previous message
Eclipse UserFriend
Because getParent() is bound to the MElementContainer hierarchy! The
only way to access the parent window would be through EMF-API
(eContainer) which is internal.

I think you should file against the Eclipse Platform to provide API to
access the parent window.

Tom

On 18.06.15 15:39, Bartlomiej Cichocki wrote:
> I uderstand, but parent is still null:
> app.getChildren().get( 0 ).getWindows().add( window );
> System.out.println( window.getParent() ); -- null; why?
Previous Topic:MUIElement from wrong Context passed to control
Next Topic:Eclipse 3.* plugin issues when trying to create a stage.
Goto Forum:
  


Current Time: Fri Jun 13 19:24:39 EDT 2025

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

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

Back to the top