/** * @see com.vaadin.event.FieldEvents.FocusListener#focus(com.vaadin.event.FieldEvents.FocusEvent) */ public void focus(FocusEvent event) { m_field.addShortcutListener(this); }
public void focus(FocusEvent event) { m_addKeyInput.addShortcutListener(shortCutListener); } });
private TextField createSearchTextField() { TextField textField = new TextField(); textField.addShortcutListener(new ShortcutListener("Enter Keyword", ShortcutAction.KeyCode.ENTER, new int[]{}) { @Override public void handleAction(Object sender, Object target) { searchAction(); } }); return textField; }
if (result instanceof TextField) { ((TextField)result).setComponentError(null); ((TextField)result).addShortcutListener(new ShortcutListener("Cancel edit", KeyCode.ESCAPE, null) { ((TextField)result).addShortcutListener(new ShortcutListener("Save", KeyCode.ENTER, null) {
public FilterField( final ListDataProvider<T> dataProvider, final TableDefinition<T> tableDefinition) { super(); this.dataProvider = dataProvider; this.tableDefinition = tableDefinition; this.attributeField.setStyleName("filter-attribute"); this.attributeField.addValueChangeListener(this::onAttributeChange); this.attributeField.setDataProvider(new ListDataProvider<>(filterDefinitions)); this.attributeField.setTextInputAllowed(false); this.optionsField.setStyleName("filter-options"); this.optionsField.setDataProvider(optionsDataProvider); this.textField.setStyleName("filter-text"); this.tableDefinition.getFilterableColumns().map(ColumnDefinition::filterDefinition).forEach(filterDefinitions::add); if (hasFilterDefinitions()) { this.attributeField.setSelectedItem(this.filterDefinitions.get(0)); } this.optionsField.addValueChangeListener(this::onFilterOptionSelected); this.optionsField.addShortcutListener(new ClearFilterShortcutListener<>(this)); this.textField.addShortcutListener(new FilterShortcutListener<>(this)); this.textField.addShortcutListener(new ClearFilterShortcutListener<>(this)); }
@Override protected void initContent(VerticalLayout layout) throws Exception { label = new Label(message); label.setContentMode(ContentMode.HTML); layout.addComponent(label); textField = new TextField(); textField.setValue(txtInput); textField.setWidth("100%"); textField.focus(); textField.addShortcutListener(new ShortcutListener("Confirm", ShortcutAction.KeyCode.ENTER, null) { private static final long serialVersionUID = 1L; @Override public void handleAction(Object sender, Object target) { confirm.doAction(TextInputDialog.this); } }); layout.addComponent(textField); txtInput = null; }
@Override protected void initContent(VerticalLayout layout) throws Exception { label = new Label(message); label.setContentMode(Label.CONTENT_XHTML); layout.addComponent(label); textField = new TextField(); textField.setValue(txtInput); textField.setWidth("100%"); textField.focus(); textField.addShortcutListener(new ShortcutListener("Confirm", ShortcutAction.KeyCode.ENTER, null) { private static final long serialVersionUID = 1L; @Override public void handleAction(Object sender, Object target) { confirm.doAction(TextInputDialog.this); } }); textField.setImmediate(true); layout.addComponent(textField); txtInput = null; }
filter.setInputPrompt("Filter"); filter.setImmediate(true); filter.addShortcutListener(new ShortcutListener("Filter",ShortcutAction.KeyCode.ENTER, null) {
m_fullTextSearch.addShortcutListener(new ShortcutListener("Save", KeyCode.ENTER, null) {