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

com.talk2object.plum.interaction.rich.field.component.PasswordFieldViewBuilder Maven / Gradle / Ivy

There is a newer version: 0.1.22
Show newest version
package com.talk2object.plum.interaction.rich.field.component;

import com.talk2object.plum.interaction.controller.AbstractController;
import com.talk2object.plum.interaction.rich.field.AbstractComponentBridge;
import com.talk2object.plum.interaction.rich.field.ComponentBridge;
import com.talk2object.plum.interaction.rich.field.InteractiveField;
import com.talk2object.plum.interaction.rich.field.PasswordField;
import com.talk2object.plum.view._abstract.components.PasswordBox;
import com.talk2object.plum.view._abstract.components.TextBox;
import com.talk2object.plum.view._abstract.window.UIComponent;

public class PasswordFieldViewBuilder extends AbstractFieldViewBuilder {

	@Override
	protected UIComponent createComponent(InteractiveField input) {
		PasswordBox component = new PasswordBox();

		new AbstractController(
				input, component) {

			@Override
			public void updateViewState() {

				getView().setPassword(getModel().getValue().toString());
			}

			@Override
			public void updateModelState() {

				getModel().setValue(getView().getPassword());
			}
		};

		return component;
	}

	@Override
	public Class getModelClass() {

		return PasswordField.class;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy