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


Java ContextMenuEvent.stopPropagation方法代码示例

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


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

示例1: handleBodyContextMenu

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入方法依赖的package包/类
@Override
protected void handleBodyContextMenu(ContextMenuEvent event) {
    if (customContextMenu == null) {
        super.handleBodyContextMenu(event);
    } else if (!selectedIds.isEmpty()) {
        int left = event.getNativeEvent().getClientX();
        int top = event.getNativeEvent().getClientY();
        top += Window.getScrollTop();
        left += Window.getScrollLeft();

        showContextMenuPopup(left, top);

        event.stopPropagation();
        event.preventDefault();
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:CubaTreeWidget.java

示例2: setPlatypusPopupMenu

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入方法依赖的package包/类
@Override
public void setPlatypusPopupMenu(PlatypusPopupMenu aMenu) {
	if (menu != aMenu) {
		if (menuTriggerReg != null)
			menuTriggerReg.removeHandler();
		menu = aMenu;
		if (menu != null) {
			menuTriggerReg = super.addDomHandler(new ContextMenuHandler() {

				@Override
				public void onContextMenu(ContextMenuEvent event) {
					event.preventDefault();
					event.stopPropagation();
					menu.setPopupPosition(event.getNativeEvent().getClientX(), event.getNativeEvent().getClientY());
					menu.show();
				}
			}, ContextMenuEvent.getType());
		}
	}
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:21,代码来源:PlatypusComboBox.java

示例3: setPlatypusPopupMenu

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入方法依赖的package包/类
@Override
public void setPlatypusPopupMenu(PlatypusPopupMenu aMenu) {
	if (menu != aMenu) {
		if (menuTriggerReg != null)
			menuTriggerReg.removeHandler();
		menu = aMenu;
		if (menu != null) {
			menuTriggerReg = super.addDomHandler(new ContextMenuHandler() {
				
				@Override
				public void onContextMenu(ContextMenuEvent event) {
					event.preventDefault();
					event.stopPropagation();
					menu.setPopupPosition(event.getNativeEvent().getClientX(), event.getNativeEvent().getClientY());
					menu.show();
				}
			}, ContextMenuEvent.getType());
		}
	}
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:21,代码来源:PlatypusDateField.java

示例4: setPlatypusPopupMenu

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入方法依赖的package包/类
@Override
public void setPlatypusPopupMenu(PlatypusPopupMenu aMenu) {
	if (contextMenu != aMenu) {
		if (menuTriggerReg != null)
			menuTriggerReg.removeHandler();
		contextMenu = aMenu;
		if (contextMenu != null) {
			menuTriggerReg = super.addDomHandler(new ContextMenuHandler() {

				@Override
				public void onContextMenu(ContextMenuEvent event) {
					event.preventDefault();
					event.stopPropagation();
					contextMenu.setPopupPosition(event.getNativeEvent().getClientX(), event.getNativeEvent().getClientY());
					contextMenu.show();
				}
			}, ContextMenuEvent.getType());
		}
	}
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:21,代码来源:PlatypusSplitButton.java

示例5: onContextMenu

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入方法依赖的package包/类
@Override
public boolean onContextMenu(ContextMenuEvent event, Element context) {
  // Ignore quasi-deleted or disabled blip.
  if (DomUtil.isQuasiDeleted(context) || !isEnabled()) {
    return false;
  }

  menuContextElement = context;
  menuContextEvent = event.getNativeEvent();
  hideAndScheduleShowPopupMenu();
  event.stopPropagation();
  event.preventDefault();
  return true;
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:15,代码来源:BlipMenuController.java

示例6: handleBodyContextMenu

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入方法依赖的package包/类
protected void handleBodyContextMenu(ContextMenuEvent event) {
    if (bodyActionKeys != null) {
        clickedLonLat = getMap().getLonLatFromPixel(
                Pixel.create(getMapClickLeftPosition(event),
                        getMapClickTopPosition(event)));
        Projection projection = getMap().getBaseLayer().getProjection();
        Projection apiProjection = getProjection();
        clickedLonLat.transform(projection, apiProjection);
        client.getContextMenu().showAt(this,
                getWindowClickLeftPosition(event),
                getWindowClickTopPosition(event));
        event.stopPropagation();
        event.preventDefault();
    }
}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:16,代码来源:VOpenLayersMap.java

示例7: onContextMenu

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入方法依赖的package包/类
@Override
public void onContextMenu(ContextMenuEvent event) {
  if (dispatch(event, event.getNativeEvent().getEventTarget().<Element>cast()) ) {
    event.stopPropagation();
  }
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:7,代码来源:EventDispatcherPanel.java

示例8: onContextMenu

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入方法依赖的package包/类
@Override
public void onContextMenu(final ContextMenuEvent event) {
    event.preventDefault();
    event.stopPropagation();
    final boolean isShiftKeyDown = event.getNativeEvent().getShiftKey();
    final boolean isControlKeyDown = event.getNativeEvent().getCtrlKey();
    final int eventX = event.getNativeEvent().getClientX();
    final int eventY = event.getNativeEvent().getClientY();
    final int canvasX = getRelativeX(event);
    final int canvasY = getRelativeY(event);

    for (GuidedDecisionTableView.Presenter dtPresenter : modellerPresenter.getAvailableDecisionTables()) {
        final GuidedDecisionTableView gridView = dtPresenter.getView();
        final GridData gridModel = gridView.getModel();

        final Point2D ap = CoordinateUtilities.convertDOMToGridCoordinate(gridView,
                                                                          new Point2D(canvasX,
                                                                                      canvasY));
        final Integer uiRowIndex = CoordinateUtilities.getUiRowIndex(gridView,
                                                                     ap.getY());
        final Integer uiColumnIndex = CoordinateUtilities.getUiColumnIndex(gridView,
                                                                           ap.getX());
        if (uiRowIndex == null || uiColumnIndex == null) {
            continue;
        }

        final GridColumn<?> column = gridModel.getColumns().get(uiColumnIndex);
        if (column instanceof IsRowDragHandle) {
            rowContextMenu.show(eventX,
                                eventY);

        } else {
            cellContextMenu.show(eventX,
                                 eventY);
        }

        // the original column index before any moves
        final int modelColumnIndex = column.getIndex();
        // selected cells of UIModel whose column index is that of the context menu selected cell
        final Stream<SelectedCell> modelColumnSelectedCells = gridModel.getSelectedCells().stream().filter(cell -> cell.getColumnIndex() == modelColumnIndex);
        // does row index of context menu selected cell match one in UIModel selected cells?
        final boolean isContextMenuCellSelectedCell = modelColumnSelectedCells.map(GridData.SelectedCell::getRowIndex).anyMatch(rowIndex -> rowIndex == uiRowIndex);
        // if cell selected for context menu is not one of the selected cells from CTRL or SHIFT then handle the selected cell
        if (!isContextMenuCellSelectedCell) {
            selectCell(uiRowIndex,
                       uiColumnIndex,
                       gridView,
                       isShiftKeyDown,
                       isControlKeyDown);
        }
    }
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:53,代码来源:GuidedDecisionTableModellerContextMenuSupport.java


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