protected void previewNativeEvent(NativePreviewEvent event) {

        Event nativeEvent = Event.as(event.getNativeEvent());

        if ((nativeEvent.getTypeInt() == Event.ONCLICK) && hasPageChanged()) {
            EventTarget target = nativeEvent.getEventTarget();
            if (!Element.is(target)) {
                return;
            }
            Element element = Element.as(target);
            element = CmsDomUtil.getAncestor(element, CmsDomUtil.Tag.a);
            if (element == null) {
                return;
            }
            AnchorElement anc = AnchorElement.as(element);
            final String uri = anc.getHref();

            // avoid to abort events for date-picker widgets
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(uri)
                || (CmsDomUtil.getAncestor(element, "x-date-picker") != null)) {
                return;
            }
            nativeEvent.preventDefault();
            nativeEvent.stopPropagation();
            m_handler.leavePage(uri);
        }
        if (event.getTypeInt() == Event.ONKEYDOWN) {
            int keyCode = nativeEvent.getKeyCode();
            if ((keyCode == KeyCodes.KEY_F5) && hasPageChanged()) {
                // user pressed F5
                nativeEvent.preventDefault();
                nativeEvent.stopPropagation();
                m_handler.leavePage(Window.Location.getHref());
            }
            if (nativeEvent.getCtrlKey() || nativeEvent.getMetaKey()) {
                // look for short cuts
                if (keyCode == KeyCodes.KEY_E) {
                    if (nativeEvent.getShiftKey()) {
                        circleContainerEditLayers();
                    } else {
                        openNextElementView();
                    }
                    nativeEvent.preventDefault();
                    nativeEvent.stopPropagation();
                }
            }
        }
    }
protected void previewNativeEvent ( NativePreviewEvent event ) { Event nativeEvent = Event . as ( event . getNativeEvent ( ) ) ; if ( ( nativeEvent . getTypeInt ( ) == Event . ONCLICK ) && hasPageChanged ( ) ) { EventTarget target = nativeEvent . getEventTarget ( ) ; if ( ! Element . is ( target ) ) { return ; } Element element = Element . as ( target ) ; element = CmsDomUtil . getAncestor ( element , CmsDomUtil . Tag . a ) ; if ( element == null ) { return ; } AnchorElement anc = AnchorElement . as ( element ) ; final String uri = anc . getHref ( ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( uri ) || ( CmsDomUtil . getAncestor ( element , "x-date-picker" ) != null ) ) { return ; } nativeEvent . preventDefault ( ) ; nativeEvent . stopPropagation ( ) ; m_handler . leavePage ( uri ) ; } if ( event . getTypeInt ( ) == Event . ONKEYDOWN ) { int keyCode = nativeEvent . getKeyCode ( ) ; if ( ( keyCode == KeyCodes . KEY_F5 ) && hasPageChanged ( ) ) { nativeEvent . preventDefault ( ) ; nativeEvent . stopPropagation ( ) ; m_handler . leavePage ( Window . Location . getHref ( ) ) ; } if ( nativeEvent . getCtrlKey ( ) || nativeEvent . getMetaKey ( ) ) { if ( keyCode == KeyCodes . KEY_E ) { if ( nativeEvent . getShiftKey ( ) ) { circleContainerEditLayers ( ) ; } else { openNextElementView ( ) ; } nativeEvent . preventDefault ( ) ; nativeEvent . stopPropagation ( ) ; } } } }
Previews events. Shows the leaving page dialog, if the page has changed and an anchor has been clicked.<p>
Also triggers an element view change on 'Ctrl+E'.<p>

@param event the native event