Java 类com.google.gwt.event.dom.client.ContextMenuEvent 实例源码

项目:ExpressZip    文件:VOpenLayersMap.java   
/**
 * 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());
}
项目:calendar-component    文件:MonthItemLabel.java   
/**
 * Default constructor
 */
public MonthItemLabel() {
    setStylePrimaryName(STYLENAME);

    addDomHandler(contextMenuEvent -> {
        calendar.getMouseEventListener().contextMenu(contextMenuEvent, MonthItemLabel.this);
        contextMenuEvent.stopPropagation();
        contextMenuEvent.preventDefault();
    }, ContextMenuEvent.getType());
}
项目:cuba    文件:CubaTreeWidget.java   
@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();
    }
}
项目:cuba    文件:CubaTabSheetConnector.java   
@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();
            }
        }
    };
}
项目:platypus-js    文件:ModelGrid.java   
@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());
        }
    }
}
项目:platypus-js    文件:ScrollPane.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusDateField.java   
@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());
        }
    }
}
项目:platypus-js    文件:MarginsPane.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusSlider.java   
@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());
        }
    }
}
项目:platypus-js    文件:ToolBar.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusLabel.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusRadioButton.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusToggleButton.java   
@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());
        }
    }
}
项目:platypus-js    文件:CardPane.java   
@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());
        }
    }
}
项目:platypus-js    文件:SplitPane.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusSpinnerField.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusPasswordField.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusProgressBar.java   
@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());
        }
    }
}
项目:platypus-js    文件:TabbedPane.java   
@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());
        }
    }
}
项目:platypus-js    文件:BorderPane.java   
@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());
        }
    }
}
项目:platypus-js    文件:GridPane.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusButton.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusFormattedTextField.java   
@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());
        }
    }
}
项目:platypus-js    文件:FlowPane.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusCheckBox.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusSplitButton.java   
@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());
        }
    }
}
项目:platypus-js    文件:DesktopPane.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusHtmlEditor.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusTextArea.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusTextField.java   
@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());
        }
    }
}
项目:platypus-js    文件:BoxPane.java   
@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());
        }
    }
}
项目:platypus-js    文件:PlatypusComboBox.java   
@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());
        }
    }
}
项目:platypus-js    文件:ModelDecoratorBox.java   
@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());
        }
    }
}
项目:gwt-mousemanager    文件:MouseHandlerManager.java   
/**
 * 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();
    }
}
项目:kie-wb-common    文件:SessionPresenterView.java   
@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();
}
项目:smonitor    文件:Admin.java   
@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();
}
项目:Wiab.pro    文件:BlipMenuController.java   
@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;
}
项目:che    文件:PartStackViewImpl.java   
@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();
}
项目:che    文件:EditorTabWidget.java   
@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());
        }
      });
}
项目:che    文件:EditorTabWidget.java   
/** {@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());
}