All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.imunity.vaadin.elements.FocusedField Maven / Gradle / Ivy

/*
 * Copyright (c) 2021 Bixbit - Krzysztof Benedyczak. All rights reserved.
 * See LICENCE.txt file for licensing information.
 */

package io.imunity.vaadin.elements;

import com.vaadin.flow.component.HasValue;

public class FocusedField
{
	private HasValue field;
	private int cursorPosition;

	public void set(HasValue field, int cursorPosition)
	{
		this.field = field;
		this.cursorPosition = cursorPosition;
	}

	public boolean isSet()
	{
		return field != null;
	}

	public String getValue()
	{
		return field.getValue();
	}

	public String getLocale()
	{
		return ((LocalizedTextField)field).locale.getLanguage();
	}

	public void setValue(String value)
	{
		field.setValue(value);
	}

	public int getCursorPosition()
	{
		return cursorPosition;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy