28
28
import org .dominokit .domino .ui .datatable .plugins .HasPluginConfig ;
29
29
import org .dominokit .domino .ui .datatable .plugins .tree .events .TreeRowCollapsedEvent ;
30
30
import org .dominokit .domino .ui .datatable .plugins .tree .events .TreeRowExpandedEvent ;
31
+ import org .dominokit .domino .ui .datatable .plugins .tree .events .TreeRowOnBeforeCollapseEvent ;
32
+ import org .dominokit .domino .ui .datatable .plugins .tree .events .TreeRowOnBeforeExpandEvent ;
31
33
import org .dominokit .domino .ui .elements .DivElement ;
32
34
import org .dominokit .domino .ui .icons .Icon ;
33
35
import org .dominokit .domino .ui .icons .ToggleIcon ;
@@ -80,7 +82,8 @@ public boolean requiresUtilityColumn() {
80
82
* @param row {@link org.dominokit.domino.ui.datatable.TableRow} to be expanded
81
83
* @param recursive boolean, if true will recursively expand the row children
82
84
*/
83
- public final void expandRow (TableRow <T > row , boolean recursive ) {
85
+ public void expandRow (TableRow <T > row , boolean recursive ) {
86
+ this .dataTable .fireTableEvent (new TreeRowOnBeforeExpandEvent <>(row ));
84
87
if (config .isLazy ()) {
85
88
TreeGridRowSubItemsMeta .get (row )
86
89
.ifPresent (
@@ -119,6 +122,7 @@ public final void expandRow(TableRow<T> row, boolean recursive) {
119
122
if (row .isRoot ()) {
120
123
increment ();
121
124
}
125
+ this .dataTable .fireTableEvent (new TreeRowExpandedEvent <>(row ));
122
126
}
123
127
}
124
128
@@ -221,7 +225,7 @@ private void applyIndent(TableRow<T> tableRow) {
221
225
*
222
226
* @param row {@link org.dominokit.domino.ui.datatable.TableRow} to be expanded
223
227
*/
224
- public final void expandRow (TableRow <T > row ) {
228
+ public void expandRow (TableRow <T > row ) {
225
229
expandRow (row , true );
226
230
}
227
231
@@ -231,7 +235,7 @@ public final void expandRow(TableRow<T> row) {
231
235
*
232
236
* @param recursive boolean, if true will recursively expand the row children
233
237
*/
234
- public final void expandAllRows (boolean recursive ) {
238
+ public void expandAllRows (boolean recursive ) {
235
239
dataTable .getRows ().forEach (tableRow -> expandRow (tableRow , recursive ));
236
240
}
237
241
@@ -240,12 +244,12 @@ public final void expandAllRows(boolean recursive) {
240
244
*
241
245
* @param row {@link org.dominokit.domino.ui.datatable.TableRow} to be collapsed
242
246
*/
243
- public final void collapseRow (TableRow <T > row ) {
247
+ public void collapseRow (TableRow <T > row ) {
244
248
collapse (row );
245
249
}
246
250
247
251
/** Collapse all table row */
248
- public final void collapseAllRows () {
252
+ public void collapseAllRows () {
249
253
dataTable .getRows ().forEach (this ::collapseRow );
250
254
}
251
255
@@ -273,6 +277,7 @@ private void showRow(TableRow<T> row) {
273
277
}
274
278
275
279
private void collapse (TableRow <T > row ) {
280
+ this .dataTable .fireTableEvent (new TreeRowOnBeforeCollapseEvent <>(row ));
276
281
Optional <TreeGridRowToggleIcon > iconMeta = row .getMeta (TREE_GRID_ROW_TOGGLE_ICON );
277
282
iconMeta .ifPresent (
278
283
meta -> {
0 commit comments