protected void initAlfrescoComponent() { alfrescoForm = new Form(); alfrescoForm.setDescription(i18nManager.getMessage(Messages.ALFRESCO_DESCRIPTION)); final TextField alfrescoServer = new TextField(i18nManager.getMessage(Messages.ALFRESCO_SERVER)); alfrescoForm.getLayout().addComponent(alfrescoServer); final TextField alfrescoUserName = new TextField(i18nManager.getMessage(Messages.ALFRESCO_USERNAME)); alfrescoForm.getLayout().addComponent(alfrescoUserName); final PasswordField alfrescoPassword = new PasswordField(i18nManager.getMessage(Messages.ALFRESCO_PASSWORD)); alfrescoForm.getLayout().addComponent(alfrescoPassword); // Matching listener alfrescoClickListener = new ClickListener() { public void buttonClick(ClickEvent event) { Map<String, Object> accountDetails = createAccountDetails( "alfresco", alfrescoUserName.getValue().toString(), alfrescoPassword.getValue().toString(), "server", alfrescoServer.getValue().toString() ); fireEvent(new SubmitEvent(AccountSelectionPopup.this, SubmitEvent.SUBMITTED, accountDetails)); } }; }
public FileAttachmentEditorComponent(Attachment attachment, String taskId, String processInstanceId) { this.attachment = attachment; this.taskId = taskId; this.processInstanceId = processInstanceId; this.i18nManager = ExplorerApp.get().getI18nManager(); taskService = ProcessEngines.getDefaultProcessEngine().getTaskService(); form = new Form(); form.setDescription(i18nManager.getMessage(Messages.RELATED_CONTENT_TYPE_FILE_HELP)); setSizeFull(); addComponent(form); initSuccessIndicator(); initFileUpload(); initName(); initDescription(); }
public WkdXmlConfigDialog(WkdXmlConfig config) { form = new Form(); addComponent(form); beanItem = new BeanItem<WkdXmlConfig>(config); form.setImmediate(true); form.setFormFieldFactory(new DefaultFieldFactory() { @Override public Field createField(Item item, Object propertyId, Component uiContext) { Field f = super.createField(item, propertyId, uiContext); f.setRequired(true); f.setWidth(500,UNITS_PIXELS); return f; } }); form.setItemDataSource(beanItem); form.focus(); }
/** * {@inheritDoc} */ public Form build() { Form form = new Form(); if (layout != null) form.setLayout(layout); if (formFieldFactory != null) form.setFormFieldFactory(formFieldFactory); if (visibleProperties != null) form.setVisibleItemProperties(visibleProperties); if (width != null) form.setWidth(width); if (height != null) form.setHeight(height); return form; }
/** * {@inheritDoc} */ @SuppressWarnings("rawtypes") @Override public void buttonClick(ClickEvent event) { PageableTable<?> table = (PageableTable<?>) getTable(); Filter filter = (Filter) table.getFilter(); if (filter == null) return; filter.clear(); if (table.getFilterForm() instanceof Form) { Form form = (Form) table.getFilterForm(); form.discard(); } else if (table.getFilterForm() instanceof View) { ((View) table.getFilterForm()).refresh(); } table.getPaginator().firstPage(); }
protected void initForm() { form = new Form(); form.setSizeFull(); addComponent(form); setComponentAlignment(form, Alignment.TOP_CENTER); }
protected void initForm() { form = new Form(); form.setValidationVisibleOnCommit(true); form.setImmediate(true); addComponent(form); initInputFields(); initCreateButton(); }
protected void initForm() { form = new Form(); form.setValidationVisibleOnCommit(true); form.setImmediate(true); addComponent(form); // name nameField = new TextField(i18nManager.getMessage(Messages.TASK_NAME)); nameField.focus(); nameField.setRequired(true); nameField.setRequiredError(i18nManager.getMessage(Messages.TASK_NAME_REQUIRED)); form.addField("name", nameField); // description descriptionArea = new TextArea(i18nManager.getMessage(Messages.TASK_DESCRIPTION)); descriptionArea.setColumns(25); form.addField("description", descriptionArea); // duedate dueDateField = new DateField(i18nManager.getMessage(Messages.TASK_DUEDATE)); dueDateField.setResolution(DateField.RESOLUTION_DAY); form.addField("duedate", dueDateField); // priority priorityComboBox = new PriorityComboBox(i18nManager); form.addField("priority", priorityComboBox); }
public FossaLoginScreen(FossaApplication app, FossaAuthorizer authorizer, String error) { super(app); setStyleName("login"); this.authorizer = authorizer; setCaption("Bitte melden Sie sich an!"); setWidth("500px"); center(); CustomLayout layout = new CustomLayout("./login/loginScreen"); setContent(layout); Label errorlabel = new Label(error); formLoginScreen = new Form(); formLoginScreen.addField(username, username); username.focus(); formLoginScreen.addField(password, password); formLoginScreen.getField(username).setRequired(true); formLoginScreen.getField(password).setRequired(true); layout.addComponent(formLoginScreen, "form"); layout.addComponent(errorlabel, "errorlabel"); Button login = new Button("Anmelden"); layout.addComponent(login, "login"); login.addListener((Button.ClickListener) this); login.setClickShortcut(KeyCode.ENTER); }
private static void renameGroup(GraphContainer graphContainer, Vertex group, String newLabel) { RenameGroupOperation operation = new RenameGroupOperation(); OperationContext context = getOperationContext(graphContainer); // Execute the operation on the single vertex operation.execute(Collections.singletonList((VertexRef)group), context); // Grab the window, put a value into the form field, and commit the form to complete // the operation. Window window = context.getMainWindow(); assertEquals(1, window.getChildWindows().size()); Window prompt = window.getChildWindows().iterator().next(); for (Iterator<Component> itr = prompt.getComponentIterator(); itr.hasNext();) { Component component = itr.next(); try { Form form = (Form)component; Field field = form.getField("Group Label"); field.setValue(newLabel); // Make sure that the value was set, Vaadin will ignore the value // if, for instance, the specified value is not in the Select list assertEquals(newLabel, field.getValue()); form.commit(); } catch (ClassCastException e) { LoggerFactory.getLogger(GroupOperationsTest.class).info("Not a Form: " + component.getClass()); } } }
public SPARQLUpdateTransformDialog(SPARQLUpdateTransformConfig oldConfig) { this.config = oldConfig; queryForm = new Form(); queryForm.setSizeFull(); queryForm.setFormFieldFactory(new FormFieldFactory() { @Override public Field createField(Item item, Object propertyId, Component uiContext) { if (propertyId.equals("query")) { TextArea query = new TextArea("SPARQL Query"); query.setSizeFull(); query.setRows(25); query.addValidator(new AbstractStringValidator("Must be a valid UPDATE query!") { @Override protected boolean isValidString(String value) { SPARQLParser parser = new SPARQLParser(); try { ParsedUpdate parsed = parser.parseUpdate(value, null); } catch (Exception ex) { setErrorMessage(ex.getMessage()); return false; } return true; } }); return query; } return null; } }); queryForm.setItemDataSource(new BeanItem<SPARQLUpdateTransformConfig>(config)); addComponent(queryForm); }
/** * Add a default commit/discard buttons to a form * @param f the Form */ public static void addOKCancelButtons(Form f) { Button ok = newOKButton(f); Button cancel = newCancelButton(f); HorizontalLayout hl = new HorizontalLayout(); hl.setSpacing(true); hl.addComponent(ok); hl.addComponent(cancel); HorizontalLayout footer = new HorizontalLayout(); footer.setWidth("100%"); footer.addComponent(hl); footer.setComponentAlignment(hl, Alignment.TOP_CENTER); f.setFooter(footer); }
/** * Creates a new cancel button * @param f form holding the button * @return new cancel button */ private static Button newCancelButton(final Form f) { Button cancel = new Button(StaticMessageSource.getMessage("cancel")); cancel.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { f.discard(); } }); return cancel; }
/** * Creates a new OK Button * @param f form holding the button * @return new OK Button */ private static Button newOKButton(final Form f) { Button ok = new Button(StaticMessageSource.getMessage("ok")); ok.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { f.commit(); } }); return ok; }
private Form createForm() { Form form = new Form(); form.setFormFieldFactory(this.formFieldFactory); return form; }
@Override public void attach() { setHeight(TAB_HEIGHT); setMargin(false, true, true, true); setSpacing(false); // メインフォーム Form mainForm = new Form(); addComponent(mainForm); // 監視プロトコル checkProtocolSelect = new ComboBox(ViewProperties.getCaption("field.checkProtocol")); checkProtocolSelect.setWidth(TEXT_WIDTH); checkProtocolSelect.setImmediate(true); checkProtocolSelect.setNullSelectionAllowed(false); checkProtocolSelect.addListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { checkProtocolValueChange(event); } }); mainForm.getLayout().addComponent(checkProtocolSelect); // 監視ポート checkPortField = new TextField(ViewProperties.getCaption("field.checkPort")); checkPortField.setWidth(TEXT_WIDTH); mainForm.getLayout().addComponent(checkPortField); // 監視Path checkPathField = new TextField(ViewProperties.getCaption("field.checkPath")); checkPathField.setImmediate(true); mainForm.getLayout().addComponent(checkPathField); // ヘルスチェック詳細設定パネル Panel panel = new Panel(ViewProperties.getCaption("field.healthCheckDetail")); ((Layout) panel.getContent()).setMargin(false, false, false, true); ((Layout) panel.getContent()).setHeight("200px"); ((Layout) panel.getContent()).setWidth("315px"); mainForm.getLayout().addComponent(panel); // サブフォーム Form subForm = new Form(); subForm.setStyleName("panel-healthcheck-setting"); subForm.getLayout().setMargin(false, false, false, false); panel.addComponent(subForm); // タイムアウト時間 checkTimeoutField = new TextField(ViewProperties.getCaption("field.checkTimeout")); checkTimeoutField.setWidth(TEXT_WIDTH); subForm.getLayout().addComponent(checkTimeoutField); // ヘルスチェック間隔 checkIntervalField = new TextField(ViewProperties.getCaption("field.checkInterval")); checkIntervalField.setWidth(TEXT_WIDTH); subForm.getLayout().addComponent(checkIntervalField); // 障害閾値 unhealthyThresholdField = new TextField(ViewProperties.getCaption("field.checkDownThreshold")); unhealthyThresholdField.setWidth(TEXT_WIDTH); subForm.getLayout().addComponent(unhealthyThresholdField); // 復帰閾値 healthyThresholdField = new TextField(ViewProperties.getCaption("field.checkRecoverThreshold")); healthyThresholdField.setWidth(TEXT_WIDTH); subForm.getLayout().addComponent(healthyThresholdField); // UltraMonkeyロードバランサの場合、復帰閾値は設定できない if (PCCConstant.LOAD_BALANCER_ULTRAMONKEY.equals(loadBalancerType)) { healthyThresholdField.setEnabled(false); } initValidation(); }
@Override public void attach() { // メインフォーム Form mainForm = new Form(); Layout mainLayout = mainForm.getLayout(); addComponent(mainForm); // ロードバランサ名 nameField = new TextField(ViewProperties.getCaption("field.loadBalancerName")); nameField.setReadOnly(true); mainLayout.addComponent(nameField); // サービス名 serviceField = new TextField(ViewProperties.getCaption("field.loadBalancerService")); serviceField.setReadOnly(true); mainLayout.addComponent(serviceField); // ロードバランサ設定パネル Panel panel = new Panel(ViewProperties.getCaption("field.loadBalancerConfig")); ((Layout) panel.getContent()).setMargin(false, false, false, true); mainLayout.addComponent(panel); // サブフォーム subForm = new Form(); FormLayout sublayout = (FormLayout) this.subForm.getLayout(); sublayout.setMargin(false); sublayout.setSpacing(false); panel.getContent().addComponent(subForm); subForm.setHeight("200px"); // ロードバランサポート loadBalancerPortField = new TextField(ViewProperties.getCaption("field.loadBalancerPort")); loadBalancerPortField.setWidth(TEXT_WIDTH); sublayout.addComponent(loadBalancerPortField); // サービスポート servicePortField = new TextField(ViewProperties.getCaption("field.loadBalancerServicePort")); servicePortField.setWidth(TEXT_WIDTH); sublayout.addComponent(servicePortField); // プロトコル protocolSelect = new ComboBox(ViewProperties.getCaption("field.loadBalancerProtocol")); protocolSelect.setWidth(TEXT_WIDTH); protocolSelect.setImmediate(true); sublayout.addComponent(protocolSelect); protocolSelect.addListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { protocolValueChange(event); } }); // SSLキー sslKeySelect = new ComboBox(ViewProperties.getCaption("field.loadBalancerSSLKey")); sslKeySelect.setWidth(TEXT_WIDTH); sslKeySelect.addContainerProperty(SSLKEY_CAPTION_ID, String.class, null); sslKeySelect.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY); sslKeySelect.setItemCaptionPropertyId(SSLKEY_CAPTION_ID); sublayout.addComponent(sslKeySelect); initValidation(); }
@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"); }
@Override public void attach() { setHeight(TAB_HEIGHT); setMargin(false, true, false, true); setSpacing(false); // フォーム Form form = new Form(); form.setSizeFull(); addComponent(form); // ロードバランサ名 loadBalancerNameField = new TextField(ViewProperties.getCaption("field.loadBalancerName")); form.getLayout().addComponent(loadBalancerNameField); // コメント commentField = new TextField(ViewProperties.getCaption("field.comment")); commentField.setWidth("95%"); form.getLayout().addComponent(commentField); // プラットフォーム cloudLabel = new Label(); cloudLabel.setCaption(ViewProperties.getCaption("field.cloud")); cloudLabel.addStyleName("icon-label"); form.getLayout().addComponent(cloudLabel); // ロードバランサ種別 typeLabel = new Label(); typeLabel.setCaption(ViewProperties.getCaption("field.loadBalancerType")); typeLabel.addStyleName("icon-label"); form.getLayout().addComponent(typeLabel); // 割り当てサービス serviceSelect = new ComboBox(); serviceSelect.setCaption(ViewProperties.getCaption("field.loadBalancerService")); serviceSelect.setNullSelectionAllowed(false); serviceSelect.addContainerProperty(SERVICE_CAPTION_ID, String.class, null); serviceSelect.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY); serviceSelect.setItemCaptionPropertyId(SERVICE_CAPTION_ID); form.getLayout().addComponent(serviceSelect); // アルゴリズム algorithmSelect = new ComboBox(); algorithmSelect.setCaption(ViewProperties.getCaption("field.algorithm")); algorithmSelect.setNullSelectionAllowed(false); form.getLayout().addComponent(algorithmSelect); // パブリックポート publicPortField = new TextField(ViewProperties.getCaption("field.publicport")); publicPortField.setWidth("95%"); form.getLayout().addComponent(publicPortField); // プライベートポート privatePortField = new TextField(ViewProperties.getCaption("field.privateport")); privatePortField.setWidth("95%"); form.getLayout().addComponent(privatePortField); initValidation(); }
protected void initImapComponent() { imapForm = new Form(); imapForm.setDescription(i18nManager.getMessage(Messages.IMAP_DESCRIPTION)); final TextField imapServer = new TextField(i18nManager.getMessage(Messages.IMAP_SERVER)); imapForm.getLayout().addComponent(imapServer); final TextField imapPort = new TextField(i18nManager.getMessage(Messages.IMAP_PORT)); imapPort.setWidth(30, UNITS_PIXELS); imapPort.setValue(143); // Default imap port (non-ssl) imapForm.getLayout().addComponent(imapPort); final CheckBox useSSL = new CheckBox(i18nManager.getMessage(Messages.IMAP_SSL)); useSSL.setValue(false); useSSL.setImmediate(true); imapForm.getLayout().addComponent(useSSL); useSSL.addListener(new ValueChangeListener() { public void valueChange(ValueChangeEvent event) { imapPort.setValue( ((Boolean) useSSL.getValue()) ? 993 : 143); } }); final TextField imapUserName = new TextField(i18nManager.getMessage(Messages.IMAP_USERNAME)); imapForm.getLayout().addComponent(imapUserName); final PasswordField imapPassword = new PasswordField(i18nManager.getMessage(Messages.IMAP_PASSWORD)); imapForm.getLayout().addComponent(imapPassword); // Matching listener imapClickListener = new ClickListener() { public void buttonClick(ClickEvent event) { Map<String, Object> accountDetails = createAccountDetails( "imap", imapUserName.getValue().toString(), imapPassword.getValue().toString(), "server", imapServer.getValue().toString(), "port", imapPort.getValue().toString(), "ssl", imapPort.getValue().toString() ); fireEvent(new SubmitEvent(AccountSelectionPopup.this, SubmitEvent.SUBMITTED, accountDetails)); } }; }
public JobsStatusViewComponent(URL appUrl) { VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setSpacing(true); mainLayout.setMargin(true); mainLayout.setWidth("100%"); // Refresher will update UI as progress is made final Refresher refresher = new Refresher(); refresher.setRefreshInterval(UPDATE_STATUS_INTERVAL); refresher.addListener(this); mainLayout.addComponent(refresher); mainLayout.addComponent(buildTableControls()); form = new Form(); form.setCaption("Selected Job"); form.setWidth("420px"); form.setFormFieldFactory(new ExpressZipFieldFactory()); form.setVisible(true); form.setImmediate(true); table = new Table(null); table.addStyleName("expresszip"); table.setWidth("100%"); table.setSelectable(true); table.setImmediate(true); table.setNullSelectionAllowed(false); table.setPageLength(0); table.setHeight("250px"); container = new BeanItemContainer<Job>(Job.class, Job.getJobQueue()); container.addNestedContainerProperty("exportProps.jobName"); container.addNestedContainerProperty("exportProps.userNotation"); table.setContainerDataSource(container); table.setVisibleColumns(new String[] { "exportProps.jobName", "exportProps.userNotation", "status" }); table.setColumnHeaders(new String[] { "Job Name", "User Name", "Status" }); table.sort(new Object[] { "exportProps.jobName", "exportProps.userNotation" }, new boolean[] { true, true }); table.setColumnExpandRatio("status", 0.8f); // use green bar to highlight selected row ExpressZipTreeTable.enableFirstColumnHighlighter(table); updateTableData(); mainLayout.addComponent(table); mainLayout.setExpandRatio(table, 1.0f); mainLayout.addComponent(form); Link browseExports = new Link("Browse Archived Jobs", new ExternalResource(appUrl.getProtocol() + "://" + appUrl.getAuthority() + "/exportdir/")); // Open the URL in a new window/tab browseExports.setTargetName("_blank"); mainLayout.addComponent(browseExports); // setContent(mainLayout); setCompositionRoot(mainLayout); }
public Form getMenuForm() { return menuForm; }
public WkdSpotlightTaggerConfigDialog(WkdSpotlightTaggerConfig config) { this.config = config; form = new Form(); form.setItemDataSource(new BeanItem<WkdSpotlightTaggerConfig>(config)); addComponent(form); }
public FormDialog(Form form) { this.form = form; }
public FormDialog(Form form, String caption) { super(caption); this.form = form; }
/** * @return the form */ public Form getForm() { return form; }
/** * @param form the form to set */ public void setForm(Form form) { this.form = form; }
/** * Build a Form * @return new Form */ Form build();