<dependency> <groupId>com.vaadin.external.google</groupId> <artifactId>iron-a11y-keys</artifactId> </dependency> import com.vaadin.ui.AbstractJavaScriptComponent; public class IronA11yKeysComponent extends AbstractJavaScriptComponent { public IronA11yKeysComponent() { getState().shortcut = "Ctrl+Alt+KeyA"; getState().explanation = "Accessibility key for feature A"; } @Override protected IronA11yKeysState getState() { return (IronA11yKeysState)super.getState(); } } public class IronA11yKeysState extends JavaScriptComponentState { public String shortcut; public String explanation; } import com.vaadin.ui.Button; public class MyButton extends Button { public MyButton() { setCaption("Feature A"); IronA11yKeysComponent ironA11yKeys = new IronA11yKeysComponent(); addExtension(ironA11yKeys); addClickListener(event -> { }); } }


上一篇:
下一篇: