Reputation: 2652
Tell me, how to make it impossible to close the window which extends "org.eclipse.swt.widgets.Dialog" by Esc key?
my code is here:
Upvotes: 1
Views: 905
Reputation: 5064
Add a listener to shlTimeDiagramsWindow
on SWT.Traverse
. If the event is escape key, we set the event for that to false. You can add the below snippet code to method open(int coordX, int coordY)
.
shlTimeDiagramsWindow.addListener(SWT.Traverse, new Listener() {
@Override
public void handleEvent(Event event) {
if (event.character == SWT.ESC)
{
System.out.println("escape key");
event.doit = false;
}
}
});
Upvotes: 4