public PageSizePagingToolBar(int pageSize) { super(pageSize); add(new SeparatorToolItem()); pageSizeField = new TextField<String>(); pageSizeField.setWidth(30); pageSizeField.setValue("" + pageSize); pageSizeField.addKeyListener(new KeyListener() { @Override public void componentKeyUp(ComponentEvent event) { if (event.getKeyCode() == KeyboardListener.KEY_ENTER) { refresh(); } } }); add(new AdapterToolItem(pageSizeField)); add(new AdapterToolItem(new LabelField("Page Size"))); //add(new AdapterToolItem(getSecurityGroupCombo())); }
private boolean onKeyUp(int p_keyCode) { boolean stopScroll = false; switch( p_keyCode ) { case KeyboardListener.KEY_DOWN: case KeyboardListener.KEY_UP: m_keyDragingY = 0; stopScroll = true; break; case KeyboardListener.KEY_LEFT: case KeyboardListener.KEY_RIGHT: m_keyDragingX = 0; stopScroll = true; break; default: return true; } if( (stopScroll == true) && (m_keyDragingX == 0) && (m_keyDragingY == 0) ) { fireScroll(); } // cancel event return false; }
@Override public void onKeyPress(Widget sender, char key, int mods) { if (KeyboardListener.KEY_ENTER == key) { if(!DataTools.isPosInteger(bins.getText())) Window.alert("Bin size should be a positive integer, please fill again!"); else drawBarCharts(selectedColumn); } }
public void addKeyboardListener(KeyboardListener listener) { if (keyboardListeners == null) { keyboardListeners = new KeyboardListenerCollection(); DOM.sinkEvents(getSubElementById("text"), Event.KEYEVENTS); } keyboardListeners.add(listener); }
@Override public void onKeyPress(Widget sender, char key, int mods) { if (KeyboardListener.KEY_ENTER == key) submitBtn.click(); }
public void addKeyboardListener(KeyboardListener listener) { }
public void addKeyboardListener(KeyboardListener listener) { if (validate instanceof Validate) { ((Validate)validate).addKeyboardListener(listener); } }
public void addKeyboardListener(KeyboardListener listener) { // TODO Auto-generated method stub }
@Override public int getKeyCode() { return(KeyboardListener.KEY_ESCAPE); }
@Override public int getKeyCode() { return(KeyboardListener.KEY_ENTER); }
private boolean onKeyDown(int p_keyCode) { switch( p_keyCode ) { case KeyboardListener.KEY_DOWN: if( m_keyDragingY != m_keyDraggingStep ) { m_keyDragingY = m_keyDraggingStep; m_keyDraggingTimer.cancel(); m_keyDraggingTimer.schedule( 1 ); } return false; case KeyboardListener.KEY_UP: if( m_keyDragingY != -1 * m_keyDraggingStep ) { m_keyDragingY = -1 * m_keyDraggingStep; m_keyDraggingTimer.cancel(); m_keyDraggingTimer.schedule( 1 ); } return false; case KeyboardListener.KEY_LEFT: if( m_keyDragingX != -1 * m_keyDraggingStep ) { m_keyDragingX = -1 * m_keyDraggingStep; m_keyDraggingTimer.cancel(); m_keyDraggingTimer.schedule( 1 ); } return false; case KeyboardListener.KEY_RIGHT: if( m_keyDragingX != m_keyDraggingStep ) { m_keyDragingX = m_keyDraggingStep; m_keyDraggingTimer.cancel(); m_keyDraggingTimer.schedule( 1 ); } // cancel event return false; default: return true; } }
public void onMove(Element p_sender, int p_x, int p_y) { int scrollX = m_lastMouseX - p_x; int scrollY = m_lastMouseY - p_y; if( (m_isMouseDown) && (!m_isMouseDraging) ) { if( (Math.abs( scrollX ) > m_mouseSensitivity) || Math.abs( scrollY ) > m_mouseSensitivity ) { m_isMouseDraging = true; m_maskPanel.setPixelSize( m_contentWidget.getOffsetWidth(), m_contentWidget .getOffsetHeight() ); m_maskPanel.setVisible( true ); } } else if( m_isMouseDraging ) { setScrollPositionSilent( getHorizontalScrollPosition() + scrollX, getVerticalScrollPosition() + scrollY ); m_lastMouseX = p_x; m_lastMouseY = p_y; } else { int mouseScrollingKey = 0; if( p_x > getOffsetWidth() - m_mouseArrowSpaceEast ) { AbstractImagePrototype.create( Icons.s_instance.arrow_e() ).applyTo( m_mouseScrollingImage ); m_absPanel.setWidgetPosition( m_mouseScrollingImage, getOffsetWidth() - m_mouseScrollingImage.getWidth(), p_y - m_mouseScrollingImage.getHeight() / 2 ); m_mouseScrollingImage.setVisible( true ); mouseScrollingKey = KeyboardListener.KEY_RIGHT; } else if( p_x < m_mouseArrowSpaceWest ) { AbstractImagePrototype.create( Icons.s_instance.arrow_w() ).applyTo( m_mouseScrollingImage ); m_absPanel.setWidgetPosition( m_mouseScrollingImage, 0, p_y - m_mouseScrollingImage.getHeight() / 2 ); m_mouseScrollingImage.setVisible( true ); mouseScrollingKey = KeyboardListener.KEY_LEFT; } else if( p_y > getOffsetHeight() - m_mouseArrowSpaceSouth ) { AbstractImagePrototype.create( Icons.s_instance.arrow_s() ).applyTo( m_mouseScrollingImage ); m_absPanel.setWidgetPosition( m_mouseScrollingImage, p_x - m_mouseScrollingImage.getWidth() / 2, getOffsetHeight() - m_mouseScrollingImage.getHeight() ); m_mouseScrollingImage.setVisible( true ); mouseScrollingKey = KeyboardListener.KEY_DOWN; } else if( p_y < m_mouseArrowSpaceNorth ) { AbstractImagePrototype.create( Icons.s_instance.arrow_n() ).applyTo( m_mouseScrollingImage ); m_absPanel.setWidgetPosition( m_mouseScrollingImage, p_x - m_mouseScrollingImage.getWidth() / 2, 0 ); m_mouseScrollingImage.setVisible( true ); mouseScrollingKey = KeyboardListener.KEY_UP; } else if( m_mouseScrollingKey != 0 ) { m_mouseScrollingImage.setVisible( false ); m_mouseScrollingKey = 0; } DOM.setStyleAttribute( m_mouseScrollingImage.getElement(), "zIndex", "9999" ); if( (mouseScrollingKey != 0) && (m_keyDragingX == 0) && (m_keyDragingY == 0) ) { m_mouseScrollingKey = mouseScrollingKey; } } }
public void removeKeyboardListener(KeyboardListener listener) { if (keyboardListeners != null) { keyboardListeners.remove(listener); } }
public void addKeyboardListener(KeyboardListener listener) { this.base.addKeyboardListener(listener); }
public void removeKeyboardListener(final KeyboardListener listener) { this.base.removeKeyboardListener(listener); }
public void removeKeyboardListener(KeyboardListener listener) { this.base.removeKeyboardListener(listener); }
public void addKeyboardListener(KeyboardListener listener) { this.softBase.addKeyboardListener(listener); }
public void removeKeyboardListener(KeyboardListener listener) { this.softBase.removeKeyboardListener(listener); }
public void addKeyboardListener(KeyboardListener listener) { this.fp.addKeyboardListener(listener ); }