Java 类com.google.gwt.user.client.ui.KeyboardListener 实例源码

项目:onecmdb    文件:PageSizePagingToolBar.java   
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()));
}
项目:fullmetalgalaxy    文件:WgtScroll.java   
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;
}
项目:OneCMDBwithMaven    文件:PageSizePagingToolBar.java   
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()));
}
项目:EasyML    文件:DataVisualPopPanel.java   
@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);
    }
}
项目:FallenGalaxy    文件:JSTextField.java   
public void addKeyboardListener(KeyboardListener listener) {
    if (keyboardListeners == null) {
        keyboardListeners = new KeyboardListenerCollection();
        DOM.sinkEvents(getSubElementById("text"), Event.KEYEVENTS);
    }
    keyboardListeners.add(listener);
}
项目:EasyML    文件:JobDescPopupPanel.java   
@Override
public void onKeyPress(Widget sender, char key, int mods) {
    if (KeyboardListener.KEY_ENTER == key)
        submitBtn.click();
}
项目:onecmdb    文件:CISingleValueWidget.java   
public void addKeyboardListener(KeyboardListener listener) {
}
项目:onecmdb    文件:ValidateVerticalPanel.java   
public void addKeyboardListener(KeyboardListener listener) {
    if (validate instanceof Validate) {
        ((Validate)validate).addKeyboardListener(listener);
    }
}
项目:onecmdb    文件:CIMultiValueWidget.java   
public void addKeyboardListener(KeyboardListener listener) {
}
项目:onecmdb    文件:ValidateHorizontalPanel.java   
public void addKeyboardListener(KeyboardListener listener) {
    if (validate instanceof Validate) {
        ((Validate)validate).addKeyboardListener(listener);
    }
}
项目:onecmdb    文件:BaseFieldContainer.java   
public void addKeyboardListener(KeyboardListener listener) {
    // TODO Auto-generated method stub
}
项目:onecmdb    文件:NewTextListFieldWidget.java   
public void addKeyboardListener(KeyboardListener listener) {
}
项目:onecmdb    文件:NewURIFieldWidget.java   
public void addKeyboardListener(KeyboardListener listener) {
}
项目:onecmdb    文件:NewCheckboxFiledWidget.java   
public void addKeyboardListener(KeyboardListener listener) {
}
项目:onecmdb    文件:NewSuggestTestField.java   
public void addKeyboardListener(KeyboardListener listener) {
}
项目:onecmdb    文件:KeyEscEvent.java   
@Override
public int getKeyCode() {
    return(KeyboardListener.KEY_ESCAPE);
}
项目:onecmdb    文件:KeyEnterEvent.java   
@Override
public int getKeyCode() {
    return(KeyboardListener.KEY_ENTER);
}
项目:onecmdb    文件:MultiEnterFieldEvent.java   
@Override
public int getKeyCode() {
    return(KeyboardListener.KEY_ENTER);
}
项目:fullmetalgalaxy    文件:WgtScroll.java   
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;
  }
}
项目:fullmetalgalaxy    文件:WgtScroll.java   
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;
    }
  }
}
项目:OneCMDBwithMaven    文件:CISingleValueWidget.java   
public void addKeyboardListener(KeyboardListener listener) {
}
项目:OneCMDBwithMaven    文件:ValidateVerticalPanel.java   
public void addKeyboardListener(KeyboardListener listener) {
    if (validate instanceof Validate) {
        ((Validate)validate).addKeyboardListener(listener);
    }
}
项目:OneCMDBwithMaven    文件:CIMultiValueWidget.java   
public void addKeyboardListener(KeyboardListener listener) {
}
项目:OneCMDBwithMaven    文件:ValidateHorizontalPanel.java   
public void addKeyboardListener(KeyboardListener listener) {
    if (validate instanceof Validate) {
        ((Validate)validate).addKeyboardListener(listener);
    }
}
项目:OneCMDBwithMaven    文件:BaseFieldContainer.java   
public void addKeyboardListener(KeyboardListener listener) {
    // TODO Auto-generated method stub
}
项目:OneCMDBwithMaven    文件:NewTextListFieldWidget.java   
public void addKeyboardListener(KeyboardListener listener) {
}
项目:OneCMDBwithMaven    文件:NewURIFieldWidget.java   
public void addKeyboardListener(KeyboardListener listener) {
}
项目:OneCMDBwithMaven    文件:NewCheckboxFiledWidget.java   
public void addKeyboardListener(KeyboardListener listener) {
}
项目:OneCMDBwithMaven    文件:NewSuggestTestField.java   
public void addKeyboardListener(KeyboardListener listener) {
}
项目:OneCMDBwithMaven    文件:KeyEscEvent.java   
@Override
public int getKeyCode() {
    return(KeyboardListener.KEY_ESCAPE);
}
项目:OneCMDBwithMaven    文件:KeyEnterEvent.java   
@Override
public int getKeyCode() {
    return(KeyboardListener.KEY_ENTER);
}
项目:OneCMDBwithMaven    文件:MultiEnterFieldEvent.java   
@Override
public int getKeyCode() {
    return(KeyboardListener.KEY_ENTER);
}
项目:FallenGalaxy    文件:JSTextField.java   
public void removeKeyboardListener(KeyboardListener listener) {
    if (keyboardListeners != null) {
        keyboardListeners.remove(listener);
    }
}
项目:gwittir    文件:ListBox.java   
public void addKeyboardListener(KeyboardListener listener) {
    this.base.addKeyboardListener(listener);
}
项目:gwittir    文件:ListBox.java   
public void removeKeyboardListener(final KeyboardListener listener) {
    this.base.removeKeyboardListener(listener);
}
项目:gwittir    文件:Button.java   
public void addKeyboardListener(KeyboardListener listener) {
    this.base.addKeyboardListener(listener);
}
项目:gwittir    文件:Button.java   
public void removeKeyboardListener(KeyboardListener listener) {
    this.base.removeKeyboardListener(listener);
}
项目:gwittir    文件:SoftButton.java   
public void addKeyboardListener(KeyboardListener listener) {
    this.softBase.addKeyboardListener(listener);
}
项目:gwittir    文件:SoftButton.java   
public void removeKeyboardListener(KeyboardListener listener) {
    this.softBase.removeKeyboardListener(listener);
}
项目:gwittir    文件:PopupDatePicker.java   
public void addKeyboardListener(KeyboardListener listener) {
    this.fp.addKeyboardListener(listener );
}