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


Java ContextMenuEvent类代码示例

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


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

示例1: VOpenLayersMap

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入依赖的package包/类
/**
 * The constructor should first call super() to initialize the component and
 * then handle any initialization relevant to Vaadin.
 */
public VOpenLayersMap() {
    setWidth("500px");
    setHeight("500px");
    add(map);
    add(fakePaintables);
    fakePaintables.setVisible(false);

    // This method call of the Paintable interface sets the component
    // style name in DOM tree
    setStyleName(CLASSNAME);

    sinkEvents(Event.ONCONTEXTMENU);
    addDomHandler(new ContextMenuHandler() {
        public void onContextMenu(ContextMenuEvent event) {
            handleBodyContextMenu(event);
        }
    }, ContextMenuEvent.getType());
}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:23,代码来源:VOpenLayersMap.java

示例2: MonthItemLabel

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入依赖的package包/类
/**
 * Default constructor
 */
public MonthItemLabel() {
    setStylePrimaryName(STYLENAME);

    addDomHandler(contextMenuEvent -> {
        calendar.getMouseEventListener().contextMenu(contextMenuEvent, MonthItemLabel.this);
        contextMenuEvent.stopPropagation();
        contextMenuEvent.preventDefault();
    }, ContextMenuEvent.getType());
}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:13,代码来源:MonthItemLabel.java

示例3: 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

