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

com.talk2object.plum.interaction.rich.field.component.FileFieldViewBuilder 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.input.value.File;
import com.talk2object.plum.interaction.controller.AbstractController;
import com.talk2object.plum.interaction.controller.Controller;
import com.talk2object.plum.interaction.rich.field.AbstractComponentBridge;
import com.talk2object.plum.interaction.rich.field.ComponentBridge;
import com.talk2object.plum.interaction.rich.field.FileField;
import com.talk2object.plum.interaction.rich.field.InteractiveField;
import com.talk2object.plum.view._abstract.components.FileView;
import com.talk2object.plum.view._abstract.window.UIComponent;

public class FileFieldViewBuilder extends AbstractFieldViewBuilder {

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

		new AbstractController(
				input, fileView) {

			@Override
			public void updateViewState() {

				getView().setValue((File) getModel().getValue());
			}

			@Override
			public void updateModelState() {

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

		return component;

	}

	@Override
	public Class getModelClass() {

		return FileField.class;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy