List of usage examples for com.vaadin.ui TextArea TextArea
public TextArea(ValueChangeListener<String> valueChangeListener)
From source file:de.uni_leipzig.informatik.pcai042.boa.gui.evaluation.EvaluationView.java
License:Open Source License
/** * Build content 'evaluation process' of tab 3. * // w w w . ja va2 s.c o m * @return content of third tab */ private Layout buildTab3Content() { VerticalLayout tab3Content = new VerticalLayout(); tab3Content.setSpacing(true); tab3Content.setMargin(true); tab3Content.setSizeFull(); Label instructions = new Label( "<b>Instructions:</b> <i>Please select and click a sentence below in order to process the evaluation.</i>", Label.CONTENT_XHTML); tab3Content.addComponent(instructions); this.tableEvaluation = new Table("Evaluation process:"); tableEvaluation.setHeight("150px"); tableEvaluation.setWidth("100%"); tableEvaluation.setImmediate(true); tableEvaluation.setSelectable(true); tableEvaluation.setMultiSelect(false); tableEvaluation.setSortDisabled(false); tableEvaluation.addContainerProperty("ID", Integer.class, null); tableEvaluation.addContainerProperty("Sentence", String.class, null); tableEvaluation.addContainerProperty("Precision", Double.class, null); tableEvaluation.addContainerProperty("Recall", Double.class, null); tableEvaluation.addContainerProperty("F-Score", Double.class, null); tab3Content.addComponent(tableEvaluation); this.buttonNext2 = new Button("Next"); buttonNext2.setImmediate(true); buttonNext2.setDescription("Get the next sentence in table"); tab3Content.addComponent(buttonNext2); this.textAreaEvalSentence = new TextArea("Sentence:"); textAreaEvalSentence.setImmediate(false); textAreaEvalSentence.setReadOnly(true); textAreaEvalSentence.setRows(3); textAreaEvalSentence.setWidth("100%"); tab3Content.addComponent(textAreaEvalSentence); HorizontalLayout hlay1 = new HorizontalLayout(); this.listSelectGoldstandard = new ListSelect("Goldstandard:"); listSelectGoldstandard.setImmediate(true); listSelectGoldstandard.setHeight("120px"); listSelectGoldstandard.setWidth("100%"); listSelectGoldstandard.setNullSelectionAllowed(false); this.listSelectFramework = new ListSelect("Framework:"); listSelectFramework.setImmediate(true); listSelectFramework.setHeight("120px"); listSelectFramework.setWidth("100%"); listSelectFramework.setNullSelectionAllowed(false); hlay1.setSpacing(true); hlay1.setMargin(false); hlay1.setWidth("100%"); hlay1.addComponent(listSelectGoldstandard); hlay1.addComponent(listSelectFramework); tab3Content.addComponent(hlay1); return tab3Content; }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.ChangeProjectMetadataComponent.java
License:Open Source License
private void buildFormLayout() { final FieldGroup fieldGroup = new FieldGroup(); final FormLayout form2 = new FormLayout(); TextArea tf = new TextArea("Description"); tf.setWidth("50%"); tf.setHeight("50%"); fieldGroup.bind(tf, "Description"); tf.setCaption("Description"); tf.setDescription("Description of this project."); tf.setValue(currentDescription);/*from w w w . j ava 2 s.c om*/ form2.addComponent(tf); this.fieldGroup = fieldGroup; this.form = form2; }
From source file:dhbw.clippinggorilla.userinterface.windows.PreferencesWindow.java
private Component buildSupportTab(User user) { VerticalLayout root = new VerticalLayout(); root.setCaption(Language.get(Word.SUPPORT)); root.setIcon(VaadinIcons.HEADSET);/*from ww w . j av a 2 s . co m*/ root.setWidth("100%"); root.setHeight("100%"); root.setSpacing(true); root.setMargin(true); TextArea textAreaMessage = new TextArea(Language.get(Word.MESSAGE)); textAreaMessage.setWidth("100%"); textAreaMessage.setHeight("100%"); Button buttonSend = new Button(Language.get(Word.SEND), VaadinIcons.ENVELOPE); buttonSend.addStyleName(ValoTheme.BUTTON_PRIMARY); buttonSend.addClickListener(ce -> { try { if (emailsSend.containsKey(user)) { Map<LocalDate, Integer> times = emailsSend.get(user); if (times.containsKey(LocalDate.now())) { if (times.get(LocalDate.now()) > 3) { if (times.get(LocalDate.now()) > 15) { UserUtils.banUser(user); VaadinUtils.errorNotification("BANNED DUE TO TOO MUCH EMAILS"); } else { VaadinUtils.errorNotification("TOO MUCH EMAILS"); } return; } else { times.put(LocalDate.now(), times.get(LocalDate.now()) + 1); } } else { times.put(LocalDate.now(), 1); } } else { HashMap<LocalDate, Integer> times = new HashMap<>(); times.put(LocalDate.now(), 1); emailsSend.put(user, times); } Mail.send(Props.get("supportmail"), "SUPPORT", user.toString() + "\n" + textAreaMessage.getValue()); VaadinUtils.middleInfoNotification(Language.get(Word.SUCCESSFULLY_SEND)); textAreaMessage.clear(); } catch (EmailException ex) { VaadinUtils.errorNotification(Language.get(Word.SEND_FAILED)); Log.error("Could not send Supportmail: ", ex); } }); root.addComponents(textAreaMessage, buttonSend); root.setExpandRatio(textAreaMessage, 5); root.setComponentAlignment(buttonSend, Alignment.MIDDLE_LEFT); return root; }
From source file:dhbw.ka.mwi.businesshorizon2.ui.initialscreen.projectlist.ProjectListViewImpl.java
License:Open Source License
/** * Zeige das Projekt-Hinzufuegen-Dialogfenster, bei dem ein Eingabefeld fuer * den Namen des Projekts und ein Hinzfuege-Button vorhanden ist. Funktion * bei geklicktem Button siehe Clicklistener in dieser Klasse. Das * horizontale Layout zur Darstellung besitzt ein Formlayout und den Button, * die nebeneinander dargestellt werden. * /*w ww . j a v a 2 s .c om*/ * @author Christian Scherer, Mirko Gpfrich */ @Override public void showAddProjectDialog() { addDialog = new Window("Projekt hinzufgen"); addDialog.setModal(true); addDialog.setWidth(410, UNITS_PIXELS); addDialog.setResizable(false); addDialog.setDraggable(false); VerticalLayout layout = new VerticalLayout(); layout.setSpacing(false); FormLayout formLayout = new FormLayout(); formLayout.setMargin(true); formLayout.setSpacing(true); //TextFeld fr Name dem Formular hinzufgen tfName = new TextField("Name whlen:"); tfName.setRequired(true); tfName.addValidator(new StringLengthValidator("Der Projektname muss zwischen 2 und 20 Zeichen lang sein.", 2, 20, false)); tfName.setRequiredError("Pflichtfeld"); tfName.setSizeFull(); formLayout.addComponent(tfName); //TextArea fr Beschreibung dem Formular hinzufgen taDescription = new TextArea("Beschreibung whlen"); taDescription.setSizeFull(); formLayout.addComponent(taDescription); //Formular dem Layout hinzufgen layout.addComponent(formLayout); //Hinzufge-Button erstllen und dem Layout hinzufgen dialogAddBtn = new Button("Hinzufgen", this); layout.addComponent(dialogAddBtn); //Layout dem Dialog-Fenster hinzufgen addDialog.addComponent(layout); //Dialog dem Hauptfenster hinzufgen getWindow().addWindow(addDialog); logger.debug("Hinzufuege-Dialog erzeugt"); }
From source file:edu.kit.dama.ui.admin.AbstractBasePropertiesLayout.java
License:Apache License
/** * Returns the TextArea holding the description of the element. * * @return The descriptionArea./*from w w w .j a v a 2 s . c om*/ */ public final TextArea getDescriptionArea() { if (descriptionArea == null) { String id = "descriptionArea"; LOGGER.debug("Building " + DEBUG_ID_PREFIX + id + " ..."); descriptionArea = new TextArea("DESCRIPTION"); descriptionArea.setId(DEBUG_ID_PREFIX + id); descriptionArea.setSizeFull(); descriptionArea.setRows(8); descriptionArea.setImmediate(true); descriptionArea.setNullRepresentation(""); descriptionArea.addStyleName(CSSTokenContainer.BOLD_CAPTION); } return descriptionArea; }
From source file:edu.kit.dama.ui.admin.administration.usergroup.UserGroupForm.java
License:Apache License
private TextArea getDescriptionArea() { if (descriptionArea == null) { String id = "descriptionArea"; LOGGER.debug("Building " + DEBUG_ID_PREFIX + id + " ..."); descriptionArea = new TextArea("DESCRIPTION"); descriptionArea.setId(DEBUG_ID_PREFIX + id); descriptionArea.setSizeFull();/* w w w.ja v a2s.c om*/ descriptionArea.setReadOnly(true); descriptionArea.setNullRepresentation(""); descriptionArea.addStyleName(CSSTokenContainer.BOLD_CAPTION); } return descriptionArea; }
From source file:edu.kit.dama.ui.admin.administration.usergroup.UserGroupForm.java
License:Apache License
private TextArea getNewGroupDescriptionField() { if (newGroupDescriptionField == null) { String id = "newGroupDescriptionField"; LOGGER.debug("Building " + DEBUG_ID_PREFIX + id + " ..."); newGroupDescriptionField = new TextArea("DESCRIPTION"); newGroupDescriptionField.setId(DEBUG_ID_PREFIX + id); newGroupDescriptionField.setWidth("100%"); newGroupDescriptionField.setRows(3); newGroupDescriptionField.setNullRepresentation(""); newGroupDescriptionField.addStyleName(CSSTokenContainer.BOLD_CAPTION); }//from w w w . j ava 2s . com return newGroupDescriptionField; }
From source file:edu.kit.dama.ui.admin.schedule.trigger.AbstractTriggerConfigurationPanel.java
License:Apache License
/** * Get the description area./* w w w . j av a 2s. c om*/ * * @return The description area. */ public final TextArea getDescriptionField() { if (descriptionField == null) { descriptionField = new TextArea("DESCRIPTION"); descriptionField.setSizeFull(); descriptionField.setRows(8); descriptionField.setImmediate(true); descriptionField.setNullRepresentation(""); descriptionField.setNullSettingAllowed(true); descriptionField.addStyleName(CSSTokenContainer.BOLD_CAPTION); } return descriptionField; }
From source file:edu.kit.dama.ui.admin.workflow.property.AbstractPropertyConfigurationPanel.java
License:Apache License
/** * Get the description area./*from w w w .ja v a 2 s.c o m*/ * * @return The description area. */ public final TextArea getDescriptionField() { if (descriptionField == null) { descriptionField = new TextArea("DESCRIPTION"); descriptionField.setSizeFull(); descriptionField.setRows(8); descriptionField.setImmediate(true); descriptionField.setNullRepresentation(""); descriptionField.addStyleName(CSSTokenContainer.BOLD_CAPTION); } return descriptionField; }
From source file:edu.kit.dama.ui.admin.workflow.property.LinuxSoftwareMapPropertyConfigurationPanel.java
License:Apache License
/** * Get the primary site field./*from ww w . java2 s . com*/ */ private TextArea getPrimarySiteArea() { if (primarySiteField == null) { primarySiteField = new TextArea("PRIMARY SITE"); primarySiteField.setSizeFull(); primarySiteField.setRows(5); primarySiteField.setImmediate(true); primarySiteField.setRequired(true); primarySiteField.setNullRepresentation(""); primarySiteField.addStyleName(CSSTokenContainer.BOLD_CAPTION); primarySiteField.setInputPrompt( "e.g. ftp.kit.edu/downloads/foobar/\n10kB foobar-1.2.3.bin.tar.gz\nfoobar-1.2.3.src.tar.gz"); } return primarySiteField; }