List of usage examples for com.vaadin.ui TextField TextField
public TextField(ValueChangeListener<String> valueChangeListener)
From source file:de.decidr.ui.view.windows.FieldBuilder.java
License:Apache License
@Override public Field createControl(TTaskItem taskItem, String value) { TextField field = new TextField(taskItem.getLabel()); field.addValidator(new IntegerValidator("Please enter an Integer!")); field.setImmediate(true);/*from w w w. j a v a 2s . c o m*/ field.setValue(value); return field; }
From source file:de.decidr.ui.view.windows.FieldBuilder.java
License:Apache License
@Override public Field createControl(TTaskItem taskItem, String value) { /*//w w w . ja v a 2s. c o m * FIXME implement */ TextField field = new TextField("Das ist fr Decidr+"); field.setReadOnly(true); return field; }
From source file:de.decidr.ui.view.windows.FieldBuilder.java
License:Apache License
/** * Create and add a Vaadin control to edit the given {@link TTaskItem}.<br> * /* w w w .j a v a2 s . c o m*/ * @param form to manipulate (most not be <code>null</code>).<br> * In particular, this method may call either addField, or * addComponent of the form's corresponding Layout. * @param taskItem that the new control should edit. * (must not be <code>null</code>. */ public void addControl(Form form, TTaskItem taskItem) { /* * FIXME are you sure this is really a W3C DOM String? Since JAXB maps * xsd:anySimpleType to "Object", I'd expect this to be an instance of * String, Boolean, Integer, etc. Please beat me to death with a pointy * burning stick if I broke the class with my changes ~dh */ String value = taskItem.getValue() == null ? "" : taskItem.getValue().toString(); FieldBuilder fieldBuilder = fieldBuilders.get(taskItem.getType()); if (fieldBuilder != null) { Object control = fieldBuilder.createControl(taskItem, value); if (control instanceof Field) { ((Field) control).setDescription(taskItem.getHint()); form.addField(taskItem.getName(), (Field) control); } else { ((AbstractComponent) control).setDescription(taskItem.getHint()); form.getLayout().addComponent((Component) control); } } else { // TODO Better error handling form.addField("error", new TextField("Unknown field type: " + taskItem.getType())); } }
From source file:de.escidoc.admintool.view.context.CloseContextModalWindow.java
License:Open Source License
private CloseContextModalWindow commentTextField() { commentField = new TextField("Comment"); commentField.setWidth("400px"); commentField.setRows(3);/* www .ja va2 s. c om*/ subwindow.addComponent(commentField); return this; }
From source file:de.escidoc.admintool.view.context.OpenContextModalWindow.java
License:Open Source License
private OpenContextModalWindow commentTextField() { commentField = new TextField("Comment"); commentField.setWidth("400px"); commentField.setRows(3);//from ww w. ja v a2 s . com subwindow.addComponent(commentField); return this; }
From source file:de.escidoc.admintool.view.resource.OrgUnitSpecificView.java
License:Open Source License
private void addParentField() { parentsField = new TextField(ViewConstants.PARENTS_LABEL); parentsField.setReadOnly(true);//w w w.j a va 2 s.c o m parentsField.setWidth("300px"); editParentBtn.setStyleName(Reindeer.BUTTON_SMALL); removeParentBtn.setStyleName(Reindeer.BUTTON_SMALL); hLayout.setSpacing(true); hLayout.addComponent(parentsField); hLayout.addComponent(editParentBtn); hLayout.addComponent(removeParentBtn); fieldByName.put("parents", parentsField); formLayout.addComponent(parentsField); formLayout.addComponent(hLayout); }
From source file:de.escidoc.admintool.view.resource.OrgUnitSpecificView.java
License:Open Source License
private void addCoordinates() { coordinatesField = new TextField(ViewConstants.COORDINATES_LABEL); coordinatesField.setWidth(ViewConstants.FIELD_WIDTH); configure(coordinatesField);/*from w w w .j ava2 s . co m*/ fieldByName.put("coordinates", coordinatesField); formLayout.addComponent(coordinatesField); }
From source file:de.escidoc.admintool.view.resource.OrgUnitSpecificView.java
License:Open Source License
private void addOrgType() { typeField = new TextField(ViewConstants.TYPE_LABEL); typeField.setWidth(ViewConstants.FIELD_WIDTH); configure(typeField);// w w w.ja va 2 s . co m fieldByName.put("type", typeField); formLayout.addComponent(typeField); }
From source file:de.escidoc.admintool.view.resource.OrgUnitSpecificView.java
License:Open Source License
private void addIdentifierField() { identifierField = new TextField(ViewConstants.IDENTIFIER_LABEL); identifierField.setWidth(ViewConstants.FIELD_WIDTH); configure(identifierField);//from w ww . j a v a 2 s. c om fieldByName.put("identifier", identifierField); formLayout.addComponent(identifierField); }
From source file:de.escidoc.admintool.view.resource.OrgUnitSpecificView.java
License:Open Source License
private void addAlternativeTitleField() { alternativeField = new TextField(ViewConstants.ALTERNATIVE_LABEL); alternativeField.setWidth(ViewConstants.FIELD_WIDTH); configure(alternativeField);//from w ww .j a v a 2 s .c o m fieldByName.put("alternative", alternativeField); formLayout.addComponent(alternativeField); }