![JAR search and dependency download from the Maven repository](/logo.png)
io.imunity.vaadin.auth.extensions.credreset.TextFieldWithContextLabel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unity-server-vaadin-authentication Show documentation
Show all versions of unity-server-vaadin-authentication Show documentation
Vaadin login view and components
/*
* Copyright (c) 2018 Bixbit - Krzysztof Benedyczak. All rights reserved.
* See LICENCE.txt file for licensing information.
*/
package io.imunity.vaadin.auth.extensions.credreset;
import com.vaadin.flow.component.textfield.TextField;
import io.imunity.vaadin.elements.ComponentWithLabel;
/**
* Depending on configuration label may be put as placeholder or as a standard caption of this textfield
*/
public class TextFieldWithContextLabel extends TextField
{
private final boolean showLabelInline;
public TextFieldWithContextLabel(boolean showLabelInline)
{
this.showLabelInline = showLabelInline;
}
@Override
public void setLabel(String label)
{
String normalizedLabel = ComponentWithLabel.normalizeLabel(label);
if (showLabelInline)
setPlaceholder(normalizedLabel);
else
super.setLabel(normalizedLabel + ":");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy