/** * 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; } }
((Focusable) this).setTabIndex(DesignAttributeHandler.readAttribute( "tabindex", design.attributes(), Integer.class));
((Focusable) this).getTabIndex(), ((Focusable) def).getTabIndex(), Integer.class, designContext);
((Focusable) this).setTabIndex(tabIndex); return (C) this;
((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 setTabIndex(int tabIndex) { ((Focusable) field).setTabIndex(tabIndex); }
@Override public void focus() { ((Focusable) field).focus(); }
@Override public int getTabIndex() { return ((Focusable) field).getTabIndex(); }
@Override public void handleAction(Object sender, Object target) { focusable.focus(); } }
@Override public int getTabIndex() { if (getFocusable() != null) { return getFocusable().getTabIndex(); } else { return super.getTabIndex(); } }
/** * 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 setComponentFocusable(com.haulmont.cuba.gui.components.Component component, boolean focusable) { com.vaadin.ui.Component vComponent = component.unwrap(com.vaadin.ui.Component.class); if (vComponent instanceof Component.Focusable) { ((Component.Focusable) vComponent).setTabIndex(focusable ? 0 : -1); } }
@Override public void focus() { if (getFocusable() != null) { getFocusable().focus(); } else { super.focus(); } }
@Override public void setTabIndex(int tabIndex) { if (getFocusable() != null) { getFocusable().setTabIndex(tabIndex); } else { super.setTabIndex(tabIndex); } } }
@Override public void paintContent(PaintTarget target) throws PaintException { page.paintContent(target); if (scrollIntoView != null) { target.addAttribute("scrollTo", scrollIntoView); scrollIntoView = null; } if (pendingFocus != null) { // ensure focused component is still attached to this main window if (equals(pendingFocus.getUI()) || (pendingFocus.getUI() != null && equals(pendingFocus.getUI().getParent()))) { target.addAttribute("focused", pendingFocus); } pendingFocus = null; } if (actionManager != null) { actionManager.paintActions(null, target); } if (isResizeLazy()) { target.addAttribute(UIConstants.RESIZE_LAZY, true); } }
@Override public void focus() { if (getFocusable() != null) { getFocusable().focus(); } else { super.focus(); } }
@Override public int getTabIndex() { if (getFocusable() != null) { return getFocusable().getTabIndex(); } else { return super.getTabIndex(); } }
@Override public void handleAction(Object sender, Object target) { focusable.focus(); } }