本文整理匯總了Java中com.google.gwt.user.client.Event.ONDBLCLICK屬性的典型用法代碼示例。如果您正苦於以下問題:Java Event.ONDBLCLICK屬性的具體用法?Java Event.ONDBLCLICK怎麽用?Java Event.ONDBLCLICK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.google.gwt.user.client.Event
的用法示例。
在下文中一共展示了Event.ONDBLCLICK屬性的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onBrowserEvent
public void onBrowserEvent(Event event) {
int selectedRow = 0;
if (DOM.eventGetType(event) == Event.ONDBLCLICK) {
Element td = getMouseEventTargetCell(event);
if (td == null) return;
Element tr = DOM.getParent(td);
Element body = DOM.getParent(tr);
selectedRow = DOM.getChildIndex(body, tr);
if (selectedRow >= 0) {
markSelectedRow(selectedRow);
Main.get().onlineUsersPopup.enableAcceptButton();
DOM.eventCancelBubble(event, true);
Main.get().onlineUsersPopup.executeAction();
}
}
super.onBrowserEvent(event);
}
示例2: prepareToFireClick
@Override
protected void prepareToFireClick(int eventType) {
if (eventType == Event.ONDBLCLICK && doubleClickHandling) {
if (selectable) {
CubaTreeWidget.this.deselectAll();
TreeNode targetNode = getNodeByKey(key);
targetNode.setFocused(true);
targetNode.setSelected(true);
selectedIds.add(targetNode.key);
client.updateVariable(paintableId, "selected",
selectedIds.toArray(new String[selectedIds.size()]),
false);
selectionHasChanged = false;
}
}
}
示例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 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);
}
示例4: isNeedToSendDoubleClick
@Override
protected boolean isNeedToSendDoubleClick(int eventType, boolean sendClickEventNow) {
if (eventType != Event.ONDBLCLICK || !doubleClickMode) {
return super.isNeedToSendDoubleClick(eventType, sendClickEventNow);
} else {
return doubleClickHandling;
}
}
示例5: asString
public static String asString(Event event) {
// Start with the event type string
String string = DOM.eventGetTypeString(event);
// Next type-specific fields
switch (event.getTypeInt()) {
case Event.ONKEYPRESS:
case Event.ONKEYUP:
case Event.ONKEYDOWN:
string += key(event) + modifiers(event);
break;
case Event.ONCLICK:
case Event.ONDBLCLICK:
case Event.ONMOUSEMOVE:
string += mousePoint(event) + modifiers(event);
break;
case Event.ONMOUSEDOWN:
case Event.ONMOUSEUP:
string += mousePoint(event) + mouseButtons(event) + modifiers(event);
break;
case Event.ONMOUSEOUT:
string += mousePoint(event) + modifiers(event) + " to: " + getToElement(event);
break;
case Event.ONMOUSEOVER:
string += mousePoint(event) + modifiers(event) + " from: " + getFromElement(event);
break;
case Event.ONMOUSEWHEEL:
string += " " + getMouseWheelVelocityY(event) + mousePoint(event) + modifiers(event);
break;
case Event.ONFOCUS:
case Event.ONBLUR:
case Event.ONCHANGE:
case Event.ONERROR:
case Event.ONLOAD:
case Event.ONLOSECAPTURE:
case Event.ONSCROLL:
break;
}
return string;
}
示例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.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);
}
示例7: 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);
}
示例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 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);
}
示例9: 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);
}
示例10: 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);
}
示例11: 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);
}
示例12: 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);
}
}
示例13: onBrowserEvent
@Override
public void onBrowserEvent(final Event event) {
boolean bubble = true;
final int type = event.getTypeInt();
final Element target = DOM.eventGetTarget(event);
if (resizing || resizeBox == target) {
onResizeEvent(event);
bubble = false;
} else if (isClosable() && target == closeBox) {
if (type == Event.ONCLICK) {
closeWindow();
}
bubble = false;
} else if (header.isOrHasChild(target) && !dragging) {
// dblclick handled in connector
if (type != Event.ONDBLCLICK && draggable) {
if (type == Event.ONMOUSEDOWN) {
/*
* Prevents accidental selection of window caption or
* content. (#12726)
*/
event.preventDefault();
headerDragPending = event;
} else if (type == Event.ONMOUSEMOVE
&& headerDragPending != null) {
// ie won't work unless this is set here
dragging = true;
onDragEvent(headerDragPending);
onDragEvent(event);
headerDragPending = null;
} else {
headerDragPending = null;
}
bubble = false;
}
} else if (dragging || !contents.isOrHasChild(target)) {
onDragEvent(event);
bubble = false;
}
/*
* If clicking on other than the content, move focus to the window.
* After that this windows e.g. gets all keyboard shortcuts.
*/
if (type == Event.ONMOUSEDOWN
&& !contentPanel.getElement().isOrHasChild(target)
&& target != closeBox) {
contentPanel.focus();
}
if (!bubble) {
event.stopPropagation();
} else {
// Super.onBrowserEvent takes care of Handlers added by the
// ClickEventHandler
super.onBrowserEvent(event);
}
}
示例14: fireClick
@Override
protected void fireClick(Event evt) {
doubleClickHandling = doubleClickMode && DOM.eventGetType(evt) == Event.ONDBLCLICK;
super.fireClick(evt);
}