Java Code Examples for com.google.gwt.user.client.DOM#eventCancelBubble()

The following examples show how to use com.google.gwt.user.client.DOM#eventCancelBubble() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExtendedFlexTable.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
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);
}
 
Example 2
Source File: ExtendedFlexTable.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 3
Source File: CubaGroupTableWidget.java    From cuba with Apache License 2.0 5 votes vote down vote up
protected void handleRowClick(Event event) {
    if (expanded) {
        client.updateVariable(paintableId, "collapse", getGroupKey(), true);
    } else {
        client.updateVariable(paintableId, "expand", getGroupKey(), true);
    }

    DOM.eventCancelBubble(event, true);
}
 
Example 4
Source File: CubaGroupBoxWidget.java    From cuba with Apache License 2.0 5 votes vote down vote up
protected void toggleExpanded(Event event) {
    setExpanded(!expanded);

    if (collapsable && expandHandler != null) {
        expandHandler.expandStateChanged(expanded);
    }
    DOM.eventCancelBubble(event, true);
}
 
Example 5
Source File: MockComponent.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
private static void cancelBrowserEvent(Event event) {
  DOM.eventPreventDefault(event);
  DOM.eventCancelBubble(event, true);
}
 
Example 6
Source File: ExtendedFlexTable.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 7
Source File: ExtendedFlexTable.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 8
Source File: ExtendedFlexTable.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 9
Source File: ExtendedFlexTable.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 10
Source File: ExtendedScrollTable.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 11
Source File: ExtendedFlexTable.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 12
Source File: CubaGroupTableWidget.java    From cuba with Apache License 2.0 4 votes vote down vote up
protected void handleRowCtrlClick(Event event) {
    client.updateVariable(paintableId, "expandAllInGroup", getGroupKey(), true);
    DOM.eventCancelBubble(event, true);
}