@@ -755,35 +755,6 @@ public void generateToFile(SourceGenerator sg, Module module) throws IOException
755755
756756 sg .wl (" // Display Object" );
757757
758- // -------------------------------- Process Image Content
759-
760- for (int i = 0 ; i < dataobject .propertylist .getSize (); i ++) {
761- Property <?> thisproperty = dataobject .propertylist .get (i );
762- if (thisproperty instanceof ImageContent ) {
763- ImageContent imagecontent = (ImageContent ) thisproperty ;
764- String imagename = StringFormatter .formatForAttribute (imagecontent .getInstancename ());
765- String imageclass = StringFormatter .formatForJavaClass (imagecontent .getInstancename ());
766-
767- sg .wl (" // Display image " + imageclass + "" );
768- sg .wl (" AtgGetfullimagefor" + imagename + "for" + objectvariable + "Action.InlineActionRef "
769- + imagename + "fulldisplayaction = AtgGetfullimagefor" + imagename + "for" + objectvariable
770- + "Action.get().getInlineActionRef();" );
771- sg .wl (" SObjectIdStorage<Binaryfile> " + imagename
772- + "fullidstorage = new SObjectIdStorage<Binaryfile>(\" "
773- + imagecontent .getInstancename ().toUpperCase () + "FULLID\" ,this,this.get" + imageclass
774- + "fullimgid());" );
775- sg .wl (" " + mainobjectlocation + ".addElement(" + imagename + "fullidstorage);" );
776- sg .wl (" " + imagename + "fulldisplayaction.set" + objectclass
777- + "id(objectdisplaydefinition.getAttributeInput(" + objectclass + ".getIdMarker()));" );
778- sg .wl (" SImageDisplay " + imagename + "thumbnaildisplay = new SImageDisplay(\" "
779- + imagecontent .getInstancename ().toUpperCase () + "THUMBNAIL\" , this,this.get" + imageclass
780- + "tbn(), " + imagename + "fulldisplayaction,GetfileAction.get().getFileRef(),\" "
781- + StringFormatter .formatForJavaClass (imagecontent .getInstancename ()) + "\" );" );
782- sg .wl (" " + mainobjectlocation + ".addElement(" + imagename + "thumbnaildisplay);" );
783- sg .wl ("" );
784- }
785- }
786-
787758 // -------------------------------- Button band under object ------------
788759
789760 if (objectbuttonband ) {
@@ -1035,7 +1006,7 @@ public void generateToFile(SourceGenerator sg, Module module) throws IOException
10351006 sg .wl (" deletebutton.setConfirmationMessage(\" Are you sure you want to delete this " + dataobject .getLabel ()
10361007 + " ?\" );" );
10371008 sg .wl (" managepopup.addElement(deletebutton);" );
1038- }
1009+
10391010
10401011 if ((dataobject .IsIterated ()) || (dataobject .isVersioned ())) {
10411012
@@ -1149,6 +1120,96 @@ public void generateToFile(SourceGenerator sg, Module module) throws IOException
11491120 sg .wl (" objectbuttonband.addElement(showplanningbutton);" );
11501121
11511122 }
1123+
1124+ for (int i = 0 ; i < dataobject .propertylist .getSize (); i ++) {
1125+ Property <?> thisproperty = dataobject .propertylist .get (i );
1126+ if (thisproperty instanceof ImageContent ) {
1127+ ImageContent imagecontent = (ImageContent ) thisproperty ;
1128+ String imagename = StringFormatter .formatForAttribute (imagecontent .getInstancename ());
1129+
1130+ sg .wl ("// set image for " + imagename + "" );
1131+ sg .wl (" AtgSetimagecontentfor" + imagename + "for" + objectvariable
1132+ + "Action.ActionRef setimagecontentfor" + imagename + "action = AtgSetimagecontentfor"
1133+ + imagename + "for" + objectvariable + "Action.get().getActionRef();" );
1134+ sg .wl (" SImageChooser imagechooserfor" + imagename + " = new SImageChooser(\" "
1135+ + imagecontent .getInstancename ().toUpperCase () + "\" , this,160, setimagecontentfor" + imagename
1136+ + "action,\" Set as " + imagename + "\" );" );
1137+ sg .wl ("setimagecontentfor" + imagename + "action.set" + objectclass
1138+ + "(objectdisplaydefinition.getAttributeInput(" + objectclass + ".getIdMarker()));" );
1139+ sg .wl (" setimagecontentfor" + imagename + "action.setFullimage(imagechooserfor" + imagename
1140+ + ".getFullImageDataInput());" );
1141+ sg .wl (" setimagecontentfor" + imagename + "action.setThumbnail(imagechooserfor" + imagename
1142+ + ".getThumbnailImageDataInput());" );
1143+ sg .wl (" SPopupButton setimagecontentfor" + imagename + "button = new SPopupButton(this, imagechooserfor"
1144+ + imagename + ", \" set image for " + imagename + "\" ,\" allows to add an image as " + imagename
1145+ + " from either clipboard or file\" ,false,setimagecontentfor" + imagename + "action);" );
1146+ sg .wl (" objectbuttonband.addElement(setimagecontentfor" + imagename + "button);" );
1147+
1148+ }
1149+ }
1150+
1151+ for (int i = 0 ; i < dataobject .propertylist .getSize (); i ++) {
1152+ Property <?> thisproperty = dataobject .propertylist .get (i );
1153+ if (thisproperty instanceof PrintOut ) {
1154+ PrintOut printout = (PrintOut ) thisproperty ;
1155+ String printoutnamevariable = StringFormatter .formatForAttribute (printout .getInstancename ());
1156+
1157+ sg .wl (" // Preview " + printoutnamevariable + "" );
1158+ sg .wl (" AtgPreviewprintoutfor" + objectvariable + "for" + printoutnamevariable
1159+ + "Action.InlineActionRef preview" + printoutnamevariable + " = AtgPreviewprintoutfor"
1160+ + objectvariable + "for" + printoutnamevariable + "Action.get().getInlineActionRef();" );
1161+ sg .wl (" preview" + printoutnamevariable + ".set" + objectclass
1162+ + "id(objectdisplaydefinition.getAttributeInput(" + objectclass
1163+ + ".getDefinition().getIdMarker()));" );
1164+ sg .wl (" SActionButton " + printoutnamevariable
1165+ + "preview = new SActionButton(\" Preview Printout\" ,preview" + printoutnamevariable
1166+ + ",this);" );
1167+ sg .wl (" objectbuttonband.addElement(" + printoutnamevariable + "preview);" );
1168+ sg .wl (" SFileDownloader preview" + printoutnamevariable
1169+ + "downloader = new SFileDownloader(\" PREVIEWDOWNLOAD\" , this, preview" + printoutnamevariable
1170+ + ",AtgPreviewprintoutfor" + objectvariable + "for" + printoutnamevariable
1171+ + "Action.get().getPreviewRef());" );
1172+ sg .wl (" objectbuttonband.addElement(preview" + printoutnamevariable + "downloader);" );
1173+
1174+ }
1175+ }
1176+
1177+
1178+ sg .wl (" objectdisplaydefinition.addButtonBarUnderTitle(objectbuttonband);" );
1179+
1180+
1181+ }
1182+
1183+
1184+ // -------------------------------- Process Image Content
1185+
1186+ for (int i = 0 ; i < dataobject .propertylist .getSize (); i ++) {
1187+ Property <?> thisproperty = dataobject .propertylist .get (i );
1188+ if (thisproperty instanceof ImageContent ) {
1189+ ImageContent imagecontent = (ImageContent ) thisproperty ;
1190+ String imagename = StringFormatter .formatForAttribute (imagecontent .getInstancename ());
1191+ String imageclass = StringFormatter .formatForJavaClass (imagecontent .getInstancename ());
1192+
1193+ sg .wl (" // Display image " + imageclass + "" );
1194+ sg .wl (" AtgGetfullimagefor" + imagename + "for" + objectvariable + "Action.InlineActionRef "
1195+ + imagename + "fulldisplayaction = AtgGetfullimagefor" + imagename + "for" + objectvariable
1196+ + "Action.get().getInlineActionRef();" );
1197+ sg .wl (" SObjectIdStorage<Binaryfile> " + imagename
1198+ + "fullidstorage = new SObjectIdStorage<Binaryfile>(\" "
1199+ + imagecontent .getInstancename ().toUpperCase () + "FULLID\" ,this,this.get" + imageclass
1200+ + "fullimgid());" );
1201+ sg .wl (" " + mainobjectlocation + ".addElement(" + imagename + "fullidstorage);" );
1202+ sg .wl (" " + imagename + "fulldisplayaction.set" + objectclass
1203+ + "id(objectdisplaydefinition.getAttributeInput(" + objectclass + ".getIdMarker()));" );
1204+ sg .wl (" SImageDisplay " + imagename + "thumbnaildisplay = new SImageDisplay(\" "
1205+ + imagecontent .getInstancename ().toUpperCase () + "THUMBNAIL\" , this,this.get" + imageclass
1206+ + "tbn(), " + imagename + "fulldisplayaction,GetfileAction.get().getFileRef(),\" "
1207+ + StringFormatter .formatForJavaClass (imagecontent .getInstancename ()) + "\" );" );
1208+ sg .wl (" " + mainobjectlocation + ".addElement(" + imagename + "thumbnaildisplay);" );
1209+ sg .wl ("" );
1210+ }
1211+ }
1212+
11521213
11531214 // display all left links as field
11541215
@@ -1319,62 +1380,7 @@ public void generateToFile(SourceGenerator sg, Module module) throws IOException
13191380 }
13201381
13211382 }
1322- for (int i = 0 ; i < dataobject .propertylist .getSize (); i ++) {
1323- Property <?> thisproperty = dataobject .propertylist .get (i );
1324- if (thisproperty instanceof ImageContent ) {
1325- ImageContent imagecontent = (ImageContent ) thisproperty ;
1326- String imagename = StringFormatter .formatForAttribute (imagecontent .getInstancename ());
1327-
1328- sg .wl ("// set image for " + imagename + "" );
1329- sg .wl (" AtgSetimagecontentfor" + imagename + "for" + objectvariable
1330- + "Action.ActionRef setimagecontentfor" + imagename + "action = AtgSetimagecontentfor"
1331- + imagename + "for" + objectvariable + "Action.get().getActionRef();" );
1332- sg .wl (" SImageChooser imagechooserfor" + imagename + " = new SImageChooser(\" "
1333- + imagecontent .getInstancename ().toUpperCase () + "\" , this,160, setimagecontentfor" + imagename
1334- + "action,\" Set as " + imagename + "\" );" );
1335- sg .wl ("setimagecontentfor" + imagename + "action.set" + objectclass
1336- + "(objectdisplaydefinition.getAttributeInput(" + objectclass + ".getIdMarker()));" );
1337- sg .wl (" setimagecontentfor" + imagename + "action.setFullimage(imagechooserfor" + imagename
1338- + ".getFullImageDataInput());" );
1339- sg .wl (" setimagecontentfor" + imagename + "action.setThumbnail(imagechooserfor" + imagename
1340- + ".getThumbnailImageDataInput());" );
1341- sg .wl (" SPopupButton setimagecontentfor" + imagename + "button = new SPopupButton(this, imagechooserfor"
1342- + imagename + ", \" set image for " + imagename + "\" ,\" allows to add an image as " + imagename
1343- + " from either clipboard or file\" ,false,setimagecontentfor" + imagename + "action);" );
1344- sg .wl (" objectbuttonband.addElement(setimagecontentfor" + imagename + "button);" );
1345-
1346- }
1347- }
1348-
1349- for (int i = 0 ; i < dataobject .propertylist .getSize (); i ++) {
1350- Property <?> thisproperty = dataobject .propertylist .get (i );
1351- if (thisproperty instanceof PrintOut ) {
1352- PrintOut printout = (PrintOut ) thisproperty ;
1353- String printoutnamevariable = StringFormatter .formatForAttribute (printout .getInstancename ());
1354-
1355- sg .wl (" // Preview " + printoutnamevariable + "" );
1356- sg .wl (" AtgPreviewprintoutfor" + objectvariable + "for" + printoutnamevariable
1357- + "Action.InlineActionRef preview" + printoutnamevariable + " = AtgPreviewprintoutfor"
1358- + objectvariable + "for" + printoutnamevariable + "Action.get().getInlineActionRef();" );
1359- sg .wl (" preview" + printoutnamevariable + ".set" + objectclass
1360- + "id(objectdisplaydefinition.getAttributeInput(" + objectclass
1361- + ".getDefinition().getIdMarker()));" );
1362- sg .wl (" SActionButton " + printoutnamevariable
1363- + "preview = new SActionButton(\" Preview Printout\" ,preview" + printoutnamevariable
1364- + ",this);" );
1365- sg .wl (" objectbuttonband.addElement(" + printoutnamevariable + "preview);" );
1366- sg .wl (" SFileDownloader preview" + printoutnamevariable
1367- + "downloader = new SFileDownloader(\" PREVIEWDOWNLOAD\" , this, preview" + printoutnamevariable
1368- + ",AtgPreviewprintoutfor" + objectvariable + "for" + printoutnamevariable
1369- + "Action.get().getPreviewRef());" );
1370- sg .wl (" objectbuttonband.addElement(preview" + printoutnamevariable + "downloader);" );
1371-
1372- }
1373- }
1374-
1375- if (objectbuttonband ) {
1376- sg .wl (" " + mainobjectlocation + ".addElement(objectbuttonband);" );
1377- }
1383+
13781384
13791385 // ----------------------------------------------------------------------------------------
13801386 // -- DISPLAY WIDGETS --
0 commit comments