示例4: init

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入依赖的package包/类
@Override
protected void init() {
    super.init();

    getWidget().tabContextMenuHandler = new CubaTabSheetWidget.TabContextMenuHandler() {
        @Override
        public void onContextMenu(int tabIndex, ContextMenuEvent event) {
            lastContextMenuX = WidgetUtil.getTouchOrMouseClientX(event.getNativeEvent());
            lastContextMenuY = WidgetUtil.getTouchOrMouseClientY(event.getNativeEvent());

            if (getState().hasActionsHandlers) {
                rpc.onTabContextMenu(tabIndex);

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

示例5: 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,代码来源:ModelGrid.java

示例6: 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

示例7: 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

示例8: updateEventCaches

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入依赖的package包/类
/**
 * Update event caches to keep track of the latest event of each instance.
 * @param the event to cache
 */
private void updateEventCaches(Event<?> event){
	if(event == null){
		return;
	}
	if(event instanceof DoubleClickEvent){
		doubleClickEvent = new org.gz.gwt.mousemanager.client.event.DoubleClickEvent((DoubleClickEvent)event, target);
	}
	if(event instanceof ClickEvent){
		clickEvent = new org.gz.gwt.mousemanager.client.event.ClickEvent((ClickEvent)event, target);
	}		
	if(event instanceof MouseUpEvent){
		mouseUpEvent = new org.gz.gwt.mousemanager.client.event.MouseUpEvent((MouseUpEvent)event, target);
	}
	if(event instanceof MouseDownEvent){
		mouseDownEvent = new org.gz.gwt.mousemanager.client.event.MouseDownEvent((MouseDownEvent)event, target);
	} 
	if(event instanceof MouseMoveEvent){
		mouseMoveEvent = new org.gz.gwt.mousemanager.client.event.MouseMoveEvent((MouseMoveEvent)event, target);
	}
	if(event instanceof MouseOverEvent){
		mouseOverEvent = new org.gz.gwt.mousemanager.client.event.MouseOverEvent((MouseOverEvent)event, target);
	}
	if(event instanceof MouseOutEvent){
		mouseOutEvent = new org.gz.gwt.mousemanager.client.event.MouseOutEvent((MouseOutEvent)event, target);
	}
	if(event instanceof MouseWheelEvent){
		mouseWheelEvent = new org.gz.gwt.mousemanager.client.event.MouseWheelEvent((MouseWheelEvent)event, target);
	}
	if(event instanceof ContextMenuEvent){
		contextMenuEvent = new org.gz.gwt.mousemanager.client.event.ContextMenuEvent();
	}
}
 
开发者ID:gzussa,项目名称:gwt-mousemanager,代码行数:37,代码来源:MouseHandlerManager.java

示例9: init

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入依赖的package包/类
@PostConstruct
public void init() {
    settings.setShowProgressbar(false);
    settings.setPauseOnMouseOver(true);
    settings.setAllowDismiss(true);
    settings.setDelay(DELAY);
    settings.setTimer(TIMER);
    addDomHandler((e) -> {
                      e.preventDefault();
                      e.stopPropagation();
                  },
                  ContextMenuEvent.getType());
    showLoading(false);

    //getting initial palette position
    paletteInitialTop = palettePanel.getAbsoluteTop();
    paletteInitialLeft = palettePanel.getAbsoluteLeft();
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:19,代码来源:SessionPresenterView.java

示例10: onModuleLoad

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入依赖的package包/类
@Override
public void onModuleLoad() {

    // Rest client configuration
    RestClient.setJacksonMarshallingActive(true);
    RestClient.setApplicationRoot("rs");

    // Disable right click
    RootLayoutPanel.get().addDomHandler(new ContextMenuHandler() {
        @Override
        public void onContextMenu(ContextMenuEvent event) {
            event.preventDefault();
            event.stopPropagation();
        }
    }, ContextMenuEvent.getType());

    // Create main content
    mainLayout = new MainLayout();
    RootLayoutPanel.get().add(mainLayout);
    
    // init
    mainLayout.init();
}
 
开发者ID:lorislab,项目名称:smonitor,代码行数:24,代码来源:Admin.java

示例11: 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

示例12: PartStackViewImpl

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入依赖的package包/类
@Inject
public PartStackViewImpl(
    PartStackUIResources resources, CoreLocalizationConstant localizationConstant) {
  this.resources = resources;
  this.localizationConstant = localizationConstant;
  initWidget(UI_BINDER.createAndBindUi(this));

  partStackContent.getElement().getStyle().setPosition(Style.Position.ABSOLUTE);

  tabs = new HashMap<>();

  partViewContainer =
      new AcceptsOneWidget() {
        @Override
        public void setWidget(IsWidget widget) {
          partStackContent.add(widget);
        }
      };

  addDomHandler(this, MouseDownEvent.getType());
  addDomHandler(this, ContextMenuEvent.getType());

  setMaximized(false);

  addMaximizeButton();
  addHideButton();
  addMenuButton();
}
 
开发者ID:eclipse,项目名称:che,代码行数:29,代码来源:PartStackViewImpl.java

示例13: EditorTabWidget

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入依赖的package包/类
@Inject
public EditorTabWidget(
    @Assisted final EditorPartPresenter relatedEditorPart,
    @Assisted EditorPartStack relatedEditorPartStack,
    PartStackUIResources resources,
    EditorTabContextMenuFactory editorTabContextMenu,
    final EventBus eventBus,
    final EditorAgent editorAgent) {
  this.resources = resources;
  this.relatedEditorPart = relatedEditorPart;
  this.relatedEditorPartStack = relatedEditorPartStack;
  this.editorAgent = editorAgent;

  initWidget(UI_BINDER.createAndBindUi(this));

  this.editorTabContextMenu = editorTabContextMenu;
  this.file = relatedEditorPart.getEditorInput().getFile();
  this.icon = relatedEditorPart.getTitleImage();
  this.title.setText(file.getDisplayName());
  // add "path" attribute describing the full path of opened file, will be used full for testing
  this.title.getElement().setAttribute("path", file.getLocation().toString());
  this.id = title + UUID.uuid(4);

  iconPanel.add(getIcon());

  addDomHandler(this, ClickEvent.getType());
  addDomHandler(this, DoubleClickEvent.getType());
  addDomHandler(this, ContextMenuEvent.getType());

  eventBus.addHandler(ResourceChangedEvent.getType(), this);
  eventBus.addHandler(FileEvent.TYPE, this);

  sinkEvents(Event.ONMOUSEDOWN);

  closeButton.addDomHandler(
      event -> editorAgent.closeEditor(relatedEditorPart), ClickEvent.getType());

  relatedEditorPart.addPropertyListener(
      (source, propId) -> {
        if (propId == EditorPartPresenter.PROP_INPUT) {
          file = relatedEditorPart.getEditorInput().getFile();
          title.setText(file.getDisplayName());
        }
      });
}
 
开发者ID:eclipse,项目名称:che,代码行数:46,代码来源:EditorTabWidget.java

示例14: onContextMenu

import com.google.gwt.event.dom.client.ContextMenuEvent; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void onContextMenu(ContextMenuEvent event) {
  // construct for each editor tab own context menu,
  // that will have store information about selected virtual file and pin state at first step
  // in future maybe we should create another mechanism to associate context menu with initial
  // dto's
  editorTabContextMenu
      .newContextMenu(this, relatedEditorPart, relatedEditorPartStack)
      .show(event.getNativeEvent().getClientX(), event.getNativeEvent().getClientY());
}
 
开发者ID:eclipse,项目名称:che,代码行数:12,代码来源:EditorTabWidget.java


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