/** * Sets the selected tab in the TabSheet. Ensures that the selected tab is * repainted if needed. * * @param component * The new selection or null for no selection */ private void setSelected(Component component) { Tab tab = tabs.get(selected); selected = component; // Repaint of the selected component is needed as only the selected // component is communicated to the client. Otherwise this will be a // "cached" update even though the client knows nothing about the // connector if (selected != null) { tab = getTab(component); if (tab != null && tab.getDefaultFocusComponent() != null) { tab.getDefaultFocusComponent().focus(); } getState().selected = keyMapper.key(selected); selected.markAsDirtyRecursive(); } else { getState().selected = null; } }
((com.vaadin.ui.Component.Focusable) buttonsContainer.getComponent(0)).focus();
@Override public boolean handle(ErrorEvent event, App app) { boolean handled = super.handle(event, app); if (handled && event.getThrowable() != null) { // Finds the original source of the error/exception AbstractComponent component = DefaultErrorHandler.findAbstractComponent(event); if (component != null) { component.markAsDirty(); } if (component instanceof Component.Focusable) { ((Component.Focusable) component).focus(); } } return handled; }
@Override public void focus() { ((Focusable) field).focus(); }
@Override public void handleAction(Object sender, Object target) { focusable.focus(); } }
/** * Sets the focus to the first editable field of the table. * If entries can be added, it is set to the first field of the "Add entries" row. */ private void adjustFocus() { // Put the focus on the "Filter key" field first ((Focusable)m_table.getFilterField(TableProperty.KEY)).focus(); }
@Override public void focus() { if (getFocusable() != null) { getFocusable().focus(); } else { super.focus(); } }
@Override public void focus() { if (getFocusable() != null) { getFocusable().focus(); } else { super.focus(); } }
@Override public void handleAction(Object sender, Object target) { focusable.focus(); } }