#include "UIText.h" UITextElement::UITextElement() : UIElement() {} void UITextElement::setText(const Framework::Text& text) { this->text = text; } const Framework::Text& UITextElement::getText() const { return text; } Framework::XML::Element* UITextElement::toUIML( Framework::Either zTarget, Entity* zActor) const { Framework::XML::Element* result = UIElement::toUIML(zTarget, zActor); result->setName("text"); result->setText(text); return result; } UITextElementFactory::UITextElementFactory() : UIElementFactory() {} JSONObjectValidationBuilder* UITextElementFactory::addToValidator( JSONObjectValidationBuilder* builder) const { return UIElementFactory::addToValidator(builder) ->withRequiredString("text") ->finishString(); } UITextElement* UITextElementFactory::fromJson( Framework::JSON::JSONObject* zJson) const { UITextElement* result = UIElementFactory::fromJson(zJson); result->setText(zJson->zValue("text")->asString()->getString()); return result; } Framework::JSON::JSONObject* UITextElementFactory::toJsonObject( UITextElement* zObject) const { Framework::JSON::JSONObject* result = UIElementFactory::toJsonObject(zObject); result->addValue( "text", new Framework::JSON::JSONString(zObject->getText())); return result; } UITextElement* UITextElementFactory::createElement( Framework::JSON::JSONObject* zJson) const { return new UITextElement(); } const char* UITextElementFactory::getTypeToken() const { return "text"; }