本文整理汇总了Java中com.vaadin.shared.MouseEventDetails类的典型用法代码示例。如果您正苦于以下问题:Java MouseEventDetails类的具体用法?Java MouseEventDetails怎么用?Java MouseEventDetails使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MouseEventDetails类属于com.vaadin.shared包,在下文中一共展示了MouseEventDetails类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: itemClick
import com.vaadin.shared.MouseEventDetails; //导入依赖的package包/类
@Override
public void itemClick(ItemClickEvent event) {
if (event.getButton() == MouseEventDetails.MouseButton.LEFT) {
Folder folder = (Folder) event.getItemId();
if (getItemClickable(folder)) {
openFolder((AbstractSearchFolder) event.getItemId());
} else if (isItemExpandable(folder)) {
Component tree = event.getComponent();
if (tree instanceof Tree) {
if (((Tree) tree).isExpanded(folder))
((Tree) tree).collapseItem(folder);
else
((Tree) tree).expandItem(folder);
}
}
}
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:18,代码来源:CubaFoldersPane.java
示例2: MyComponentConnector
import com.vaadin.shared.MouseEventDetails; //导入依赖的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
示例3: handleMouseEvent
import com.vaadin.shared.MouseEventDetails; //导入依赖的package包/类
private void handleMouseEvent(MouseEventDetails mouseEventDetails) {
int x = mouseEventDetails.getRelativeX();
int y = mouseEventDetails.getRelativeY();
if(mousePressed) {
scheduleExecutor();
canvas.beginPath();
canvas.moveTo(previousX, previousY);
canvas.lineTo(x, y);
canvas.stroke();
canvas.closePath();
drawer.drawLine(previousX, previousY, x, y);
}
previousX = x;
previousY = y;
}
开发者ID:fluoxa,项目名称:Iris,代码行数:20,代码来源:DrawingLayout.java
示例4: createWidget
import com.vaadin.shared.MouseEventDetails; //导入依赖的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
示例5: attachClickHandler
import com.vaadin.shared.MouseEventDetails; //导入依赖的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
示例6: init
import com.vaadin.shared.MouseEventDetails; //导入依赖的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
示例7: init
import com.vaadin.shared.MouseEventDetails; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
final VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
setContent(layout);
ActiveLink link = new ActiveLink("Click Me", new ExternalResource(
"http://blog.porotype.com"));
link.addListener(new LinkActivatedListener() {
@Override
public void linkActivated(LinkActivatedEvent event) {
MouseEventDetails d = event.getMouseEventDetails();
String caption = "Link " + d.getButtonName() + "-clicked";
String msg = "Ctrl: " + d.isCtrlKey() + " Shift: "
+ d.isShiftKey() + " Alt: " + d.isAltKey() + " Meta: "
+ d.isMetaKey();
Notification.show(caption, msg, Type.WARNING_MESSAGE);
System.err.println(caption + " " + msg);
}
});
layout.addComponent(link);
}
开发者ID:Porotype,项目名称:activelink,代码行数:24,代码来源:DemoUI.java
示例8: onClick
import com.vaadin.shared.MouseEventDetails; //导入依赖的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
示例9: onStateChanged
import com.vaadin.shared.MouseEventDetails; //导入依赖的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
示例10: fromClickEvent
import com.vaadin.shared.MouseEventDetails; //导入依赖的package包/类
private static MouseEventDetails fromClickEvent(ItemClickEvent event) {
MouseEventDetails d = new MouseEventDetails();
d.setButton(event.getButton());
d.setAltKey(event.isAltKey());
d.setCtrlKey(event.isCtrlKey());
d.setShiftKey(event.isShiftKey());
d.setType(event.isDoubleClick() ? 0x00002 : 0);
d.setClientX(event.getClientX());
d.setClientY(event.getClientY());
d.setRelativeX(event.getRelativeX());
d.setRelativeY(event.getRelativeY());
return d;
}
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:14,代码来源:DefaultItemListing.java
示例11: buildStepLabel
import com.vaadin.shared.MouseEventDetails; //导入依赖的package包/类
/**
* Build a new label for the given step.
*
* @param step
* The step to build the label for
*
* @return The label for the step
*/
protected StepLabel buildStepLabel(Step step) {
StepLabel stepLabel = labelFactory.get();
stepLabel.setIcon(buildStepLabelIcon(step));
stepLabel.setCaption(step.getCaption());
stepLabel.setDescription(step.getDescription());
stepLabel.addLayoutClickListener(event -> {
boolean isLeftClick = event.getButton() == MouseEventDetails.MouseButton.LEFT;
if (isLeftClick && stepLabel.isClickable()) {
stepIterator.moveTo(step);
}
});
return stepLabel;
}
开发者ID:Juchar,项目名称:md-stepper,代码行数:22,代码来源:LabelProvider.java
示例12: fireClick
import com.vaadin.shared.MouseEventDetails; //导入依赖的package包/类
@Override
protected void fireClick(final MouseEventDetails details) {
ConfirmDialog dialog = ConfirmDialog.show(getUI(), getConfirmWindowCaption(), getConfirmationText(), getOkCaption(),
getCancelCaption(), new Runnable() {
@Override
public void run() {
doFireClickListener(details);
}
});
dialog.getOkButton().addStyleName(confirmWindowOkButtonStyle);
}
开发者ID:viydaag,项目名称:dungeonstory-java,代码行数:13,代码来源:ConfirmButton.java
示例13: doFireClickListener
import com.vaadin.shared.MouseEventDetails; //导入依赖的package包/类
protected void doFireClickListener(final MouseEventDetails details) {
ConfirmButton.super.fireClick(details);
if (clickListeners != null) {
final Button.ClickListener[] array = clickListeners.toArray(new Button.ClickListener[clickListeners.size()]);
for (Button.ClickListener l : array) {
l.buttonClick(null);
}
}
}
开发者ID:viydaag,项目名称:dungeonstory-java,代码行数:10,代码来源:ConfirmButton.java
示例14: itemClick
import com.vaadin.shared.MouseEventDetails; //导入依赖的package包/类
@Override
public void itemClick(ItemClickEvent event) {
MenuItem item = (MenuItem) event.getItemId();
if (item.isMenu()) {
Component tree = event.getComponent();
if (tree instanceof Tree) {
switchExpandState((Tree) tree, item);
}
} else {
if (event.getButton() == MouseEventDetails.MouseButton.LEFT) {
tree.select(item);
openWindow(item);
}
}
}
开发者ID:cuba-platform,项目名称:sampler,代码行数:16,代码来源:SamplerFoldersPane.java
示例15: nodeClicked
import com.vaadin.shared.MouseEventDetails; //导入依赖的package包/类
@Override
public void nodeClicked(String nodeId, MouseEventDetails mouseDetails) {
Subgraph.Node gnode = graph.getNode(nodeId);
if (gnode != null) {
fireEvent(new NodeClickEvent(VizComponent.this, gnode,
mouseDetails));
}
}
开发者ID:pontusbostrom,项目名称:VaadinGraphvizComponent,代码行数:9,代码来源:VizComponent.java
示例16: edgeClicked
import com.vaadin.shared.MouseEventDetails; //导入依赖的package包/类
@Override
public void edgeClicked(String edgeId, MouseEventDetails mouseDetails) {
Subgraph.Edge gedge = graph.getEdge(edgeId);
if (gedge != null) {
fireEvent(new EdgeClickEvent(VizComponent.this, gedge,
mouseDetails));
}
}
开发者ID:pontusbostrom,项目名称:VaadinGraphvizComponent,代码行数:9,代码来源:VizComponent.java
示例17: onClick
import com.vaadin.shared.MouseEventDetails; //导入依赖的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
示例18: fireClick
import com.vaadin.shared.MouseEventDetails; //导入依赖的package包/类
@Override
protected void fireClick(MouseEventDetails details) {
try {
super.fireClick(details);
} finally {
if (getState(false).useResponsePending) {
getRpcProxy(CubaButtonClientRpc.class).onClickHandled();
}
}
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:11,代码来源:CubaButton.java
示例19: contextHelpIconClick
import com.vaadin.shared.MouseEventDetails; //导入依赖的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
示例20: setupRpc
import com.vaadin.shared.MouseEventDetails; //导入依赖的package包/类
private void setupRpc() {
registerRpc(new HtmlButtonRendererServerRpc() {
public void onClick(String rowKey, String columnId,
MouseEventDetails mouseDetails) {
fireEvent(new HtmlButtonRendererClickEvent(getParentGrid(),
getItemId(rowKey), getColumn(columnId), mouseDetails));
}
});
}
开发者ID:vaadin,项目名称:grid-renderers-collection-addon,代码行数:10,代码来源:HtmlButtonRenderer.java
注:本文中的com.vaadin.shared.MouseEventDetails类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论