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

com.talk2object.plum.interaction.viewbuilder.ObjectViewBuilder Maven / Gradle / Ivy

package com.talk2object.plum.interaction.viewbuilder;

import com.talk2object.plum.interaction.viewgeneneration.AbstractViewBuilder;
import com.talk2object.plum.interaction.viewgeneneration.ViewBuildContext;
import com.talk2object.plum.interaction.viewgeneneration.ViewClass;
import com.talk2object.plum.view._abstract.components.Label;
import com.talk2object.plum.view._abstract.window.UIComponent;

public class ObjectViewBuilder extends AbstractViewBuilder {

	@Override
	public UIComponent build(Object model, String viewClassExpr,
			ViewBuildContext context, UIComponent parentView) {

		if (ViewClass.matches(ViewClass.SHOW, viewClassExpr)) {
			String text = model.toString();
			Label label = new Label();
			label.setText(text);

			return label;
		}

		return super.build(model, viewClassExpr, context, parentView);
	}

	@Override
	public Class getModelClass() {

		return Object.class;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy