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


Java MouseEventDetailsBuilder类代码示例

本文整理汇总了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);
		}
	});

}
 
开发者ID:viritin,项目名称:archetype-vaadin-gwt-addon,代码行数:23,代码来源:MyComponentConnector.java

示例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;
}
 
开发者ID:vaadin,项目名称:grid-renderers-collection-addon,代码行数:20,代码来源:HtmlButtonRendererConnector.java

示例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);
            }
        }
    });
}
 
开发者ID:alump,项目名称:LabelButton,代码行数:18,代码来源:LabelButtonConnector.java

示例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);
		}
	});
}
 
开发者ID:melistik,项目名称:vaadin-grid-util,代码行数:21,代码来源:AbstractButtonValueConnector.java

示例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);
				}
			});
		}
	}
 
开发者ID:Porotype,项目名称:activelink,代码行数:19,代码来源:ActiveLinkConnector.java

示例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);
				}
			}
		});
}
 
开发者ID:hezamu,项目名称:vaadincanvas,代码行数:23,代码来源:CanvasConnector.java

示例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();
}
 
开发者ID:pontusbostrom,项目名称:VaadinGraphvizComponent,代码行数:13,代码来源:VizComponentConnector.java

示例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);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:8,代码来源:CubaSourceCodeEditorConnector.java

示例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);
            }
        }
    });
}
 
开发者ID:alump,项目名称:LabelButton,代码行数:16,代码来源:LabelButtonExtensionConnector.java

示例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;
}
 
开发者ID:alump,项目名称:IdleAlarm,代码行数:14,代码来源:IdleAlarmConnector.java

示例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()));
}
 
开发者ID:octavm,项目名称:v-leaflet-rotatedmarker-parent,代码行数:6,代码来源:LeafletRotatedMarkerConnector.java

示例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);
}
 
开发者ID:tltv,项目名称:gantt,代码行数:6,代码来源:GanttConnector.java

示例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);
}
 
开发者ID:tltv,项目名称:gantt,代码行数:7,代码来源:GanttConnector.java

示例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);
}
 
开发者ID:tltv,项目名称:gantt,代码行数:7,代码来源:GanttConnector.java

示例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);
}
 
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:11,代码来源:AbstractGridExtensionConnector.java


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