com.talk2object.plum.interaction.rich.field.component.FileFieldViewBuilder Maven / Gradle / Ivy
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