|
|
Re: How to open a second window programmatically? [message #654966 is a reply to message #654894] |
Thu, 17 February 2011 18:56 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Why are you creating Workbench-Windows and not simply open a
TitleAreaDialog, Dialog, Shell?
Tom
Am 17.02.11 15:37, schrieb Mike Moor:
> Hi,
>
> My application has 2 windows at the moment. at startup the login window
> is visible, the registration window not. on the login window is a link
> which calls a command. this is the handler to close the login window and
> open the registration window:
>
>
> public class ShowPart {
>
> @Execute
> public void execute(final MApplication application, final
> EModelService ms, final EPartService partService,
> @Named("windowId") final String windowId) {
>
> // find the window to show
> MUIElement e = ms.find(windowId, application);
> e.setVisible(true);
> e.setOnTop(true);
> e.setToBeRendered(true);
> ms.bringToTop(e);
>
> // hide the others
> for (MWindow window : application.getChildren()) {
> if (!windowId.equals(window.getElementId())) {
> window.setVisible(false);
> window.setOnTop(false);
> window.setToBeRendered(false);
> }
> }
>
> }
> }
>
>
> This successfully closes the login window but it doesn't open my
> registration window.
>
> What am i doing wrong?
>
> thank you for your help,
> mike
|
|
|
Re: How to open a second window programmatically? [message #654967 is a reply to message #654966] |
Thu, 17 February 2011 18:59 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
BTW naturally opening/closing MWindows should work but I think you can
get around using native SWT/JFace-Code.
Did you have a look in my tutorial? I've successfully opened there
windows programmatically but things might have changed since 4.0.
Tom
Am 17.02.11 19:56, schrieb Tom Schindl:
> Why are you creating Workbench-Windows and not simply open a
> TitleAreaDialog, Dialog, Shell?
>
> Tom
>
> Am 17.02.11 15:37, schrieb Mike Moor:
>> Hi,
>>
>> My application has 2 windows at the moment. at startup the login window
>> is visible, the registration window not. on the login window is a link
>> which calls a command. this is the handler to close the login window and
>> open the registration window:
>>
>>
>> public class ShowPart {
>>
>> @Execute
>> public void execute(final MApplication application, final
>> EModelService ms, final EPartService partService,
>> @Named("windowId") final String windowId) {
>>
>> // find the window to show
>> MUIElement e = ms.find(windowId, application);
>> e.setVisible(true);
>> e.setOnTop(true);
>> e.setToBeRendered(true);
>> ms.bringToTop(e);
>>
>> // hide the others
>> for (MWindow window : application.getChildren()) {
>> if (!windowId.equals(window.getElementId())) {
>> window.setVisible(false);
>> window.setOnTop(false);
>> window.setToBeRendered(false);
>> }
>> }
>>
>> }
>> }
>>
>>
>> This successfully closes the login window but it doesn't open my
>> registration window.
>>
>> What am i doing wrong?
>>
>> thank you for your help,
>> mike
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04467 seconds