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


Java KeyDownEvent.getSource方法代码示例

本文整理汇总了Java中com.google.gwt.event.dom.client.KeyDownEvent.getSource方法的典型用法代码示例。如果您正苦于以下问题:Java KeyDownEvent.getSource方法的具体用法?Java KeyDownEvent.getSource怎么用?Java KeyDownEvent.getSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.event.dom.client.KeyDownEvent的用法示例。


在下文中一共展示了KeyDownEvent.getSource方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSuggestionHandler

import com.google.gwt.event.dom.client.KeyDownEvent; //导入方法依赖的package包/类
public static KeyDownHandler createSuggestionHandler(final UIObject sender, final EventListenerGVO ev, final List<InputVariableGVO> input) {
	return new KeyDownHandler() {
		public void onKeyDown(KeyDownEvent event) {
			if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
				if (event.getSource() instanceof QSuggestBox) {
					QSuggestBox qSuggestBox = (QSuggestBox) event.getSource();
					String expression = qSuggestBox.getText();
					if (expression != null) {
						if (expression.length() >= qSuggestBox.getSuggestCharactersLength()) {
							qSuggestBox.clearSuggestions();
							CallbackHandler.createCallBack(sender, QAMLConstants.EVENT_ONCHANGE, ev, input);
						}
					}
				}
			}
		}
	};
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:19,代码来源:EventFactory.java

示例2: onKeyDown

import com.google.gwt.event.dom.client.KeyDownEvent; //导入方法依赖的package包/类
public void onKeyDown(KeyDownEvent event) {
	if (((SpreadsheetCell) event.getSource()).getMode() == SpreadsheetCell.DISPLAY) {
		switch (event.getNativeKeyCode()) {
		case KeyCodes.KEY_LEFT:
			if (event.getSource() == west) {
				west.setFocus(false);
			} else {
				west.setFocus(true);
			}
			break;
		case KeyCodes.KEY_RIGHT:
			if (event.getSource() == east) {
				east.setFocus(false);
			} else {
				east.setFocus(true);
			}
			break;
		default:
			;
		}
	}
	
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:24,代码来源:Spreadsheet.java

示例3: createKeyEnterHandler

import com.google.gwt.event.dom.client.KeyDownEvent; //导入方法依赖的package包/类
private static KeyDownHandler createKeyEnterHandler(final ComponentGVO componentGVO, final EventListenerGVO eventGVO, final NotifyHandler notifyHandler, final String windowId, final String context, final AbstractActivity activity) {
	return new KeyDownHandler() {
		@Override
		public void onKeyDown(KeyDownEvent event) {
			if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
				UIObject widget = (UIObject)event.getSource();
				List<InputVariableGVO> inputVariables = eventGVO.getInputvariablesList();
				handleEvent(componentGVO, widget, eventGVO, event, QAMLConstants.EVENT_ONENTER, inputVariables, notifyHandler, windowId, context, activity);
			}
		}
	};
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:13,代码来源:ActivityHelper.java

示例4: onKeyDown

import com.google.gwt.event.dom.client.KeyDownEvent; //导入方法依赖的package包/类
@Override
public void onKeyDown(KeyDownEvent event) {
  final Object sender = event.getSource();
  if (sender == textBoxQuery || sender == textBoxCreator) {
    if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
      search();
    }
  }
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:10,代码来源:PanelSearchProblem.java

示例5: onKeyDown

import com.google.gwt.event.dom.client.KeyDownEvent; //导入方法依赖的package包/类
@Override
public void onKeyDown(KeyDownEvent event) {
  if (event.getSource() == textBoxBody) {
    if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
      sendMessage();
    }
  }
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:9,代码来源:PanelRealtime.java

示例6: onKeyDown

import com.google.gwt.event.dom.client.KeyDownEvent; //导入方法依赖的package包/类
public void onKeyDown(KeyDownEvent event) {
    int keycode = event.getNativeKeyCode();
    // Catch tab and move between select:s
    if (keycode == KeyCodes.KEY_TAB && event.getSource() == options
            && !event.isShiftKeyDown()) {
        // Prevent default behavior
        event.preventDefault();
        // Remove current selections
        clearSelections(options, true);
        // Focus selections
        selections.setFocus(true);
    }

    if (keycode == KeyCodes.KEY_TAB && event.isShiftKeyDown()
            && event.getSource() == selections) {
        // Prevent default behavior
        event.preventDefault();
        // Remove current selections
        clearSelections(selections, true);
        // Focus options
        options.setFocus(true);
    }

    if (keycode == getNavigationSelectKey()) {
        // Prevent default behavior
        event.preventDefault();
        // Decide which select the selection was made in
        if (event.getSource() == options) {
            // Prevents the selection to become a single selection when
            // using Enter key as the selection key (default)
            options.setFocus(false);
            addItem();
        } else if (event.getSource() == selections) {
            // Prevents the selection to become a single selection when
            // using Enter key as the selection key (default)
            selections.setFocus(false);
            removeItem();
        }
    }
}
 
开发者ID:tepi,项目名称:ListBuilder,代码行数:41,代码来源:VListBuilder.java

示例7: onKeyDown

import com.google.gwt.event.dom.client.KeyDownEvent; //导入方法依赖的package包/类
@Override
public void onKeyDown(KeyDownEvent event) {
	int keycode = event.getNativeKeyCode();

	// Catch tab and move between select:s
	if (keycode == KeyCodes.KEY_TAB && event.getSource() == optionsListBox) {
		// Prevent default behavior
		event.preventDefault();

		// Remove current selections
		for (int i = 0; i < optionsListBox.getItemCount(); i++) {
			optionsListBox.setItemSelected(i, false);
		}

		// Focus selections
		selectionsListBox.setFocus(true);
	}

	if (keycode == KeyCodes.KEY_TAB && event.isShiftKeyDown() && event.getSource() == selectionsListBox) {
		// Prevent default behavior
		event.preventDefault();

		// Remove current selections
		for (int i = 0; i < selectionsListBox.getItemCount(); i++) {
			selectionsListBox.setItemSelected(i, false);
		}

		// Focus options
		optionsListBox.setFocus(true);
	}

	if (keycode == getNavigationSelectKey()) {
		// Prevent default behavior
		event.preventDefault();

		// Decide which select the selection was made in
		if (event.getSource() == optionsListBox) {
			// Prevents the selection to become a single selection when
			// using Enter key
			// as the selection key (default)
			optionsListBox.setFocus(false);

			moveSelectedItemsLeftToRight();

		} else if (event.getSource() == selectionsListBox) {
			// Prevents the selection to become a single selection when
			// using Enter key
			// as the selection key (default)
			selectionsListBox.setFocus(false);

			moveSelectedItemsRightToLeft();
		}
	}

}
 
开发者ID:tepi,项目名称:ListBuilder,代码行数:56,代码来源:VListBuilder.java


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