本文整理汇总了Java中com.google.gwt.event.dom.client.KeyUpHandler类的典型用法代码示例。如果您正苦于以下问题:Java KeyUpHandler类的具体用法?Java KeyUpHandler怎么用?Java KeyUpHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
KeyUpHandler类属于com.google.gwt.event.dom.client包,在下文中一共展示了KeyUpHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postConstruct
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
/**
* Called after construction.
*/
@PostConstruct
protected void postConstruct() {
servicesPanel.add(serviceFlowListWidget);
String filterTxt = (String)stateService.get(ApplicationStateKeys.SERVICES_LIBRARY_FILTER_TEXT);
filterServicesTextBox.setText(filterTxt);
filterServicesTextBox.addKeyUpHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent event) {
stateService.put(ApplicationStateKeys.SERVICES_LIBRARY_FILTER_TEXT, filterServicesTextBox.getText());
// Update status
populateGrid(currentServices);
}
});
// Tooltips
createServiceButton.setTitle(i18n.format("dslibrary.createServiceButton.tooltip"));
manageSourcesButton.setTitle(i18n.format("dslibrary.manageSourcesButton.tooltip"));
}
示例2: getInstance
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
public static AriaStatus getInstance() {
if (sStatus == null) {
RootPanel statusPanel = RootPanel.get("UniTimeGWT:AriaStatus");
if (statusPanel != null && "1".equals(Window.Location.getParameter("aria"))) {
sStatus = new AriaStatus(statusPanel.getElement(), false);
sStatus.setStyleName("unitime-VisibleAriaStatus");
} else {
sStatus = new AriaStatus(false);
RootPanel.get().add(sStatus);
}
RootPanel.get().addDomHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent event) {
if (event.getNativeEvent().getKeyCode() == 191 && (event.isControlKeyDown() || event.isAltKeyDown())) {
sStatus.setHTML(sStatus.getHTML());
}
}
}, KeyUpEvent.getType());
}
return sStatus;
}
示例3: setEscapeHandler
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
private KeyUpHandler setEscapeHandler() {
KeyUpHandler handler = new KeyUpHandler() {
@Override
public void onKeyUp(final KeyUpEvent event) {
if (KeyCodes.KEY_ESCAPE == event.getNativeEvent().getKeyCode()) {
for (Control control : controls) {
try {
((DrawFeature) control).cancel();
} catch (Exception e) {
LOGGER.error("ACTION CANCELED: "
+ control.getControlId());
}
}
}
}
};
return handler;
}
示例4: setUndoHandler
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
private KeyUpHandler setUndoHandler() {
final KeyUpHandler handler = new KeyUpHandler() {
@Override
public void onKeyUp(final KeyUpEvent event) {
if (KeyCodes.KEY_U == event.getNativeEvent().getKeyCode()) {
for (final Control control : controls) {
try {
((DrawFeature) control).undo();
} catch (Exception e) {
LOGGER.error(
"ACTION UNDO: " + control.getControlId(), e);
}
}
}
}
};
return handler;
}
示例5: setRedoHandler
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
private KeyUpHandler setRedoHandler() {
final KeyUpHandler handler = new KeyUpHandler() {
@Override
public void onKeyUp(final KeyUpEvent event) {
if (KeyCodes.KEY_R == event.getNativeEvent().getKeyCode()) {
for (final Control control : controls) {
try {
((DrawFeature) control).redo();
} catch (Exception e) {
LOGGER.error("ACTION REDO: "
+ control.getControlId());
}
}
}
}
};
return handler;
}
示例6: extend
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
@Override
protected void extend(final ServerConnector target) {
textFieldWidget = (VTextField) ((ComponentConnector) target).getWidget();
textFieldWidget.setImmediate(true);
textFieldWidget.textChangeEventMode = "EAGER";
panel.setWidget(select);
panel.setStyleName("suggestion-popup");
panel.setOwner(textFieldWidget);
textFieldWidget.addKeyUpHandler(new KeyUpHandler() {
@Override
public void onKeyUp(final KeyUpEvent event) {
if (panel.isAttached()) {
handlePanelEventDelegation(event);
} else if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
rpc.executeQuery(textFieldWidget.getValue(), textFieldWidget.getCursorPos());
} else {
doAskForSuggestion();
}
}
});
}
示例7: OwnTextArea
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
public OwnTextArea() {
super();
sinkEvents(Event.ONPASTE);
addKeyUpHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent event) {
fireHandler();
}
});
}
示例8: setKeyReleased
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
public void setKeyReleased(JavaScriptObject aValue) {
if (keyReleased != aValue) {
if (keyUpReg != null) {
keyUpReg.removeHandler();
keyUpReg = null;
}
keyReleased = aValue;
if (keyReleased != null && component instanceof HasKeyUpHandlers) {
keyUpReg = ((HasKeyUpHandlers) component).addKeyUpHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent event) {
if (keyReleased != null) {
event.stopPropagation();
executeEvent(keyReleased, EventsPublisher.publish(event));
}
}
});
}
}
}
示例9: createSuggestionOnKeyUpHandler
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
public static KeyUpHandler createSuggestionOnKeyUpHandler(final UIObject sender, final EventListenerGVO ev, final List<InputVariableGVO> input) {
return new KeyUpHandler() {
public void onKeyUp(KeyUpEvent event) {
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);
}
}
}
}
};
}
示例10: BeanValidationInitializer
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
/**
* constructor.
*
* @param pcommitOnReturnHandler commit on return handler
* @param pvalidateOnKeyUpHandler on key up handler
* @param pvalidateOnVueChangeHandler on vue change handler
* @param pvalueChangeHandler value change handler
* @param pcheckTime enumeration which describes when to do the check
* @param psubmitOnReturn submit form if return is pressed in a input field
*/
public BeanValidationInitializer(final KeyPressHandler pcommitOnReturnHandler,
final KeyUpHandler pvalidateOnKeyUpHandler,
final ValueChangeHandler<?> pvalidateOnVueChangeHandler,
final ValueChangeHandler<?> pvalueChangeHandler, final CheckTimeEnum pcheckTime,
final boolean psubmitOnReturn) {
super();
this.commitOnReturnHandler = psubmitOnReturn ? pcommitOnReturnHandler : null;
this.validateOnKeyUpHandler =
pcheckTime == CheckTimeEnum.ON_KEY_UP ? pvalidateOnKeyUpHandler : null;
this.validateOnVueChangeHandler =
pcheckTime == CheckTimeEnum.ON_CHANGE || pcheckTime == CheckTimeEnum.ON_KEY_UP
? pvalidateOnVueChangeHandler
: null;
this.valueChangeHandler = pvalueChangeHandler;
this.checkTime = pcheckTime;
}
示例11: asWidget
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
public Widget asWidget() {
Widget layout = UI_BINDER.createAndBindUi(this);
// Create the MapPresenter and add an InitializationHandler:
mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
mapPresenter.setSize(480, 480);
// Define the whole layout:
DecoratorPanel mapDecorator = new DecoratorPanel();
mapDecorator.add(mapPresenter.asWidget());
mapPanel.add(mapDecorator);
// Initialize the map, and return the layout:
GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm");
// Make sure the text box also reacts to the "Enter" key:
opacityBox.addKeyUpHandler(new KeyUpHandler() {
public void onKeyUp(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
changeOpacity();
}
}
});
return layout;
}
示例12: PersonEditorWorkflow
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
private PersonEditorWorkflow(DynaTableRequestFactory requestFactory,
FavoritesManager manager, PersonProxy person) {
this.requestFactory = requestFactory;
this.manager = manager;
this.person = person;
TimeSlotListWidget timeSlotEditor = new TimeSlotListWidget(requestFactory);
ScheduleEditor scheduleEditor = new ScheduleEditor(timeSlotEditor);
MentorSelector mentorEditor = new MentorSelector(requestFactory);
personEditor = new PersonEditor(mentorEditor, scheduleEditor);
Binder.BINDER.createAndBindUi(this);
contents.addDomHandler(new KeyUpHandler() {
public void onKeyUp(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
onCancel(null);
}
}
}, KeyUpEvent.getType());
this.favorite.setVisible(false);
}
示例13: makeChoicesListBox
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
private ListBox makeChoicesListBox() {
choices = GWT.create(ListBox.class);
choices.setMultipleSelect(true);
choices.setPixelSize(getChoicesWidth(),
getChoicesHeight());
choices.addKeyUpHandler(new KeyUpHandler() {
public void onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
selectSomething();
}
}
});
addDSLSentences();
if (!onlyShowDSLStatements) {
addFacts();
addExistentialConditionalElements();
addFromConditionalElements();
addFreeFormDrl();
}
return choices;
}
示例14: boundFormulaTextBox
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
private TextBox boundFormulaTextBox() {
final TextBox box = new TextBox();
box.setStyleName("constraint-value-Editor");
if (this.methodParameter.getValue() == null) {
box.setValue("");
} else {
box.setValue(this.methodParameter.getValue());
}
box.addKeyUpHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent event) {
setMethodParameterValue(box.getValue());
}
});
return box;
}
示例15: addKeyHandler
import com.google.gwt.event.dom.client.KeyUpHandler; //导入依赖的package包/类
/**
* Add key handler to diagram canvas.
*
* @param panel
*/
protected void addKeyHandler(DiagramCanvas panel){
panel.addDomHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent event) {
DiagramController.this.onKeyUp(event);
}
}, KeyUpEvent.getType());
}