Java Code Examples for com.google.gwt.event.dom.client.KeyUpEvent#stopPropagation()
The following examples show how to use
com.google.gwt.event.dom.client.KeyUpEvent#stopPropagation() .
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: CubaSearchSelectWidget.java From cuba with Apache License 2.0 | 5 votes |
@Override public void onKeyUp(KeyUpEvent event) { if (enabled && !readonly) { switch (event.getNativeKeyCode()) { case KeyCodes.KEY_ENTER: String tbText = tb.getText() == null ? "" : tb.getText(); String currentText = currentSuggestion == null ? "" : currentSuggestion.getReplacementString(); if (!this.preventFilterAfterSelect && !tbText.equals(currentText)) { filterOptions(currentPage); } else { if (!event.isAnyModifierKeyDown()) { event.stopPropagation(); } } this.preventFilterAfterSelect = false; break; case KeyCodes.KEY_TAB: case KeyCodes.KEY_SHIFT: case KeyCodes.KEY_CTRL: case KeyCodes.KEY_ALT: case KeyCodes.KEY_DOWN: case KeyCodes.KEY_UP: case KeyCodes.KEY_PAGEDOWN: case KeyCodes.KEY_PAGEUP: // NOP break; case KeyCodes.KEY_ESCAPE: reset(); break; } updateEditState(); } }
Example 2
Source File: CourseFinderMultipleCourses.java From unitime with Apache License 2.0 | 5 votes |
@Override public void onKeyUp(KeyUpEvent event) { if (iCourses.getRowCount() < 2 || iCourses.getData(1) == null) return; int row = iCourses.getSelectedRow(); if (event.getNativeKeyCode() == KeyCodes.KEY_DOWN && isEnabled()) { if (row < 0 || iCourses.getSelectedRow() + 1 >= iCourses.getRowCount()) iCourses.setSelected(1, true); else iCourses.setSelected(row + 1, true); scrollToSelectedRow(); updateCourseDetails(); } else if (event.getNativeKeyCode()==KeyCodes.KEY_UP && isEnabled()) { if (row - 1 < 1) iCourses.setSelected(iCourses.getRowCount() - 1, true); else iCourses.setSelected(row - 1, true); scrollToSelectedRow(); updateCourseDetails(); } else if (event.isControlKeyDown() || event.isAltKeyDown()) { for (Map.Entry<Character, Integer> entry: iTabAccessKeys.entrySet()) if (event.getNativeKeyCode() == Character.toLowerCase(entry.getKey()) || event.getNativeKeyCode() == Character.toUpperCase(entry.getKey())) { iCourseDetailsTabBar.selectTab(entry.getValue(), true); event.preventDefault(); event.stopPropagation(); } } }
Example 3
Source File: CourseFinderCourses.java From unitime with Apache License 2.0 | 5 votes |
@Override public void onKeyUp(KeyUpEvent event) { if (iCourses.getRowCount() < 2 || iCourses.getData(1) == null) return; int row = iCourses.getSelectedRow(); if (event.getNativeKeyCode() == KeyCodes.KEY_DOWN && isEnabled()) { if (row < 0 || iCourses.getSelectedRow() + 1 >= iCourses.getRowCount()) iCourses.setSelected(1, true); else iCourses.setSelected(row + 1, true); scrollToSelectedRow(); updateCourseDetails(); } else if (event.getNativeKeyCode()==KeyCodes.KEY_UP && isEnabled()) { if (row - 1 < 1) iCourses.setSelected(iCourses.getRowCount() - 1, true); else iCourses.setSelected(row - 1, true); scrollToSelectedRow(); updateCourseDetails(); } else if (event.isControlKeyDown() || event.isAltKeyDown()) { for (Map.Entry<Character, Integer> entry: iTabAccessKeys.entrySet()) if (event.getNativeKeyCode() == Character.toLowerCase(entry.getKey()) || event.getNativeKeyCode() == Character.toUpperCase(entry.getKey())) { iCourseDetailsTabBar.selectTab(entry.getValue(), true); event.preventDefault(); event.stopPropagation(); } } }
Example 4
Source File: AutoCompleteTextFieldConnector.java From hawkbit with Eclipse Public License 1.0 | 4 votes |
private void arrorKeyUp(final KeyUpEvent event) { select.moveSelectionUp(); event.preventDefault(); event.stopPropagation(); }
Example 5
Source File: AutoCompleteTextFieldConnector.java From hawkbit with Eclipse Public License 1.0 | 4 votes |
private void arrowKeyDown(final KeyUpEvent event) { select.moveSelectionDown(); event.preventDefault(); event.stopPropagation(); }