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
551109
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();
                }
            }
        }
    }
315315
public void fireEvent(CmsEvent event) {

        fireEventHandler(m_eventListeners.get(event.getTypeInteger()), event);
        fireEventHandler(m_eventListeners.get(I_CmsEventListener.LISTENERS_FOR_ALL_EVENTS), event);
    }
483118
@UiHandler("m_checkboxSiblings")
    protected void onSiblingClick(ClickEvent event) {

        if (!m_showResources) {
            return;
        }
        m_publishDialog.setIncludeSiblings(m_checkboxSiblings.isChecked());
        m_publishDialog.updateResourceList();
    }
909510
public void handleConfirmRemove(final CmsContainerPageElementPanel element) {

        if (element.isNew()) {
            element.removeFromParent();
            cleanUpContainers();
            setPageChanged();
            return;
        }
        checkElementReferences(element, new AsyncCallback<CmsRemovedElementStatus>() {

            public void onFailure(Throwable caught) {

                // ignore, will never be executed

            }

            public void onSuccess(CmsRemovedElementStatus status) {

                boolean showDeleteCheckbox = status.isDeletionCandidate();
                ElementDeleteMode deleteMode = status.getElementDeleteMode();
                if (deleteMode == null) {
                    deleteMode = getData().getDeleteMode();
                }
                CmsConfirmRemoveDialog removeDialog = new CmsConfirmRemoveDialog(
                    status.getElementInfo(),
                    showDeleteCheckbox,
                    deleteMode,
                    new AsyncCallback<Boolean>() {

                        public void onFailure(Throwable caught) {

                            element.removeHighlighting();
                        }

                        public void onSuccess(Boolean shouldDeleteResource) {

                            Runnable[] nextActions = new Runnable[] {};

                            if (shouldDeleteResource.booleanValue()) {
                                final CmsRpcAction<Void> deleteAction = new CmsRpcAction<Void>() {

                                    @Override
                                    public void execute() {

                                        start(200, true);

                                        CmsUUID id = new CmsUUID(getServerId(element.getId()));
                                        CmsCoreProvider.getVfsService().deleteResource(id, this);
                                    }

                                    @Override
                                    public void onResponse(Void result) {

                                        stop(true);
                                    }
                                };
                                nextActions = new Runnable[] {new Runnable() {

                                    public void run() {

                                        deleteAction.execute();
                                    }
                                }};
                            }
                            I_CmsDropContainer container = element.getParentTarget();
                            element.removeFromParent();
                            if (container instanceof CmsContainerPageContainer) {
                                ((CmsContainerPageContainer)container).checkEmptyContainers();
                            }
                            cleanUpContainers();
                            setPageChanged(nextActions);
                        }
                    });
                removeDialog.center();
            }

        });
    }
619556
function (event) {
				this._sId = event.getParameter("arguments").sampleId;
				this._sEntityId = event.getParameter("arguments").entityId;

				this.byId("page").setBusy(true);
				this.getModel("appView").setProperty("/bHasMaster", false);

				ControlsInfo.loadData().then(this._loadSample.bind(this));
			}
1307349
public void onLeafClick(LeafClickEvent event) {
		LayerTreeTreeNode layerTreeNode = (LayerTreeTreeNode) event.getLeaf();
		if (null != selectedLayerTreeNode
				&& layerTreeNode.getLayer().getId().equals(selectedLayerTreeNode.getLayer().getId())) {
			mapModel.selectLayer(null);
		} else {
			mapModel.selectLayer(layerTreeNode.getLayer());
		}
	}
36896
function(event) {
        var changed = false;
        if(this.features) {
            if(this.num === null) {
                this.num = -1;
            }
            var start = (this.num + 1) * this.length;
            changed = this.page(start, event);
        }
        return changed;
    }
22575
public void onFolderClick(FolderClickEvent event) {
		try {

			if (isIconTargetClicked()) {
				onIconClick(event.getFolder());
			} else {
				if (event.getFolder() instanceof LayerTreeTreeNode) {
					mapModel.selectLayer(((LayerTreeTreeNode) event.getFolder()).getLayer());
				} else {
					mapModel.selectLayer(null);
				}
			}
		} catch (Exception e) { // NOSONAR
			Log.logError(e.getMessage());
			// some other unusable element
		}
	}
721294
@UiHandler("m_editButton")
    void showEditPopup(ClickEvent clickEvent) {

        m_editButton.clearHoverState();
        m_popup = new CmsPopup(m_title, -1);
        m_popup.setModal(true);
        m_popup.setAutoHideEnabled(true);
        m_popup.removePadding();
        m_popup.addCloseHandler(new CloseHandler<PopupPanel>() {

            public void onClose(CloseEvent<PopupPanel> event) {

                onPopupClose();
            }
        });
        m_hasChanges = false;
        m_requireShowPopup = false;
        m_entityChangeHandlerRegistration = m_parentEntity.addValueChangeHandler(new ValueChangeHandler<CmsEntity>() {

            public void onValueChange(ValueChangeEvent<CmsEntity> event) {

                onEntityChange();
            }
        });
        CmsType type = CmsEntityBackend.getInstance().getType(m_parentEntity.getTypeName());
        FlowPanel formPanel = new FormPanel();
        formPanel.setStyleName(I_CmsLayoutBundle.INSTANCE.form().formParent());
        formPanel.getElement().getStyle().setMargin(0, Unit.PX);
        formPanel.getElement().getStyle().setBorderWidth(0, Unit.PX);
        formPanel.getElement().getStyle().setPropertyPx("minHeight", 30);
        m_popup.add(formPanel);
        m_popup.addDialogClose(null);
        I_CmsLayoutBundle.INSTANCE.dialogCss().ensureInjected();
        m_popup.show();
        CmsAttributeHandler.setScrollElement(formPanel.getElement());
        CmsAttributeHandler.setResizeHandler(new ResizeHandler() {

            public void onResize(ResizeEvent event) {

                positionPopup();
            }
        });
        m_widgetService.getRendererForType(
            type).renderAttributeValue(m_parentEntity, m_attributeHandler, m_attributeIndex, formPanel);
        CmsInlineEditOverlay.addOverlayForElement(m_referenceElement);
        positionPopup();
        m_popup.getElement().getStyle().setZIndex(I_CmsLayoutBundle.INSTANCE.constants().css().zIndexPopup());
        m_popupClosed = false;
    }
90736
function (event) {
                var domEvent = new ariaDomEvent(event);
                var target = domEvent.target;
                var self = this;
                var popup = this.findParentPopup(target, function (popup) {
                    var navigation;
                    navigation = self._viewportNavigationInterceptor.getNavigationInformation(target);
                    if (navigation == null) {
                        navigation = popup.getNavigationInformation(target);
                    }

                    var eventObject = {
                        name: "beforePreventingFocus",
                        event: domEvent,
                        modalPopup: popup,
                        cancel: false,
                        navigation: navigation
                    };
                    self.$raiseEvent(eventObject);
                    if (!eventObject.cancel) {
                        var direction;
                        if (navigation != null) {
                            direction = navigation.direction;
                        }
                        if (direction == null) {
                            direction = 'forward';
                        }

                        var reverse = !!(direction === 'backward');
                        ariaTemplatesNavigationManager.focusFirst(popup.domElement, reverse);
                        return popup;
                    }
                    // if the focus is allowed, don't return any popup to bring to the front
                });
                if (popup) {
                    this.bringToFront(popup);
                }
                domEvent.$dispose();
            }
41774
def leaveEvent(self, event):
        
        super(FoldingPanel, self).leaveEvent(event)
        QtWidgets.QApplication.restoreOverrideCursor()
        self._highlight_runner.cancel_requests()
        if not self.highlight_caret_scope:
            self._clear_scope_decos()
            self._mouse_over_line = None
            self._current_scope = None
        else:
            self._block_nbr = -1
            self._highlight_caret_scope()
        self.editor.repaint()
1226238
function (event) {
      if (!_emberViewsSystemUtils.isSimpleClick(event)) {
        return true;
      }

      var preventDefault = _emberMetalProperty_get.get(this, 'preventDefault');
      var targetAttribute = _emberMetalProperty_get.get(this, 'target');

      if (preventDefault !== false) {
        if (!targetAttribute || targetAttribute === '_self') {
          event.preventDefault();
        }
      }

      if (_emberMetalProperty_get.get(this, 'bubbles') === false) {
        event.stopPropagation();
      }

      if (_emberMetalProperty_get.get(this, '_isDisabled')) {
        return false;
      }

      if (_emberMetalProperty_get.get(this, 'loading')) {
        _emberMetalLogger.default.warn('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.');
        return false;
      }

      if (targetAttribute && targetAttribute !== '_self') {
        return false;
      }

      var routing = _emberMetalProperty_get.get(this, '_routing');
      var qualifiedRouteName = _emberMetalProperty_get.get(this, 'qualifiedRouteName');
      var models = _emberMetalProperty_get.get(this, 'models');
      var queryParamValues = _emberMetalProperty_get.get(this, 'queryParams.values');
      var shouldReplace = _emberMetalProperty_get.get(this, 'replace');

      routing.transitionTo(qualifiedRouteName, models, queryParamValues, shouldReplace);
    }
1038052
function (event) {
            this.$Widget._dom_onmouseenter.call(this, event);
            if (this._ellipsis && this._ellipsis.ellipsesNeeded) {
                this._hasMouseOver = true;
                this._ellipsis.displayFullText({
                    left : 0,
                    top : 0
                });
            }
        }
894922
@ViewChanged
	public synchronized void onViewChangeEvent(ViewChangedEvent event) {
		
		if (logger.isDebugEnabled()) {
			logger.debug("onViewChangeEvent : pre[" + event.isPre() + "] : event local address[" + event.getCache().getLocalAddress() + "]");
		}
		
		final List<Address> oldView = currentView;
		currentView = new ArrayList<Address>(event.getNewView().getMembers());
		final Address localAddress = getLocalAddress();
		
		//just a precaution, it can be null!
		if (oldView != null) {
			final Cache jbossCache = mobicentsCache.getJBossCache();
			final Configuration config = jbossCache.getConfiguration();		

			final boolean isBuddyReplicationEnabled = config.getBuddyReplicationConfig() != null && config.getBuddyReplicationConfig().isEnabled();
			// recover stuff from lost members
			Runnable runnable = new Runnable() {
				public void run() {
					for (Address oldMember : oldView) {
						if (!currentView.contains(oldMember)) {
							if (logger.isDebugEnabled()) {
								logger.debug("onViewChangeEvent : processing lost member " + oldMember);
							}
							for (FailOverListener localListener : failOverListeners) {
								ClientLocalListenerElector localListenerElector = localListener.getElector();
								if (localListenerElector != null && !isBuddyReplicationEnabled) {
									// going to use the local listener elector instead, which gives results based on data
									performTakeOver(localListener,oldMember,localAddress, true, isBuddyReplicationEnabled);
								}
								else {
									
									List<Address> electionView = getElectionView(oldMember);
									if(electionView!=null && elector.elect(electionView).equals(localAddress))
									{
										performTakeOver(localListener, oldMember, localAddress, false, isBuddyReplicationEnabled);
									}
									
									cleanAfterTakeOver(localListener, oldMember);
								}
							}
						}
					}
				}
			};
			Thread t = new Thread(runnable);
			t.start();
		}
		
	}
662277
public void showElementInfo(final CmsContainerPageElementPanel element) {

        CmsUUID structureId;
        if (element.isModelGroup() && !element.getModelGroupId().isNullUUID()) {
            structureId = element.getModelGroupId();
        } else {
            structureId = element.getStructureId();
        }
        I_CmsDropContainer dropContainer = element.getParentTarget();
        Map<String, String> contextParams = new HashMap<>();
        if (dropContainer instanceof CmsContainerPageContainer) {
            CmsContainerPageContainer cnt = (CmsContainerPageContainer)dropContainer;
            String containerId = cnt.getContainerId();
            String elemId = element.getId();
            contextParams.put(CmsGwtConstants.ATTR_ELEMENT_ID, elemId);
            contextParams.put(CmsGwtConstants.ATTR_CONTAINER_ID, containerId);
            String pageRootPath = CmsStringUtil.joinPaths(
                CmsCoreProvider.get().getSiteRoot(),
                CmsCoreProvider.get().getUri());
            contextParams.put(CmsGwtConstants.ATTR_PAGE_ROOT_PATH, pageRootPath);
        }
        CmsResourceInfoDialog.load(structureId, true, null, contextParams, new CloseHandler<PopupPanel>() {

            public void onClose(CloseEvent<PopupPanel> event) {

                reloadElements(element.getId());
            }
        });
    }
526486
protected void onPageLoad(final PageLoadEvent event) {
        LOGGER.log(Level.INFO, "onPageLoad: {0}", event.getCrawlCandidate().getRequestUrl());
    }
655319
function (event) {
                var domEvent = /** @type aria.DomEvent */
                new ariaDomEvent(event);
                var fromTarget = /** @type HTMLElement */
                domEvent.target;
                var toTarget = /** @type HTMLElement */
                domEvent.relatedTarget;
                for (var i = this.openedPopups.length - 1; i >= 0; i--) {
                    var popup = /** @type aria.popups.Popup */
                    this.openedPopups[i];
                    if (!utilsDom.isAncestor(toTarget, popup.getDomElement())
                            && utilsDom.isAncestor(fromTarget, popup.getDomElement())) {
                        popup.closeOnMouseOut(domEvent);
                    }
                }
                domEvent.$dispose();
            }