litesoft
@ 948
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
package org.litesoft.initfrom.client.boviews; import org.litesoft.bo.*; import org.litesoft.bo.attributes.*; import org.litesoft.bo.views.*; import org.litesoft.core.util.*; public abstract class StoryViewMetaDataGO extends AbstractVoMetaData<StoryView> implements StoryViewNames { public static synchronized StoryViewMetaData getInstance() { if ( sInstance == null ) { sInstance = new StoryViewMetaData(); } return sInstance; } @Override public StoryView createViewObject( boolean pNew, TransactionSet pTransactionSet ) { return new StoryView( pNew, pTransactionSet ); } @Override public String getDerivedFromRegisteredObjectType() { return "Story"; } @Override public ObjectUniqueKey createObjectUniqueKey( BoAccessor pBoAccessor ) { StoryView zView = (StoryView) pBoAccessor; return zView.isNew() ? createNewObjectUniqueKey( pBoAccessor ) : ObjectUniqueKey.createExisting( zView.getID() ); } @Override public String getDisplayValueFormat() { return null; } private static StoryViewMetaData sInstance = null; protected StoryViewMetaDataGO() { super( StoryView.class, createLocals() ); } private static VoAttributeList<StoryView> createLocals() { VoAttribute[] zAttributes = // { // new SimpleVoAttribute<StoryView>( aID, false, _Long.AddOnly() ) { @Override public String getDerivedFromAttributePath() { return null; } @Override public boolean isQueryViewAttribute() { return false; } @Override protected Object LLgetAttributeValue( StoryView pVO ) { return pVO.getID(); } @Override public void setAttributeValue( StoryView pVO, Object pValue ) { pVO.setID( TypeConverter.to_Long( pValue ) ); } }, // new SimpleVoAttribute<StoryView>( aCreatorFullName, false, _String.RO().with( MaxLength.of( 60 ), // DisplayLength.of( 40 ) ) ) { @Override public String getDerivedFromAttributePath() { return "Creator.FullName"; } @Override public boolean isQueryViewAttribute() { return false; } @Override protected Object LLgetAttributeValue( StoryView pVO ) { return pVO.getCreatorFullName(); } @Override public void setAttributeValue( StoryView pVO, Object pValue ) { pVO.setCreatorFullName( TypeConverter.to_String( pValue ) ); } }, // new SimpleVoAttribute<StoryView>( aDescription, false, _Text.with( DisplayWidthInitial.of( 40 ), // DisplayHeightInitial.of( 4 ) ) ) { @Override public String getDerivedFromAttributePath() { return "Description"; } @Override public boolean isQueryViewAttribute() { return false; } @Override protected Object LLgetAttributeValue( StoryView pVO ) { return pVO.getDescription(); } @Override public void setAttributeValue( StoryView pVO, Object pValue ) { pVO.setDescription( TypeConverter.to_String( pValue ) ); } }, // new SimpleVoAttribute<StoryView>( aIsDone, false, _Boolean ) { @Override public String getDerivedFromAttributePath() { return "IsDone"; } @Override public boolean isQueryViewAttribute() { return false; } @Override protected Object LLgetAttributeValue( StoryView pVO ) { return pVO.getIsDone(); } @Override public void setAttributeValue( StoryView pVO, Object pValue ) { pVO.setIsDone( TypeConverter.to_Boolean( pValue ) ); } }, // new SimpleVoAttribute<StoryView>( aName, true, _String.with( MaxLength.of( 40 ), // DisplayLength.of( 20 ) ) ) { @Override public String getDerivedFromAttributePath() { return "Name"; } @Override public boolean isQueryViewAttribute() { return true; } @Override protected Object LLgetAttributeValue( StoryView pVO ) { return pVO.getName(); } @Override public void setAttributeValue( StoryView pVO, Object pValue ) { pVO.setName( TypeConverter.to_String( pValue ) ); } }, // new SimpleVoAttribute<StoryView>( aPriority, false, _Float.with( DisplayLength.of( 9 ) ) ) { @Override public String getDerivedFromAttributePath() { return "Priority"; } @Override public boolean isQueryViewAttribute() { return false; } @Override protected Object LLgetAttributeValue( StoryView pVO ) { return pVO.getPriority(); } @Override public void setAttributeValue( StoryView pVO, Object pValue ) { pVO.setPriority( TypeConverter.to_Float( pValue ) ); } }, // new SimpleVoAttribute<StoryView>( aStoryTemplateName, false, _String.with( MaxLength.of( 40 ), // DisplayLength.of( 20 ) ) ) { @Override public String getDerivedFromAttributePath() { return "StoryTemplate.Name"; } @Override public boolean isQueryViewAttribute() { return false; } @Override protected Object LLgetAttributeValue( StoryView pVO ) { return pVO.getStoryTemplateName(); } @Override public void setAttributeValue( StoryView pVO, Object pValue ) { pVO.setStoryTemplateName( TypeConverter.to_String( pValue ) ); } }, // }; return new VoAttributeList<StoryView>( zAttributes ); } } |