本文整理汇总了Java中com.vaadin.client.MouseEventDetailsBuilder类的典型用法代码示例。如果您正苦于以下问题:Java MouseEventDetailsBuilder类的具体用法?Java MouseEventDetailsBuilder怎么用?Java MouseEventDetailsBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MouseEventDetailsBuilder类属于com.vaadin.client包,在下文中一共展示了MouseEventDetailsBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MyComponentConnector
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
public MyComponentConnector() {
// To receive RPC events from server, we register ClientRpc implementation
registerRpc(MyComponentClientRpc.class, new MyComponentClientRpc() {
public void alert(String message) {
Window.alert(message);
}
});
// We choose listed for mouse clicks for the widget
getWidget().addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
final MouseEventDetails mouseDetails = MouseEventDetailsBuilder
.buildMouseEventDetails(event.getNativeEvent(),
getWidget().getElement());
// When the widget is clicked, the event is sent to server with ServerRpc
rpc.clicked(mouseDetails);
}
});
}
示例2: createWidget
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
@Override
public Button createWidget() {
final Button b = GWT.create(Button.class);
b.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
MouseEventDetails mouseEventDetails = MouseEventDetailsBuilder
.buildMouseEventDetails(event.getNativeEvent(),
b.getElement());
Element e = b.getElement();
rpc.onClick(e.getPropertyString(ROW_KEY_PROPERTY),
e.getPropertyString(COLUMN_ID_PROPERTY),mouseEventDetails);
event.stopPropagation();
}
});
b.setStylePrimaryName("v-nativebutton");
return b;
}
示例3: attachClickHandler
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
protected void attachClickHandler() {
clickReg = getWidget().addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
//TODO: also add text selection check here!
if (getState().enabled) {
MouseEventDetails details = MouseEventDetailsBuilder
.buildMouseEventDetails(event.getNativeEvent(), getWidget()
.getElement());
event.stopPropagation();
event.preventDefault();
getRpcProxy(LabelButtonServerRpc.class).onClick(details);
}
}
});
}
示例4: init
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
/**
* dirty hack because of the convertion within {@link ClickableRenderer} of {@link ClickEvent} to {@link NativeEvent} were the
* RelativeElement get lost... before rpc-call is fired ask Widget of it's last relativeX value that should be this current onClickEvent
*/
@Override
protected void init() {
this.clickRegistration = addClickHandler(new RendererClickHandler<JsonObject>() {
@Override
public void onClick(final RendererClickEvent<JsonObject> event) {
MouseEventDetails details = MouseEventDetailsBuilder.buildMouseEventDetails(event.getNativeEvent());
// get relativeX from Widget itself
details.setRelativeX(getRenderer().getClickedBITM());
getRpcProxy(RendererClickRpc.class).click(getRowKey(event.getCell()
.getRow()), getColumnId(event.getCell()
.getColumn()), details);
}
});
}
示例5: onClick
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
public void onClick(final ClickEvent event) {
final MouseEventDetails mouseDetails = MouseEventDetailsBuilder
.buildMouseEventDetails(event.getNativeEvent(), getWidget()
.getElement());
rpc.clicked(mouseDetails);
if (!mouseDetails.isCtrlKey() && !mouseDetails.isAltKey()
&& !mouseDetails.isShiftKey() && !mouseDetails.isMetaKey()) {
// RPC gets lost if we don't delay
event.preventDefault();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
getWidget().onClick(mouseDetails);
}
});
}
}
示例6: onStateChanged
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
// Only add a mouse move handler if someone is interested in, as
// otherwise
// they would generate a large amount of server side traffic.
if (stateChangeEvent.hasPropertyChanged("listenMouseMove")
&& getState().listenMouseMove)
getWidget().addMouseMoveHandler(new MouseMoveHandler() {
@Override
public void onMouseMove(MouseMoveEvent event) {
if (getState().listenMouseMove) {
MouseEventDetails med = MouseEventDetailsBuilder
.buildMouseEventDetails(event.getNativeEvent(),
getWidget().getElement());
rpc.mouseMoved(med);
}
}
});
}
示例7: onClick
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
@Override
public void onClick(NativeEvent event) {
Element e = Element.as(event.getEventTarget());
String nodeId = getWidget().getNodeId(e.getParentElement());
MouseEventDetails details = MouseEventDetailsBuilder
.buildMouseEventDetails(event, getWidget().getElement());
rpc.nodeClicked(nodeId, details);
event.stopPropagation();
event.preventDefault();
}
示例8: contextHelpIconClick
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
@Override
public void contextHelpIconClick(NativeEvent event) {
MouseEventDetails details = MouseEventDetailsBuilder
.buildMouseEventDetails(event, getWidget().getElement());
getRpcProxy(HasContextHelpServerRpc.class).iconClick(details);
}
示例9: attachClickHandler
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
protected void attachClickHandler() {
clickReg = getExtendedWidget().addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if (getState().enabled && extendedConnector.isEnabled()) {
MouseEventDetails details = MouseEventDetailsBuilder
.buildMouseEventDetails(event.getNativeEvent(), getExtendedWidget().getElement());
event.stopPropagation();
event.preventDefault();
getRpcProxy(LabelButtonServerRpc.class).onClick(details);
}
}
});
}
示例10: createButton
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
private Widget createButton(final int id, int index, String caption, Collection<String> styleNames) {
VButton redirectButton = new VButton();
if(caption != null) {
redirectButton.setText(caption);
}
redirectButton.addStyleName("button-" + index);
styleNames.forEach(styleName -> redirectButton.addStyleName(styleName));
redirectButton.addClickHandler(e -> {
MouseEventDetails details = MouseEventDetailsBuilder.buildMouseEventDetails(e.getNativeEvent());
getRpcProxy(IdleAlarmServerRpc.class).buttonClicked(id, details);
});
return redirectButton;
}
示例11: onClick
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
@Override
public void onClick(MouseEvent event) {
rpc.onClick(U.toPoint(event.getLatLng()),
MouseEventDetailsBuilder.buildMouseEventDetails(event.getNativeEvent(), getLeafletMapConnector().getWidget().getElement()));
}
示例12: stepClicked
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
@Override
public void stepClicked(String stepUid, NativeEvent event, Element relativeToElement) {
MouseEventDetails details = MouseEventDetailsBuilder.buildMouseEventDetails(event, relativeToElement);
rpc.stepClicked(stepUid, details);
}
示例13: onMove
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
@Override
public void onMove(String stepUid, String newStepUid, long startDate, long endDate, NativeEvent event,
Element relativeToElement) {
MouseEventDetails details = MouseEventDetailsBuilder.buildMouseEventDetails(event, relativeToElement);
rpc.onMove(stepUid, newStepUid, startDate, endDate, details);
}
示例14: onResize
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
@Override
public void onResize(String stepUid, long startDate, long endDate, NativeEvent event,
Element relativeToElement) {
MouseEventDetails details = MouseEventDetailsBuilder.buildMouseEventDetails(event, relativeToElement);
rpc.onResize(stepUid, startDate, endDate, details);
}
示例15: getMouseEventDetails
import com.vaadin.client.MouseEventDetailsBuilder; //导入依赖的package包/类
/**
* Gets a {@link MouseEventDetails} object from native mouse event.
*
* @param event
* native mouse event
* @return mouse event details
*/
protected MouseEventDetails getMouseEventDetails(NativeEvent event) {
return MouseEventDetailsBuilder.buildMouseEventDetails(event);
}