@@ -268,7 +268,24 @@ public <G> void setColumnReadOnlyField(
268268 String title ,
269269 ObjectDataElementKeyExtractor <E , G > keyextractor ,
270270 int grouping ) {
271- setColumnReadOnlyField (title ,keyextractor .fieldExtractor (),keyextractor .labelExtractor (),grouping );
271+ setColumnReadOnlyField (title , keyextractor .fieldExtractor (), keyextractor .labelExtractor (),keyextractor .keyExtractor (), grouping );
272+ }
273+
274+ /**
275+ * A read-only column field
276+ *
277+ * @param title title of the column
278+ * @param keyextractor extractor of the field
279+ * @param grouping grouping criteria as a static int in the class
280+ * @param keyexception values to discard in the consolidation
281+ */
282+ public <G > void setColumnReadOnlyField (
283+ String title ,
284+ ObjectDataElementKeyExtractor <E , G > keyextractor ,
285+ int grouping ,
286+ String keyexception ) {
287+ setColumnReadOnlyField (title , keyextractor .fieldExtractor (), keyextractor .labelExtractor (),
288+ keyextractor .keyExtractor (), grouping , keyexception );
272289 }
273290
274291 /**
@@ -277,14 +294,39 @@ public <G> void setColumnReadOnlyField(
277294 * @param title title of the column
278295 * @param payloadextractor extractor of the field from the payload
279296 * @param displaygenerator generates the display value from the field
297+ * @param keygenerator generates the key value from the field
280298 * @param grouping grouping criteria as a static int in the class
281299 */
282300 public <G > void setColumnReadOnlyField (
283301 String title ,
284302 Function <E , G > payloadextractor ,
285303 Function <G , String > displaygenerator ,
304+ Function <G , String > keygenerator ,
286305 int grouping ) {
287- ReadOnlyColumn <G > column = new ReadOnlyColumn <G >(title , payloadextractor , displaygenerator , grouping );
306+ ReadOnlyColumn <
307+ G > column = new ReadOnlyColumn <G >(title , payloadextractor , displaygenerator , keygenerator , grouping );
308+ this .columngroups .add (column );
309+ }
310+
311+ /**
312+ * A read-only column field
313+ *
314+ * @param title title of the column
315+ * @param payloadextractor extractor of the field from the payload
316+ * @param displaygenerator generates the display value from the field
317+ * @param keygenerator generates the key value from the field
318+ * @param grouping grouping criteria as a static int in the class
319+ * @param keyexception values to discard in the consolidation
320+ */
321+ public <G > void setColumnReadOnlyField (
322+ String title ,
323+ Function <E , G > payloadextractor ,
324+ Function <G , String > displaygenerator ,
325+ Function <G , String > keygenerator ,
326+ int grouping ,
327+ String keyexception ) {
328+ ReadOnlyColumn <G > column = new ReadOnlyColumn <G >(title , payloadextractor , displaygenerator , keygenerator ,grouping ,
329+ keyexception );
288330 this .columngroups .add (column );
289331 }
290332
@@ -367,10 +409,10 @@ public Node getNode() {
367409 @ Override
368410 public void handle (MouseEvent event ) {
369411 if (treetableview .isEditable ()) {
370- logger .severe ("Sink event as editable mode" );
412+ logger .fine ("Sink event as editable mode" );
371413 } else {
372414 if (event .getClickCount () > 1 && (event .getButton ().equals (MouseButton .PRIMARY ))) {
373- logger .severe (" >>> Proper Event" );
415+ logger .fine (" >>> Proper Event" );
374416 if (readonlyactioneventhandler != null ) {
375417
376418 ObservableList <
@@ -976,17 +1018,37 @@ private class ReadOnlyColumn<G extends Object>
9761018 private String title ;
9771019 private Function <E , G > payloadextractor ;
9781020 private Function <G , String > displaygenerator ;
1021+ private Function <G , String > keyextractor ;
9791022 private int grouping ;
1023+ private String keyexception ;
9801024
9811025 public ReadOnlyColumn (
9821026 String title ,
9831027 Function <E , G > payloadextractor ,
9841028 Function <G , String > displaygenerator ,
1029+ Function <G , String > keyextractor ,
9851030 int grouping ) {
9861031 this .title = title ;
9871032 this .payloadextractor = payloadextractor ;
9881033 this .displaygenerator = displaygenerator ;
1034+ this .keyextractor = keyextractor ;
1035+ this .grouping = grouping ;
1036+ this .keyexception = null ;
1037+ }
1038+
1039+ public ReadOnlyColumn (
1040+ String title ,
1041+ Function <E , G > payloadextractor ,
1042+ Function <G , String > displaygenerator ,
1043+ Function <G , String > keyextractor ,
1044+ int grouping ,
1045+ String keyexception ) {
1046+ this .title = title ;
1047+ this .payloadextractor = payloadextractor ;
1048+ this .displaygenerator = displaygenerator ;
1049+ this .keyextractor = keyextractor ;
9891050 this .grouping = grouping ;
1051+ this .keyexception = keyexception ;
9901052 }
9911053
9921054 @ Override
@@ -1012,23 +1074,35 @@ public ObservableValue<String> call(
10121074 }
10131075 if (grouping == GROUPING_SAME ) {
10141076 boolean burnt = false ;
1077+ logger .fine ("Starting analysis for a cell -----------------------------" );
10151078 for (int i = 0 ; i < listofobjects .getItemsNumber (); i ++) {
10161079 E object = listofobjects .getItemAt (i ).getPayload ();
10171080 G payload = payloadextractor .apply (object );
1081+
10181082 String value = null ;
1019- if (payload != null )
1083+ String key =null ;
1084+ if (payload != null ) {
10201085 value = displaygenerator .apply (payload );
1086+ key = keyextractor .apply (payload );
1087+ logger .fine (" analyzing element value '" +value +"', key '" +key +"', valueexception = '" +keyexception +"'" );
1088+ }
10211089 if (result == null )
1022- if (!burnt ) {
1090+ if (!burnt ) if ( key != null ) if (! key . equals ( keyexception )) {
10231091 result = value ;
1092+ logger .fine (" put in value " +result +" as '" +key +"' <> '" +keyexception +"'" );
10241093 logger .finest (" > found value " + value + " for " + object .toString ());
10251094 }
10261095 if (result != null )
1027- if (!result .equals (value )) {
1028- burnt = true ;
1029- result = null ;
1030- }
1096+ if (!result .equals (value ))
1097+ if (key !=null ) if (!key .equals (keyexception )) {
1098+ logger .fine (" value " +value +" burning " +result );
1099+ burnt = true ;
1100+ result = null ;
1101+
1102+ }
1103+
10311104 }
1105+ logger .fine (" --> " +result +", burnt = " +burnt );
10321106 }
10331107 if (grouping == GROUPING_FIRST ) {
10341108 if (listofobjects .getItemsNumber () >= 1 ) {
0 commit comments