Java Code Examples for com.vaadin.ui.TextField#setNullRepresentation()

The following examples show how to use com.vaadin.ui.TextField#setNullRepresentation() . 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: TargetDetails.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private HorizontalLayout getSecurityTokenLayout(final String securityToken) {
    final HorizontalLayout securityTokenLayout = new HorizontalLayout();

    final Label securityTableLbl = new Label(
            SPUIComponentProvider.getBoldHTMLText(getI18n().getMessage("label.target.security.token")),
            ContentMode.HTML);
    securityTableLbl.addStyleName(SPUIDefinitions.TEXT_STYLE);
    securityTableLbl.addStyleName("label-style");

    final TextField securityTokentxt = new TextField();
    securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS);
    securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_TINY);
    securityTokentxt.addStyleName("targetDtls-securityToken");
    securityTokentxt.addStyleName(SPUIDefinitions.TEXT_STYLE);
    securityTokentxt.setCaption(null);
    securityTokentxt.setNullRepresentation("");
    securityTokentxt.setValue(securityToken);
    securityTokentxt.setReadOnly(true);

    securityTokenLayout.addComponent(securityTableLbl);
    securityTokenLayout.addComponent(securityTokentxt);
    return securityTokenLayout;
}
 
Example 2
Source File: SignUpViewImpl.java    From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 5 votes vote down vote up
private void buildForm() {
	username = new TextField("Username");
	username.setWidth("100%");
	username.setImmediate(true);
	username.setValidationVisible(false);
	username.setNullRepresentation("");
	username.setRequired(true);		
	form.addComponent(username);
	
	password = new PasswordField("Password");
	password.setWidth("100%");
	password.setImmediate(true);
	password.setValidationVisible(false);
	password.setNullRepresentation("");
	password.setRequired(true);
	form.addComponent(password);
	
	firstName = new TextField("First name");
	firstName.setWidth("100%");
	firstName.setValidationVisible(false);
	firstName.setNullRepresentation("");
	firstName.setImmediate(true);
	firstName.setRequired(true);
	form.addComponent(firstName);
	
	lastName = new TextField("Last name");
	lastName.setWidth("100%");
	lastName.setImmediate(true);
	lastName.setNullRepresentation("");
	lastName.setValidationVisible(false);
	lastName.setRequired(true);
	form.addComponent(lastName);
	
	binder.bind(username, "username");
	binder.bind(password, "password");
	binder.bind(firstName, "firstName");
	binder.bind(lastName, "lastName");	
}
 
Example 3
Source File: VariableDefinitionEditorWindow.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// textFieldID
	textFieldID = new TextField();
	textFieldID.setCaption("Variable ID");
	textFieldID.setImmediate(false);
	textFieldID.setWidth("-1px");
	textFieldID.setHeight("-1px");
	textFieldID.setInvalidAllowed(false);
	textFieldID.setRequired(true);
	textFieldID.setNullRepresentation("");
	mainLayout.addComponent(textFieldID);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save and Continue");
	buttonSave.setImmediate(false);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example 4
Source File: FormUtils.java    From jdal with Apache License 2.0 5 votes vote down vote up
/**
 * Create a new {@link TextField}
 * @return new TextField with null representation set to empty string
 */
public static TextField newTextField() {
	TextField tf = new TextField();
	tf.setNullRepresentation("");
	
	return tf;
}
 
Example 5
Source File: SignInViewImpl.java    From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 4 votes vote down vote up
@Override
public void postConstruct() {	
	super.postConstruct();		
	setSizeFull();
	layout = new VerticalLayout();
	layout.setSizeFull();
	layout.setSpacing(true);
	setCompositionRoot(layout);
	
	caption = new Label("Sign in to Vaadin4Spring Security Demo");
	caption.addStyleName(ValoTheme.LABEL_H2);
	caption.setSizeUndefined();		
	layout.addComponent(caption);
	layout.setComponentAlignment(caption, Alignment.MIDDLE_CENTER);
	
	loginPanel = new VerticalLayout();
	loginPanel.setSizeUndefined();
	loginPanel.setSpacing(true);
	loginPanel.setMargin(true);
	layout.addComponent(loginPanel);
	layout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
	layout.setExpandRatio(loginPanel, 1);
	
	errorMessage = new Label();
	errorMessage.setWidth("300px");
	errorMessage.addStyleName(ValoTheme.LABEL_FAILURE);		
	errorMessage.setVisible(false);
	loginPanel.addComponent(errorMessage);
	
	username = new TextField("Username");
	username.setImmediate(true);
	username.setWidth("300px");
	username.setNullRepresentation("");
	username.setInputPrompt("Enter your username");
	loginPanel.addComponent(username);
	
	password = new PasswordField("Password");
	password.setImmediate(true);
	password.setWidth("300px");
	password.setNullRepresentation("");
	loginPanel.addComponent(password);
	
	rememberMe = new CheckBox("Remember me");
	rememberMe.setValue(false);
	rememberMe.addStyleName(ValoTheme.CHECKBOX_LARGE);
	loginPanel.addComponent(rememberMe);
	
	btnLogin = new Button("Signin", FontAwesome.UNLOCK);
	btnLogin.addStyleName(ValoTheme.BUTTON_PRIMARY);
	btnLogin.addClickListener(this);
	btnLogin.setWidth("100%");
	loginPanel.addComponent(btnLogin);							
	
	final Label infoLabel = new Label(FontAwesome.INFO_CIRCLE.getHtml() + " You can sign in as: <br/>\"user\" with password \"user\" <br/>\"admin\" with password \"admin\".", ContentMode.HTML);
	infoLabel.setWidth("300px");
	loginPanel.addComponent(infoLabel);
}