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


Java ContextMenuHandler类代码示例

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


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

示例1: VOpenLayersMap

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的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: setPlatypusPopupMenu

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的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

示例3: setPlatypusPopupMenu

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的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.ContextMenuHandler; //导入依赖的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_RowContextMenu

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void onContextMenu_RowContextMenu() {
    final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable();
    final GridData uiModel = dtPresenter.getView().getModel();
    final GridColumn uiColumn = new RowNumberColumn();

    uiModel.appendColumn(uiColumn);

    when(columnInformation.getColumn()).thenReturn(uiColumn);
    when(modellerPresenter.getAvailableDecisionTables()).thenReturn(new HashSet<GuidedDecisionTableView.Presenter>() {{
        add(dtPresenter);
    }});

    final ContextMenuHandler handler = contextMenuSupport.getContextMenuHandler(modellerPresenter);

    handler.onContextMenu(event);

    verify(rowContextMenu,
           times(1)).show(any(Integer.class),
                          any(Integer.class));
    verify(cellContextMenu,
           never()).show(any(Integer.class),
                         any(Integer.class));
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:26,代码来源:GuidedDecisionTableModellerContextMenuSupportTest.java

示例6: onContextMenuWithoutCellSelectionManager

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void onContextMenuWithoutCellSelectionManager() {
    final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable();
    final GridData uiModel = dtPresenter.getView().getModel();
    final GridColumn uiColumn = new RowNumberColumn();
    uiModel.appendColumn(uiColumn);

    when(columnInformation.getColumn()).thenReturn(uiColumn);
    when(modellerPresenter.getAvailableDecisionTables()).thenReturn(new HashSet<GuidedDecisionTableView.Presenter>() {{
        add(dtPresenter);
    }});

    final GridCell uiCell = mock(GridCell.class);
    when(uiModel.getCell(any(Integer.class),
                         any(Integer.class))).thenReturn(uiCell);
    when(uiCell.getSelectionManager()).thenReturn(null);

    final ContextMenuHandler handler = contextMenuSupport.getContextMenuHandler(modellerPresenter);

    handler.onContextMenu(event);

    verify(layer,
           never()).batch();
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:26,代码来源:GuidedDecisionTableModellerContextMenuSupportTest.java

示例7: setup

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的package包/类
@Before
public void setup() {
    when(gridLayer.addNodeMouseMoveHandler(any(NodeMouseMoveHandler.class))).thenReturn(mock(HandlerRegistration.class));
    when(gridLayer.addNodeMouseOutHandler(any(NodeMouseOutHandler.class))).thenReturn(mock(HandlerRegistration.class));
    when(view.addKeyDownHandler(any(KeyDownHandler.class))).thenReturn(mock(HandlerRegistration.class));
    when(view.addContextMenuHandler(any(ContextMenuHandler.class))).thenReturn(mock(HandlerRegistration.class));
    when(view.addMouseDownHandler(any(MouseDownHandler.class))).thenReturn(mock(HandlerRegistration.class));
    when(view.getGridLayerView()).thenReturn(gridLayer);
    when(view.getBounds()).thenReturn(bounds);

    final GuidedDecisionTableModellerPresenter wrapped = new GuidedDecisionTableModellerPresenter(view,
                                                                                                  dtablePresenterProvider,
                                                                                                  contextMenuSupport,
                                                                                                  updateRadarEvent,
                                                                                                  pinnedEvent,
                                                                                                  columnHeaderPopOver,
                                                                                                  wizardManagedInstance);
    presenter = spy(wrapped);

    when(dtablePresenterProvider.get()).thenReturn(dtablePresenter);
    when(dtablePresenter.getView()).thenReturn(dtableView);
    when(dtableView.getModel()).thenReturn(new BaseGridData());
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:24,代码来源:GuidedDecisionTableModellerPresenterTest.java

示例8: onModuleLoad

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的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

示例9: onContextMenu_CellContextMenu

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void onContextMenu_CellContextMenu() {
    final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable();
    final GridData uiModel = dtPresenter.getView().getModel();
    final GridColumn uiColumn = new BaseGridColumn(mock(GridColumn.HeaderMetaData.class),
                                                   mock(GridColumnRenderer.class),
                                                   100.0);

    uiModel.appendColumn(uiColumn);

    when(columnInformation.getColumn()).thenReturn(uiColumn);
    when(modellerPresenter.getAvailableDecisionTables()).thenReturn(new HashSet<GuidedDecisionTableView.Presenter>() {{
        add(dtPresenter);
    }});

    final ContextMenuHandler handler = contextMenuSupport.getContextMenuHandler(modellerPresenter);

    handler.onContextMenu(event);

    verify(rowContextMenu,
           never()).show(any(Integer.class),
                         any(Integer.class));
    verify(cellContextMenu,
           times(1)).show(any(Integer.class),
                          any(Integer.class));
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:28,代码来源:GuidedDecisionTableModellerContextMenuSupportTest.java

示例10: testContextMenuCellIsSelectedCell

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void testContextMenuCellIsSelectedCell() {
    final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable();
    final GridData uiModel = dtPresenter.getView().getModel();
    final GridColumn uiColumn = new RowNumberColumn();

    uiModel.appendColumn(uiColumn);

    //Cell associated with Mock onContextMenu Event has indices (0,0)
    uiModel.selectCells(0, 0, 1, 1);

    when(columnInformation.getColumn()).thenReturn(uiColumn);
    when(modellerPresenter.getAvailableDecisionTables()).thenReturn(new HashSet<GuidedDecisionTableView.Presenter>() {

        {
            add(dtPresenter);
        }
    });

    final ContextMenuHandler handler = contextMenuSupport.getContextMenuHandler(modellerPresenter);

    handler.onContextMenu(event);

    // this method is called if the handler does a selectCell, which should not occur for this test case
    verify(cellSelectionStrategy,
           never()).handleSelection(any(GridData.class),
                                    any(Integer.class),
                                    any(Integer.class),
                                    any(Boolean.class),
                                    any(Boolean.class));

    verify(rowContextMenu,
           times(1)).show(any(Integer.class),
                          any(Integer.class));
    verify(cellContextMenu,
           never()).show(any(Integer.class),
                         any(Integer.class));
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:40,代码来源:GuidedDecisionTableModellerContextMenuSupportTest.java

示例11: onContextMenuWithCellSelectionManagerWithChangeInSelection

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void onContextMenuWithCellSelectionManagerWithChangeInSelection() {
    final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable();
    final GridData uiModel = dtPresenter.getView().getModel();
    final GridColumn uiColumn = new RowNumberColumn();

    uiModel.appendColumn(uiColumn);

    when(columnInformation.getColumn()).thenReturn(uiColumn);
    when(modellerPresenter.getAvailableDecisionTables()).thenReturn(new HashSet<GuidedDecisionTableView.Presenter>() {{
        add(dtPresenter);
    }});
    when(uiModel.getCell(any(Integer.class),
                         any(Integer.class))).thenReturn(uiCell);
    when(cellSelectionStrategy.handleSelection(any(GridData.class),
                                               any(Integer.class),
                                               any(Integer.class),
                                               any(Boolean.class),
                                               any(Boolean.class))).thenReturn(true);

    final ContextMenuHandler handler = contextMenuSupport.getContextMenuHandler(modellerPresenter);

    handler.onContextMenu(event);

    verify(cellSelectionStrategy,
           times(1)).handleSelection(eq(uiModel),
                                     eq(0),
                                     eq(0),
                                     eq(false),
                                     eq(false));
    verify(layer,
           times(1)).batch();
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:35,代码来源:GuidedDecisionTableModellerContextMenuSupportTest.java

示例12: onContextMenuWithCellSelectionManagerWithoutChangeInSelection

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void onContextMenuWithCellSelectionManagerWithoutChangeInSelection() {
    final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable();
    final GridData uiModel = dtPresenter.getView().getModel();
    final GridColumn uiColumn = new RowNumberColumn();

    uiModel.appendColumn(uiColumn);

    when(columnInformation.getColumn()).thenReturn(uiColumn);
    when(modellerPresenter.getAvailableDecisionTables()).thenReturn(new HashSet<GuidedDecisionTableView.Presenter>() {{
        add(dtPresenter);
    }});
    when(uiModel.getCell(any(Integer.class),
                         any(Integer.class))).thenReturn(uiCell);

    final ContextMenuHandler handler = contextMenuSupport.getContextMenuHandler(modellerPresenter);

    handler.onContextMenu(event);

    verify(cellSelectionStrategy,
           times(1)).handleSelection(eq(uiModel),
                                     eq(0),
                                     eq(0),
                                     eq(false),
                                     eq(false));
    verify(layer,
           never()).batch();
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:30,代码来源:GuidedDecisionTableModellerContextMenuSupportTest.java

示例13: addContextMenuHandler

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的package包/类
public HandlerRegistration addContextMenuHandler(ContextMenuHandler handler) {
    return addDomHandler(handler, ContextMenuEvent.getType());
}
 
开发者ID:gzussa,项目名称:gwt-mousemanager,代码行数:4,代码来源:AdvSurface.java

示例14: getContextMenuHandler

import com.google.gwt.event.dom.client.ContextMenuHandler; //导入依赖的package包/类
public ContextMenuHandler getContextMenuHandler(final GuidedDecisionTableModellerView.Presenter modellerPresenter) {
    return new GuidedDecisionTableModellerContextMenuHandler(modellerPresenter,
                                                             cellContextMenu,
                                                             rowContextMenu);
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:6,代码来源:GuidedDecisionTableModellerContextMenuSupport.java


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