Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Create a modal window(How can I create a modal window?)
Create a modal window [message #797549] Mon, 13 February 2012 16:22 Go to next message
Marco Carnazzo is currently offline Marco CarnazzoFriend
Messages: 8
Registered: July 2009
Junior Member
Maybe it's a FAQ but I'm an e4 newbie and I didn't find anything about.

I want a modal, not resizable and not closeable window.
How can I create it? My window is a POJO, so I can't set SWT style.

Thank you.
Re: Create a modal window [message #798322 is a reply to message #797549] Tue, 14 February 2012 14:38 Go to previous messageGo to next message
Markus Stier is currently offline Markus StierFriend
Messages: 12
Registered: July 2009
Junior Member
In your Handler

@Execute
public void execute(IEclipseContext context) 
{
        LoginDialog loginDlg = ContextInjectionFactory.make(LoginDialog.class, context);

        loginDlg.create();

        // Make it modal
        loginDlg.setBlockOnOpen(true);
        loginDlg.open();
}


in your dialog
    
@Inject
public LoginDialog(@Named(IServiceConstants.ACTIVE_SHELL) Shell parentShell)
{
        super(parentShell);
        setShellStyle(SWT.BORDER | SWT.CLOSE | SWT.RESIZE | SWT.APPLICATION_MODAL);

}

@Override
protected Control createContents(Composite parent)
{
        Control cntrl = super.createContents(parent);
        setTitle("My title");

        // init controls
        
        return cntrl;
}




Markus
Re: Create a modal window [message #799132 is a reply to message #798322] Wed, 15 February 2012 13:37 Go to previous message
Marco Carnazzo is currently offline Marco CarnazzoFriend
Messages: 8
Registered: July 2009
Junior Member
Thank you Markus.
But my question is: what if my dialog is a TrimmedWindow? (or anything in Application model)
Previous Topic:Problems creating a Part Toolbar
Next Topic:e4 DI, Gemini & Persistence
Goto Forum:
  


Current Time: Thu Apr 25 18:02:28 GMT 2024

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

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

Back to the top