@Override
    protected void onPreviewNativeEvent(NativePreviewEvent event) {

        super.onPreviewNativeEvent(event);
        switch (event.getTypeInt()) {
            case Event.ONKEYPRESS:
                switch (event.getNativeEvent().getKeyCode()) {
                    case KeyCodes.KEY_ENTER:
                        event.cancel();
                        m_widget.onClickCancel(null);
                        break;
                    case KeyCodes.KEY_ESCAPE:
                        event.cancel();
                        m_widget.onClickOk(null);
                        break;
                    default:
                        break;
                }
                break;
            default:
                break;
        }
    }
@ Override protected void onPreviewNativeEvent ( NativePreviewEvent event ) { super . onPreviewNativeEvent ( event ) ; switch ( event . getTypeInt ( ) ) { case Event . ONKEYPRESS : switch ( event . getNativeEvent ( ) . getKeyCode ( ) ) { case KeyCodes . KEY_ENTER : event . cancel ( ) ; m_widget . onClickCancel ( null ) ; break ; case KeyCodes . KEY_ESCAPE : event . cancel ( ) ; m_widget . onClickOk ( null ) ; break ; default : break ; } break ; default : break ; } }
@see org.opencms.gwt.client.ui.CmsPopup#onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent)