当前位置: 首页>>代码示例>>Java>>正文


Java Event.stopPropagation方法代码示例

本文整理汇总了Java中elemental.events.Event.stopPropagation方法的典型用法代码示例。如果您正苦于以下问题:Java Event.stopPropagation方法的具体用法?Java Event.stopPropagation怎么用?Java Event.stopPropagation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在elemental.events.Event的用法示例。


在下文中一共展示了Event.stopPropagation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runActions

import elemental.events.Event; //导入方法依赖的package包/类
/**
 * Finds and runs an action cancelling original key event
 *
 * @param actionIds list containing action ids
 * @param keyEvent original key event
 */
private void runActions(List<String> actionIds, Event keyEvent) {
  for (String actionId : actionIds) {
    Action action = actionManager.getAction(actionId);
    if (action == null) {
      continue;
    }
    ActionEvent e = new ActionEvent(presentationFactory.getPresentation(action), actionManager);
    action.update(e);

    if (e.getPresentation().isEnabled() && e.getPresentation().isVisible()) {
      /** Stop handling the key event */
      keyEvent.preventDefault();
      keyEvent.stopPropagation();

      /** Perform the action */
      action.actionPerformed(e);
    }
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:KeyBindingManager.java

示例2: handleEvent

import elemental.events.Event; //导入方法依赖的package包/类
@Override
public void handleEvent(Event evt) {
  KeyboardEvent keyEvent = (KeyboardEvent) evt;
  switch (keyEvent.getKeyCode()) {
    case KeyboardEvent.KeyCode.ENTER:
      commitIfValid(false);
      break;
    case KeyboardEvent.KeyCode.ESC:
      cancel();
      break;
    default:
      return;
  }
  evt.stopPropagation();
}
 
开发者ID:eclipse,项目名称:che,代码行数:16,代码来源:TreeNodeMutator.java

示例3: handleEvent

import elemental.events.Event; //导入方法依赖的package包/类
@Override
public void handleEvent(Event evt) {
  for (Element clickTarget : clickTargets) {
    if (clickTarget.contains((Node) evt.getTarget())) {
      return;
    }
  }
  forceHide();
  if (stopOutsideClick) {
    evt.stopPropagation();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:13,代码来源:AutoHideComponent.java

示例4: handleEvent

import elemental.events.Event; //导入方法依赖的package包/类
@Override
public void handleEvent(Event evt) {
  // Don't even bother to do anything unless we have someone ready to
  // handle events.
  if (getDelegate() == null
      || (primaryMouseButtonOnly
          && ((MouseEvent) evt).getButton() != MouseEvent.Button.PRIMARY)) {
    return;
  }

  Element eventTarget = (Element) evt.getTarget();

  if (CssUtils.containsClassName(eventTarget, css.expandControl())) {
    onExpansionControlEvent(evt, eventTarget);
  } else {
    Element treeNodeBody =
        CssUtils.getAncestorOrSelfWithClassName(eventTarget, css.treeNodeBody());
    if (treeNodeBody != null) {
      // this code emulate double click for tablets
      if (Event.MOUSEDOWN.equals(evt.getType())) {
        double currentClickMs = Duration.currentTimeMillis();
        if (currentClickMs - previousClickMs < MouseGestureListener.MAX_CLICK_TIMEOUT_MS
            && treeNodeBody.equals(previousClickTreeNodeBody)) {

          if (BrowserUtils.isAndroid() || BrowserUtils.isIPad() || BrowserUtils.isIphone()) {
            evt.stopPropagation();
            evt.preventDefault();
            doActionsForDoubleClick(treeNodeBody, evt);
          }
          return;
        } else {
          this.previousClickMs = currentClickMs;
          this.previousClickTreeNodeBody = treeNodeBody;
        }
      }

      onTreeNodeBodyChildEvent(evt, treeNodeBody);
    } else {
      onOtherEvent(evt);
    }
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:43,代码来源:Tree.java

示例5: handleEvent

import elemental.events.Event; //导入方法依赖的package包/类
@Override
public void handleEvent(Event evt) {
  evt.stopPropagation();
  evt.preventDefault();
}
 
开发者ID:eclipse,项目名称:che,代码行数:6,代码来源:DomUtils.java


注:本文中的elemental.events.Event.stopPropagation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。