// ----------> GENERATED FILE - DON'T TOUCH! <---------- // generator: ilarkesto.mda.legacy.generator.GwtEntityGenerator package scrum.client.collaboration; import java.util.*; import ilarkesto.persistence.*; import ilarkesto.core.logging.Log; import ilarkesto.base.*; import ilarkesto.base.time.*; import ilarkesto.auth.*; import scrum.client.common.*; import ilarkesto.gwt.client.*; public abstract class GChatMessage extends scrum.client.common.AScrumGwtEntity { protected scrum.client.Dao getDao() { return scrum.client.Dao.get(); } public GChatMessage() { } public GChatMessage(Map data) { super(data); updateProperties(data); } public static final String ENTITY_TYPE = "chatMessage"; @Override public final String getEntityType() { return ENTITY_TYPE; } // --- project --- private String projectId; public final scrum.client.project.Project getProject() { if (projectId == null) return null; return getDao().getProject(this.projectId); } public final boolean isProjectSet() { return projectId != null; } public final ChatMessage setProject(scrum.client.project.Project project) { String id = project == null ? null : project.getId(); if (equals(this.projectId, id)) return (ChatMessage) this; this.projectId = id; propertyChanged("projectId", this.projectId); return (ChatMessage)this; } public final boolean isProject(scrum.client.project.Project project) { return equals(this.projectId, project); } // --- author --- private String authorId; public final scrum.client.admin.User getAuthor() { if (authorId == null) return null; return getDao().getUser(this.authorId); } public final boolean isAuthorSet() { return authorId != null; } public final ChatMessage setAuthor(scrum.client.admin.User author) { String id = author == null ? null : author.getId(); if (equals(this.authorId, id)) return (ChatMessage) this; this.authorId = id; propertyChanged("authorId", this.authorId); return (ChatMessage)this; } public final boolean isAuthor(scrum.client.admin.User author) { return equals(this.authorId, author); } // --- text --- private java.lang.String text ; public final java.lang.String getText() { return this.text ; } public final ChatMessage setText(java.lang.String text) { if (isText(text)) return (ChatMessage)this; this.text = text ; propertyChanged("text", this.text); return (ChatMessage)this; } public final boolean isText(java.lang.String text) { return equals(this.text, text); } private transient TextModel textModel; public TextModel getTextModel() { if (textModel == null) textModel = createTextModel(); return textModel; } protected TextModel createTextModel() { return new TextModel(); } protected class TextModel extends ilarkesto.gwt.client.editor.ATextEditorModel { @Override public String getId() { return "ChatMessage_text"; } @Override public java.lang.String getValue() { return getText(); } @Override public void setValue(java.lang.String value) { setText(value); } @Override public boolean isMandatory() { return true; } @Override public boolean isRichtext() { return true; } @Override protected void onChangeValue(java.lang.String oldValue, java.lang.String newValue) { super.onChangeValue(oldValue, newValue); addUndo(this, oldValue); } } // --- dateAndTime --- private ilarkesto.gwt.client.DateAndTime dateAndTime ; public final ilarkesto.gwt.client.DateAndTime getDateAndTime() { return this.dateAndTime ; } public final ChatMessage setDateAndTime(ilarkesto.gwt.client.DateAndTime dateAndTime) { if (isDateAndTime(dateAndTime)) return (ChatMessage)this; this.dateAndTime = dateAndTime ; propertyChanged("dateAndTime", this.dateAndTime); return (ChatMessage)this; } public final boolean isDateAndTime(ilarkesto.gwt.client.DateAndTime dateAndTime) { return equals(this.dateAndTime, dateAndTime); } private transient DateAndTimeModel dateAndTimeModel; public DateAndTimeModel getDateAndTimeModel() { if (dateAndTimeModel == null) dateAndTimeModel = createDateAndTimeModel(); return dateAndTimeModel; } protected DateAndTimeModel createDateAndTimeModel() { return new DateAndTimeModel(); } protected class DateAndTimeModel extends ilarkesto.gwt.client.editor.ADateAndTimeEditorModel { @Override public String getId() { return "ChatMessage_dateAndTime"; } @Override public ilarkesto.gwt.client.DateAndTime getValue() { return getDateAndTime(); } @Override public void setValue(ilarkesto.gwt.client.DateAndTime value) { setDateAndTime(value); } @Override protected void onChangeValue(ilarkesto.gwt.client.DateAndTime oldValue, ilarkesto.gwt.client.DateAndTime newValue) { super.onChangeValue(oldValue, newValue); addUndo(this, oldValue); } } // --- update properties by map --- public void updateProperties(Map props) { projectId = (String) props.get("projectId"); authorId = (String) props.get("authorId"); text = (java.lang.String) props.get("text"); String dateAndTimeAsString = (String) props.get("dateAndTime"); dateAndTime = dateAndTimeAsString == null ? null : new ilarkesto.gwt.client.DateAndTime(dateAndTimeAsString); } @Override public void storeProperties(Map properties) { super.storeProperties(properties); properties.put("projectId", this.projectId); properties.put("authorId", this.authorId); properties.put("text", this.text); properties.put("dateAndTime", this.dateAndTime == null ? null : this.dateAndTime.toString()); } }