当前位置: 首页>>代码示例>>Java>>正文


Java KeyboardListener类代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.KeyboardListener的典型用法代码示例。如果您正苦于以下问题:Java KeyboardListener类的具体用法?Java KeyboardListener怎么用?Java KeyboardListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


KeyboardListener类属于com.google.gwt.user.client.ui包,在下文中一共展示了KeyboardListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PageSizePagingToolBar

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
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()));
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:21,代码来源:PageSizePagingToolBar.java

示例2: onKeyUp

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
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;
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:26,代码来源:WgtScroll.java

示例3: onKeyPress

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
@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);
	}
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:11,代码来源:DataVisualPopPanel.java

示例4: addKeyboardListener

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
public void addKeyboardListener(KeyboardListener listener) {
	if (keyboardListeners == null) {
		keyboardListeners = new KeyboardListenerCollection();
		DOM.sinkEvents(getSubElementById("text"), Event.KEYEVENTS);
	}
	keyboardListeners.add(listener);
}
 
开发者ID:Orichievac,项目名称:FallenGalaxy,代码行数:8,代码来源:JSTextField.java

示例5: onKeyPress

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
@Override
public void onKeyPress(Widget sender, char key, int mods) {
	if (KeyboardListener.KEY_ENTER == key)
		submitBtn.click();
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:6,代码来源:JobDescPopupPanel.java

示例6: addKeyboardListener

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
public void addKeyboardListener(KeyboardListener listener) {
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:3,代码来源:CISingleValueWidget.java

示例7: addKeyboardListener

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
public void addKeyboardListener(KeyboardListener listener) {
	if (validate instanceof Validate) {
		((Validate)validate).addKeyboardListener(listener);
	}
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:6,代码来源:ValidateVerticalPanel.java

示例8: addKeyboardListener

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
public void addKeyboardListener(KeyboardListener listener) {
	// TODO Auto-generated method stub
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:4,代码来源:BaseFieldContainer.java

示例9: getKeyCode

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
@Override
public int getKeyCode() {
	return(KeyboardListener.KEY_ESCAPE);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:5,代码来源:KeyEscEvent.java

示例10: getKeyCode

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
@Override
public int getKeyCode() {
	return(KeyboardListener.KEY_ENTER);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:5,代码来源:KeyEnterEvent.java

示例11: onKeyDown

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
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;
  }
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:42,代码来源:WgtScroll.java

示例12: onMove

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
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;
    }
  }
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:69,代码来源:WgtScroll.java

示例13: removeKeyboardListener

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
public void removeKeyboardListener(KeyboardListener listener) {
	if (keyboardListeners != null) {
		keyboardListeners.remove(listener);
	}
}
 
开发者ID:Orichievac,项目名称:FallenGalaxy,代码行数:6,代码来源:JSTextField.java

示例14: addKeyboardListener

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
public void addKeyboardListener(KeyboardListener listener) {
    this.base.addKeyboardListener(listener);
}
 
开发者ID:kebernet,项目名称:gwittir,代码行数:4,代码来源:ListBox.java

示例15: removeKeyboardListener

import com.google.gwt.user.client.ui.KeyboardListener; //导入依赖的package包/类
public void removeKeyboardListener(final KeyboardListener listener) {
    this.base.removeKeyboardListener(listener);
}
 
开发者ID:kebernet,项目名称:gwittir,代码行数:4,代码来源:ListBox.java


注:本文中的com.google.gwt.user.client.ui.KeyboardListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。