According to another discussion here, I try to open a modal view like so:
public void widgetSelected(SelectionEvent e) {
final Shell dialogShell = new Shell(ApplicationRunner.getApp()
.getShell().getDisplay(), SWT.PRIMARY_MODAL | SWT.SHEET);
dialogShell.setLayout(new FillLayout());
Button closeButton = new Button(dialogShell, SWT.PUSH);
closeButton.setText("Close");
closeButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
dialogShell.dispose();
}
@Override
public void widgetDefaultSelected(SelectionEvent arg0) {
// TODO Auto-generated method stub
}
});
dialogShell.setDefaultButton(closeButton);
dialogShell.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
System.out.println("Modal dialog closed");
}
});
dialogShell.pack();
dialogShell.open();
}
It opens the desired window, but it's not modal. I can access the main shell and open another instance of the same modal dialog. Can anybody point me in the right direction?
Thanx, Marcus