本文整理汇总了Java中com.google.gwt.user.client.Event.BUTTON_RIGHT属性的典型用法代码示例。如果您正苦于以下问题:Java Event.BUTTON_RIGHT属性的具体用法?Java Event.BUTTON_RIGHT怎么用?Java Event.BUTTON_RIGHT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.gwt.user.client.Event
的用法示例。
在下文中一共展示了Event.BUTTON_RIGHT属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBrowserEvent
public void onBrowserEvent(Event event) {
int selectedRow = 0;
if (DOM.eventGetType(event) == Event.ONDBLCLICK || DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
Element td = getMouseEventTargetCell(event);
if (td == null) return;
Element tr = DOM.getParent(td);
Element body = DOM.getParent(tr);
selectedRow = DOM.getChildIndex(body, tr);
}
// Only if selectedRow >= 0, indicates a document row value and must apear menu or double click action
if (selectedRow >= 0) {
// When de button mouse is released
mouseX = DOM.eventGetClientX(event);
mouseY = DOM.eventGetClientY(event);
// On double click not sends event to onCellClicked across super.onBrowserEvent();
if (DOM.eventGetType(event) == Event.ONDBLCLICK) {
// Disables the event propagation the sequence is:
// Two time entry onCellClicked before entry on onBrowserEvent and disbles the
// Tree onCellClicked that produces inconsistence error refreshing
DOM.eventCancelBubble(event, true);
Main.get().mainPanel.search.historySearch.searchSaved.getSearch();
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
switch (DOM.eventGetButton(event)) {
case Event.BUTTON_RIGHT:
markSelectedRow(selectedRow);
Main.get().mainPanel.search.historySearch.searchSaved.showMenu();
DOM.eventPreventDefault(event); // Prevent to fire event to browser
break;
default:
break;
}
}
}
super.onBrowserEvent(event);
}
示例2: mouseButtons
/**
* @return A string describing which mouse buttons were pressed,
* e.g., " left"
*/
private static String mouseButtons(Event event) {
if (event.getButton() == -1) {
return "";
} else {
return ((event.getButton() & Event.BUTTON_LEFT) != 0 ? " left" : "")
+ ((event.getButton() & Event.BUTTON_MIDDLE) != 0 ? " middle" : "")
+ ((event.getButton() & Event.BUTTON_RIGHT) != 0 ? " right" : "");
}
}
示例3: onBrowserEvent
public void onBrowserEvent(Event event) {
int selectedRow = 0;
if (DOM.eventGetType(event) == Event.ONDBLCLICK || DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
Element td = getMouseEventTargetCell(event);
if (td == null) return;
Element tr = DOM.getParent(td);
Element body = DOM.getParent(tr);
selectedRow = DOM.getChildIndex(body, tr);
}
// Only if selectedRow >= 0, indicates a document row value and must apear menu or double click action
if (selectedRow >= 0) {
// When de button mouse is released
mouseX = DOM.eventGetClientX(event);
mouseY = DOM.eventGetClientY(event);
// On double click not sends event to onCellClicked across super.onBrowserEvent();
if (DOM.eventGetType(event) == Event.ONDBLCLICK) {
// Disables the event propagation the sequence is:
// Two time entry onCellClicked before entry on onBrowserEvent and disables the
// Tree onCellClicked that produces inconsistence error refreshing
DOM.eventCancelBubble(event, true);
MessagingToolBarBox.get().messageDashboard.messageStack.messageReceived.refreshMessagesReceived();
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
switch (DOM.eventGetButton(event)) {
case Event.BUTTON_RIGHT:
markSelectedRow(selectedRow);
MessagingToolBarBox.get().messageDashboard.messageStack.messageReceived.menuPopup.setPopupPosition(mouseX, mouseY);
MessagingToolBarBox.get().messageDashboard.messageStack.messageReceived.menuPopup.show();
DOM.eventPreventDefault(event); // Prevent to fire event to browser
break;
default:
break;
}
}
}
super.onBrowserEvent(event);
}
示例4: onBrowserEvent
public void onBrowserEvent(Event event) {
int selectedRow = 0;
if (DOM.eventGetType(event) == Event.ONDBLCLICK || DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
Element td = getMouseEventTargetCell(event);
if (td == null) return;
Element tr = DOM.getParent(td);
Element body = DOM.getParent(tr);
selectedRow = DOM.getChildIndex(body, tr);
}
// Only if selectedRow >= 0, indicates a document row value and must apear menu or double click action
if (selectedRow >= 0) {
// When de button mouse is released
mouseX = DOM.eventGetClientX(event);
mouseY = DOM.eventGetClientY(event);
// On double click not sends event to onCellClicked across super.onBrowserEvent();
if (DOM.eventGetType(event) == Event.ONDBLCLICK) {
// Disables the event propagation the sequence is:
// Two time entry onCellClicked before entry on onBrowserEvent and disables the
// Tree onCellClicked that produces inconsistence error refreshing
DOM.eventCancelBubble(event, true);
MessagingToolBarBox.get().messageDashboard.messageStack.messageSent.refreshMessagesSent();
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
switch (DOM.eventGetButton(event)) {
case Event.BUTTON_RIGHT:
markSelectedRow(selectedRow);
MessagingToolBarBox.get().messageDashboard.messageStack.messageSent.menuPopup.setPopupPosition(mouseX, mouseY);
MessagingToolBarBox.get().messageDashboard.messageStack.messageSent.menuPopup.show();
DOM.eventPreventDefault(event); // Prevent to fire event to browser
break;
default:
break;
}
}
}
super.onBrowserEvent(event);
}
示例5: onBrowserEvent
public void onBrowserEvent(Event event) {
int selectedRow = 0;
if (DOM.eventGetType(event) == Event.ONDBLCLICK || DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
Element td = getMouseEventTargetCell(event);
if (td == null) return;
Element tr = DOM.getParent(td);
Element body = DOM.getParent(tr);
selectedRow = DOM.getChildIndex(body, tr);
}
// Only if selectedRow >= 0, indicates a document row value and must apear menu or double click action
if (selectedRow >= 0) {
// When de button mouse is released
mouseX = DOM.eventGetClientX(event);
mouseY = DOM.eventGetClientY(event);
// On double click not sends event to onCellClicked across super.onBrowserEvent();
if (DOM.eventGetType(event) == Event.ONDBLCLICK) {
// Disables the event propagation the sequence is:
// Two time entry onCellClicked before entry on onBrowserEvent and disables the
// Tree onCellClicked that produces inconsistence error refreshing
DOM.eventCancelBubble(event, true);
MessagingToolBarBox.get().messageDashboard.messageStack.proposedQueryReceived.refreshProposedQueries();
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
switch (DOM.eventGetButton(event)) {
case Event.BUTTON_RIGHT:
markSelectedRow(selectedRow);
MessagingToolBarBox.get().messageDashboard.messageStack.proposedQueryReceived.menuPopup.setPopupPosition(mouseX, mouseY);
MessagingToolBarBox.get().messageDashboard.messageStack.proposedQueryReceived.menuPopup.show();
DOM.eventPreventDefault(event); // Prevent to fire event to browser
break;
default:
break;
}
}
}
super.onBrowserEvent(event);
}
示例6: onBrowserEvent
public void onBrowserEvent(Event event) {
int selectedRow = 0;
if (DOM.eventGetType(event) == Event.ONDBLCLICK || DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
Element td = getMouseEventTargetCell(event);
if (td == null) return;
Element tr = DOM.getParent(td);
Element body = DOM.getParent(tr);
selectedRow = DOM.getChildIndex(body, tr);
}
// Only if selectedRow >= 0, indicates a document row value and must apear menu or double click action
if (selectedRow >= 0) {
// When de button mouse is released
mouseX = DOM.eventGetClientX(event);
mouseY = DOM.eventGetClientY(event);
// On double click not sends event to onCellClicked across super.onBrowserEvent();
if (DOM.eventGetType(event) == Event.ONDBLCLICK) {
// Disables the event propagation the sequence is:
// Two time entry onCellClicked before entry on onBrowserEvent and disables the
// Tree onCellClicked that produces inconsistence error refreshing
DOM.eventCancelBubble(event, true);
MessagingToolBarBox.get().messageDashboard.messageStack.proposedSubscriptionReceived.refreshProposedSubscriptions();
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
switch (DOM.eventGetButton(event)) {
case Event.BUTTON_RIGHT:
markSelectedRow(selectedRow);
MessagingToolBarBox.get().messageDashboard.messageStack.proposedSubscriptionReceived.menuPopup.setPopupPosition(mouseX, mouseY);
MessagingToolBarBox.get().messageDashboard.messageStack.proposedSubscriptionReceived.menuPopup.show();
DOM.eventPreventDefault(event); // Prevent to fire event to browser
break;
default:
break;
}
}
}
super.onBrowserEvent(event);
}
示例7: onBrowserEvent
public void onBrowserEvent(Event event) {
boolean headerFired = false; // Controls when event is fired by header
// Case targe event is header must disable drag & drop
if (headerTable.getEventTargetCell(event) != null) {
headerFired = true;
}
// Selects the panel
setSelectedPanel(true);
// When de button mouse is released
mouseX = DOM.eventGetClientX(event);
mouseY = DOM.eventGetClientY(event);
// On double click not sends event to onCellClicked across super.onBrowserEvent();
if (DOM.eventGetType(event) == Event.ONDBLCLICK) {
// Disables the event propagation the sequence is:
// Two time entry onCellClicked before entry on onBrowserEvent and disbles the
// Tree onCellClicked that produces inconsistence error refreshing
DOM.eventCancelBubble(event, true);
if ((isDocumentSelected() || isAttachmentSelected()) && Main.get().workspaceUserProperties.getWorkspace().getAvailableOption().isDownloadOption()) {
Main.get().mainPanel.search.searchBrowser.searchResult.searchCompactResult.downloadDocument();
}
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
switch (DOM.eventGetButton(event)) {
case Event.BUTTON_RIGHT:
if (!headerFired) {
if (isDocumentSelected() || isAttachmentSelected()) {
Main.get().mainPanel.search.searchBrowser.searchResult.searchCompactResult.menuPopup.menu.checkMenuOptionPermissions(getDocument());
} else if (isFolderSelected()) {
Main.get().mainPanel.search.searchBrowser.searchResult.searchCompactResult.menuPopup.menu.checkMenuOptionPermissions(getFolder());
} else if (isMailSelected()) {
Main.get().mainPanel.search.searchBrowser.searchResult.searchCompactResult.menuPopup.menu.checkMenuOptionPermissions(getMail());
}
Main.get().mainPanel.search.searchBrowser.searchResult.searchCompactResult.menuPopup.menu.evaluateMenuOptions();
Main.get().mainPanel.search.searchBrowser.searchResult.searchCompactResult.showMenu();
DOM.eventPreventDefault(event); // Prevent to fire event to browser
}
break;
default:
break;
}
}
super.onBrowserEvent(event);
}
示例8: onBrowserEvent
public void onBrowserEvent(Event event) {
int selectedRow = 0;
if (DOM.eventGetType(event) == Event.ONDBLCLICK || DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
Element td = getMouseEventTargetCell(event);
if (td == null) return;
Element tr = DOM.getParent(td);
Element body = DOM.getParent(tr);
selectedRow = DOM.getChildIndex(body, tr);
}
// Only if selectedRow >= 0, indicates a document row value and must apear menu or double click action
if (selectedRow >= 0) {
// When de button mouse is released
mouseX = DOM.eventGetClientX(event);
mouseY = DOM.eventGetClientY(event);
// On double click not sends event to onCellClicked across super.onBrowserEvent();
if (DOM.eventGetType(event) == Event.ONDBLCLICK) {
// Disables the event propagation the sequence is:
// Two time entry onCellClicked before entry on onBrowserEvent and disbles the
// Tree onCellClicked that produces inconsistence error refreshing
DOM.eventCancelBubble(event, true);
Main.get().mainPanel.search.historySearch.userNews.getSearch();
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
switch (DOM.eventGetButton(event)) {
case Event.BUTTON_RIGHT:
markSelectedRow(selectedRow);
Main.get().mainPanel.search.historySearch.userNews.showMenu();
DOM.eventPreventDefault(event); // Prevent to fire event to browser
break;
default:
break;
}
}
}
super.onBrowserEvent(event);
}
示例9: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
// When de button mouse is released
if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
// When de button mouse is released
mouseX = DOM.eventGetClientX(event);
mouseY = DOM.eventGetClientY(event);
// remove dragable item
Main.get().draggable.clear();
switch (DOM.eventGetButton(event)) {
case Event.BUTTON_RIGHT:
DOM.eventPreventDefault(event); // Prevent to fire event to browser
flagPopup = true;
mouseDownX = 0;
mouseDownY = 0;
dragged = false;
Main.get().activeFolderTree.menuPopup.disableAllOptions();
fireSelection(elementClicked(DOM.eventGetTarget(event)));
break;
default:
flagPopup = false;
// dragging is enable only if cursor is inside actual item
dragged = isCursorInsideActualItem(elementClicked(DOM.eventGetTarget(event)));
mouseDownX = event.getScreenX();
mouseDownY = event.getClientY();
}
} else if (DOM.eventGetType(event) == Event.ONMOUSEMOVE) {
mouseX = DOM.eventGetClientX(event);
mouseY = DOM.eventGetClientY(event);
if (Main.get().activeFolderTree.canDrag() && dragged && mouseDownX > 0 && mouseDownY > 0
&& evalDragPixelSensibility()) {
TreeItem actualItem = Main.get().activeFolderTree.getActualItem();
Main.get().draggable.show(actualItem.getHTML(), OriginPanel.TREE_ROOT);
Main.get().activeFolderTree.fileBrowserRefreshDone();
mouseDownX = 0;
mouseDownY = 0;
dragged = false;
}
} else if (DOM.eventGetType(event) == Event.ONMOUSEUP || DOM.eventGetType(event) == Event.ONCLICK
|| DOM.eventGetType(event) == Event.ONDBLCLICK) {
mouseDownX = 0;
mouseDownY = 0;
dragged = false; // Always disabling the popup flag
}
// Prevent folder creation or renaming propagate actions to other tree nodes
int action = Main.get().activeFolderTree.getFolderAction();
if (action != FolderTree.ACTION_CREATE && action != FolderTree.ACTION_RENAME) {
super.onBrowserEvent(event);
}
}