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


Java KeyUpEvent类代码示例

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


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

示例1: addRVKeyUpEvent

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的package包/类
/**
 * @param eventBus
 */
private void addRVKeyUpEvent(HandlerManager eventBus) {
	eventBus.addHandler(RVKeyUpEvent.type, new RVKeyUpEventHandler() {

		@Override
		public void onKeyUp(RVKeyUpEvent event) {
			KeyUpEvent keyEvent = event.getEvent();
			if (keyEvent.isControlKeyDown()) {
				int keyCode = keyEvent.getNativeEvent().getKeyCode();
				switch (keyCode) {
					case 'n':
					case 'N':
						keyNUpEvent(keyEvent);
						break;
					case 'p':
					case 'P':
						keyPUpEvent(keyEvent);
						break;
					default:
						break;
				}
			}
		}

	});
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:29,代码来源:DocumentTree.java

示例2: postConstruct

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的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"));
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:24,代码来源:DataServicesLibraryScreen.java

示例3: getInstance

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的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;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:23,代码来源:AriaStatus.java

示例4: setEscapeHandler

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的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;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:19,代码来源:ToggleTool.java

示例5: setUndoHandler

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的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;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:19,代码来源:ToggleTool.java

示例6: setRedoHandler

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的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;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:19,代码来源:ToggleTool.java

示例7: install

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的package包/类
/**
 * Installs a key handler for key events on this window.
 *
 * @param handler handler to receive key events.
 */
static void install(KeySignalHandler handler) {
  //
  // NOTE: There are three potential candidate elements for sinking keyboard
  // events: the window, the document, and the document body. IE7 does not
  // fire events on the window element, and GWT's RootPanel is already a
  // listener on the body, leaving the document as the only cross-browser
  // whole-window event-sinking 'element'.
  //
  DocumentPanel panel = new DocumentPanel(handler);
  panel.setElement(Document.get().<Element>cast());
  panel.addDomHandler(panel, KeyDownEvent.getType());
  panel.addDomHandler(panel, KeyPressEvent.getType());
  panel.addDomHandler(panel, KeyUpEvent.getType());
  RootPanel.detachOnWindowClose(panel);
  panel.onAttach();
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:22,代码来源:FocusManager.java

示例8: onKeyUp

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的package包/类
/**
 * Triggered when a key was depressed.
 *
 * @param event
 *            The KeyUpEvent of the key depressed
 */
@Override
public void onKeyUp(KeyUpEvent event) {
	debug("VComboBoxMultiselect: onKeyUp(" + event.getNativeKeyCode() + ")");

	if (this.enabled && !this.readonly) {
		switch (event.getNativeKeyCode()) {
		case KeyCodes.KEY_ENTER:
		case KeyCodes.KEY_TAB:
		case KeyCodes.KEY_SHIFT:
		case KeyCodes.KEY_CTRL:
		case KeyCodes.KEY_ALT:
		case KeyCodes.KEY_DOWN:
		case KeyCodes.KEY_UP:
		case KeyCodes.KEY_PAGEDOWN:
		case KeyCodes.KEY_PAGEUP:
		case KeyCodes.KEY_ESCAPE:
			// NOP
			break;
		default:
			if (this.textInputEnabled) {
				// when filtering, we always want to see the results on the
				// first page first.
				filterOptions(0);
			}
			break;
		}
	}
}
 
开发者ID:bonprix,项目名称:vaadin-combobox-multiselect,代码行数:35,代码来源:VComboBoxMultiselect.java

示例9: extend

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的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();
            }
        }
    });
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:23,代码来源:AutoCompleteTextFieldConnector.java

示例10: handlePanelEventDelegation

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的package包/类
private void handlePanelEventDelegation(final KeyUpEvent event) {
    switch (event.getNativeKeyCode()) {
    case KeyCodes.KEY_DOWN:
        arrowKeyDown(event);
        break;
    case KeyCodes.KEY_UP:
        arrorKeyUp(event);
        break;
    case KeyCodes.KEY_ESCAPE:
        escapeKey();
        break;
    case KeyCodes.KEY_ENTER:
        enterKey();
        break;
    default:
        doAskForSuggestion();
    }
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:19,代码来源:AutoCompleteTextFieldConnector.java

示例11: onProjectNameChanged

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的package包/类
@UiHandler("projectName")
void onProjectNameChanged(KeyUpEvent event) {
  if (projectName.getValue() != null && projectName.getValue().contains(" ")) {
    String tmp = projectName.getValue();
    while (tmp.contains(" ")) {
      tmp = tmp.replaceAll(" ", "-");
    }
    projectName.setValue(tmp);
  }

  if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
    return;
  }

  delegate.projectNameChanged(projectName.getText());
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:CategoriesPageViewImpl.java

示例12: onFilterChanged

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的package包/类
@UiHandler({"filterField"})
void onFilterChanged(KeyUpEvent event) {
  switch (event.getNativeKeyCode()) {
    case KEY_UP:
      tree.getSelectionModel().selectPrevious();
      break;
    case KEY_DOWN:
      tree.getSelectionModel().selectNext();
      break;
    case KEY_ENTER:
      final List<Node> selectedNodes = tree.getSelectionModel().getSelectedNodes();

      if (!selectedNodes.isEmpty()) {
        final Node node = selectedNodes.get(0);

        if (node instanceof ExecutableCommandNode) {
          delegate.onCommandExecute(((ExecutableCommandNode) node).getData());
        } else if (node instanceof CommandGoalNode) {
          tree.setExpanded(node, !tree.isExpanded(node));
        }
      }
      break;
    default:
      delegate.onFilterChanged(filterField.getValue());
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:CommandsPaletteViewImpl.java

示例13: onProjectDescriptionChanged

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的package包/类
@UiHandler("projectDescription")
void onProjectDescriptionChanged(KeyUpEvent event) {
  if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
    return;
  }
  delegate.onProjectDescriptionChanged(projectDescription.getValue());
}
 
开发者ID:eclipse,项目名称:che,代码行数:8,代码来源:GithubImporterPageViewImpl.java

示例14: OwnTextArea

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的package包/类
public OwnTextArea() {
	super();
	sinkEvents(Event.ONPASTE);
	addKeyUpHandler(new KeyUpHandler() {
		@Override
		public void onKeyUp(KeyUpEvent event) {
			fireHandler();
		}
	});
}
 
开发者ID:umlet,项目名称:umlet,代码行数:11,代码来源:OwnTextArea.java

示例15: getFullScreenView

import com.google.gwt.event.dom.client.KeyUpEvent; //导入依赖的package包/类
private VideoFullScreenView getFullScreenView() {
    if (view == null) {
        view = fullScreenViewProvider.get();
        controlsHideTimer = mediaFactory.getVideoControlHideTimer(view);
        RootPanel.get().addDomHandler(this, KeyUpEvent.getType());
    }
    return view;
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:9,代码来源:VideoFullScreenHelper.java


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