Java Code Examples for com.vaadin.ui.TextField#focus()
The following examples show how to use
com.vaadin.ui.TextField#focus() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ValueEntryPopup.java From sensorhub with Mozilla Public License 2.0 | 6 votes |
@SuppressWarnings("serial") public ValueEntryPopup(int width, final ValueCallback callback) { super("New Value"); VerticalLayout layout = new VerticalLayout(); TextField text = new TextField(); text.setWidth(width, Unit.PIXELS); layout.addComponent(text); text.focus(); text.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { ValueEntryPopup.this.close(); callback.newValue((String)event.getProperty().getValue()); } }); setContent(layout); center(); }
Example 2
Source File: MyCloudEdit.java From primecloud-controller with GNU General Public License v2.0 | 6 votes |
@Override public void attach() { // myCloud名 cloudNameField = new TextField(ViewProperties.getCaption("field.cloudName")); getLayout().addComponent(cloudNameField); // ドメイン名 domainNameField = new TextField(ViewProperties.getCaption("field.domainName")); domainNameField.setWidth("100%"); getLayout().addComponent(domainNameField); // コメント commentField = new TextField(ViewProperties.getCaption("field.comment")); commentField.setWidth("100%"); getLayout().addComponent(commentField); cloudNameField.focus(); initValidation(); }
Example 3
Source File: LoginView.java From gazpachoquest with GNU General Public License v3.0 | 5 votes |
protected HorizontalLayout createCompositionRootx() { VerticalLayout loginPanel = new VerticalLayout(); loginPanel.setSpacing(true); loginPanel.setWidth("400px"); Label header = new Label("Enter your invitation to start the questionnair"); header.addStyleName(Reindeer.LABEL_H1); loginPanel.addComponent(header); invitation = new TextField("Invitation"); invitation.setWidth("100%"); invitation.focus(); invitation.setValue("YAS5ICHRBE"); loginPanel.addComponent(invitation); HorizontalLayout buttons = new HorizontalLayout(); buttons.setSpacing(true); loginPanel.addComponent(buttons); loginPanel.setComponentAlignment(buttons, Alignment.MIDDLE_RIGHT); login = new Button("Start"); login.setClickShortcut(KeyCode.ENTER); login.addStyleName(Reindeer.BUTTON_DEFAULT); login.addClickListener(createLoginButtonListener()); buttons.addComponent(login); HorizontalLayout viewLayout = new HorizontalLayout(); viewLayout.addComponent(loginPanel); viewLayout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER); viewLayout.setSizeFull(); viewLayout.addStyleName(Reindeer.LAYOUT_BLUE); setSizeFull(); return viewLayout; }
Example 4
Source File: MyCloudAdd.java From primecloud-controller with GNU General Public License v2.0 | 4 votes |
@Override public void attach() { // myCloud名 cloudNameField = new TextField(ViewProperties.getCaption("field.cloudName")); getLayout().addComponent(cloudNameField); // コメント commentField = new TextField(ViewProperties.getCaption("field.comment")); commentField.setWidth("100%"); getLayout().addComponent(commentField); // テンプレート選択テーブル templateTable = new SelectTemplateTable(); getLayout().addComponent(templateTable); // テンプレート説明欄 final Label nameLabel = new Label(); final Label descriptionLabel = new Label(); Panel descriptionPanel = new Panel(); CssLayout layout = new CssLayout(); layout.addStyleName("template-desc"); descriptionPanel.setHeight("80px"); descriptionPanel.setContent(layout); layout.setSizeFull(); layout.addComponent(nameLabel); layout.addComponent(descriptionLabel); getLayout().addComponent(descriptionPanel); templateTable.addListener(new ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { if (templateTable.getValue() == null) { return; } TemplateDto template = findTemplate(templateTable.getValue()); nameLabel.setValue(template.getTemplate().getTemplateNameDisp() + ":"); descriptionLabel.setValue(template.getTemplate().getTemplateDescriptionDisp()); } }); cloudNameField.focus(); initValidation(); }
Example 5
Source File: WinLogin.java From primecloud-controller with GNU General Public License v2.0 | 4 votes |
@Override public void attach() { // Window setIcon(Icons.LOGIN.resource()); setCaption(ViewProperties.getCaption("window.login")); setModal(true); setWidth("300px"); setResizable(false); setClosable(false); // Layout VerticalLayout layout = (VerticalLayout) getContent(); layout.setMargin(true); layout.setSpacing(true); // Form Form form = new Form(); form.addStyleName("form-login"); // ユーザ名 usernameField = new TextField(ViewProperties.getCaption("field.userName")); usernameField.setWidth("90%"); usernameField.focus(); // フォーカスを設定 usernameField.setRequired(true); usernameField.setRequiredError(ViewMessages.getMessage("IUI-000019")); form.getLayout().addComponent(usernameField); // パスワード passwordField = new TextField(ViewProperties.getCaption("field.password")); passwordField.setSecret(true); passwordField.setWidth("90%"); passwordField.setRequired(true); passwordField.setRequiredError(ViewMessages.getMessage("IUI-000020")); form.getLayout().addComponent(passwordField); layout.addComponent(form); // ログインボタン Button loginButton = new Button(ViewProperties.getCaption("button.login")); loginButton.setDescription(ViewProperties.getCaption("description.login")); loginButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { loginButtonClick(event); } }); loginButton.setClickShortcut(KeyCode.ENTER); layout.addComponent(loginButton); layout.setComponentAlignment(loginButton, "right"); }
Example 6
Source File: LoginView.java From gazpachoquest with GNU General Public License v3.0 | 4 votes |
protected CssLayout createCompositionRoot() { CssLayout root = new CssLayout(); root.setSizeFull(); root.addStyleName(Reindeer.LAYOUT_BLUE); VerticalLayout loginLayout = new VerticalLayout(); loginLayout.setSizeFull(); loginLayout.addStyleName("login-layout"); root.addComponent(loginLayout); final CssLayout loginPanel = new CssLayout(); loginPanel.addStyleName("login-panel"); loginLayout.addComponent(loginPanel); HorizontalLayout labels = new HorizontalLayout(); labels.setWidth("100%"); labels.setMargin(true); labels.addStyleName("labels"); loginPanel.addComponent(labels); Label welcome = new Label("Welcome"); welcome.setSizeUndefined(); welcome.addStyleName(Reindeer.LABEL_H2); labels.addComponent(welcome); labels.setComponentAlignment(welcome, Alignment.MIDDLE_LEFT); Label title = new Label("Gazpacho Quest"); title.setSizeUndefined(); title.addStyleName(Reindeer.LABEL_H1); labels.addComponent(title); labels.setComponentAlignment(title, Alignment.MIDDLE_RIGHT); HorizontalLayout fields = new HorizontalLayout(); fields.setWidth("100%"); fields.setSpacing(true); fields.setMargin(true); fields.addStyleName("fields"); invitation = new TextField("Invitation"); invitation.setSizeUndefined(); invitation.focus(); // invitation.setValue("YAS5ICHRBE"); fields.addComponent(invitation); login = new Button("Start"); login.addClickListener(createLoginButtonListener()); fields.addComponent(login); fields.setComponentAlignment(login, Alignment.BOTTOM_LEFT); loginPanel.addComponent(fields); return root; }