/** * See {@link ButtonOption#apply(MessageBox, Button)} */ @Override public void apply(MessageBox messageBox, Button button) { button.focus(); }
/** * Show the confirmation popup. */ public void showConfirmation() { yesButton.focus(); ExplorerApp.get().getViewManager().showPopupWindow(this); }
private void buildSignInButton() { final String caption = isDemo ? i18n.getMessage("button.login.agreeandsignin") : i18n.getMessage("button.login.signin"); signIn = new Button(caption); signIn.addStyleName(ValoTheme.BUTTON_PRIMARY + " " + ValoTheme.BUTTON_SMALL + " " + "login-button"); signIn.setClickShortcut(KeyCode.ENTER); signIn.focus(); signIn.setId("login-signin"); }
private void buildSignInButton() { final String caption = isDemo ? i18n.getMessage("button.login.agreeandsignin") : i18n.getMessage("button.login.signin"); signIn = new Button(caption); signIn.addStyleName(ValoTheme.BUTTON_PRIMARY + " " + ValoTheme.BUTTON_SMALL + " " + "login-button"); signIn.setClickShortcut(KeyCode.ENTER); signIn.focus(); signIn.setId("login-signin"); }
private void addOkHandler(BaseDialog dialog, String okButtonText, final OverlayCloser overlayCloser, final AlertCallback cb) { CssLayout footer = new CssLayout(); footer.setWidth(100, Unit.PERCENTAGE); footer.addStyleName("v-align-right"); Button okButton = new Button(okButtonText, new ClickListener() { @Override public void buttonClick(ClickEvent event) { cb.onOk(); overlayCloser.close(); } }); okButton.focus(); footer.addComponent(okButton); dialog.setFooterToolbar(footer); }
button.setClickShortcut(KeyCode.ENTER); button.focus();
@SuppressWarnings("serial") private Component buildFields() { HorizontalLayout fields = new HorizontalLayout(); fields.setSpacing(true); fields.addStyleName("fields"); usernameField.setIcon(VaadinIcons.USER); usernameField.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); usernameField.setDescription("The users are <br />" + "<ul>" + "<li><strong>admin</strong> with password <strong>password</strong>" + "<li><strong>katie</strong> with password <strong>password</strong>" + "<li><strong>marmite</strong> with password <strong>password</strong>" + "<li><strong>brown</strong> with password <strong>password</strong>" + "<li><strong>linus</strong> with password <strong>password</strong>" + "<li><strong>lucy</strong> with password <strong>password</strong>" + "</ul>"); passwordField.setIcon(VaadinIcons.LOCK); passwordField.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); loginButton.addStyleName(ValoTheme.BUTTON_PRIMARY); loginButton.setClickShortcut(ShortcutAction.KeyCode.ENTER); loginButton.focus(); fields.addComponents(usernameField, passwordField, loginButton); fields.setComponentAlignment(loginButton, Alignment.BOTTOM_LEFT); return fields; }
public Notification(final MessageStyleType type) { layout = new CssLayout(); layout.addStyleName("light-dialog-panel"); layout.addStyleName("notification-dialog"); layout.addStyleName(type.getCssClass()); CompositeIcon icon = (CompositeIcon) Classes.getClassFactory().newInstance(type.getIconClass()); icon.setStyleName("dialog-icon"); layout.addComponent(icon); layout.addLayoutClickListener(new LayoutClickListener() { @Override public void layoutClick(LayoutClickEvent event) { layout.addStyleName("notification-dialog-selected"); } }); closeButton.addStyleName("close"); closeButton.setDisableOnClick(true); closeButton.setHtmlContentAllowed(true); closeButton.setCaption("<span class=\"m-closebutton icon-close m-closebutton-dialog\"></span>"); closeButton.focus(); layout.addComponent(closeButton); }
private void onMenuAbout() { Window helpWindow = new Window(); helpWindow.setCaption("About"); helpWindow.setModal(true); helpWindow.setResizable(false); helpWindow.setSizeUndefined(); VerticalLayout content = new VerticalLayout(); content.setSizeUndefined(); content.setMargin(true); content.setSpacing(true); Label aboutLabel = new Label("Electron+Vaadin Demo\nAuthor: Yuriy Artamonov"); aboutLabel.setContentMode(ContentMode.PREFORMATTED); aboutLabel.setSizeUndefined(); content.addComponent(aboutLabel); Button okBtn = new Button("Ok", VaadinIcons.CHECK); okBtn.focus(); okBtn.addClickListener(event -> helpWindow.close()); content.addComponent(okBtn); content.setComponentAlignment(okBtn, Alignment.MIDDLE_CENTER); helpWindow.setContent(content); getUI().addWindow(helpWindow); }
yesBtn.focus(); yesBtn.addClickListener(event -> { confirmationWindow.close();
addButton.focus(); addButton.setStyleName(ValoTheme.BUTTON_PRIMARY); addButton.addClickListener(event -> {