@ SuppressWarnings ( "unchecked" ) public static < T > void defaultHandleContextMenuForMultiselect ( Table table , CmsContextMenu menu , ItemClickEvent event , List < I_CmsSimpleContextMenuEntry < Collection < T > > > entries ) { if ( ! event . isCtrlKey ( ) && ! event . isShiftKey ( ) ) { if ( event . getButton ( ) . equals ( MouseButton . RIGHT ) ) { Collection < T > oldValue = ( ( Collection < T > ) table . getValue ( ) ) ; if ( oldValue . isEmpty ( ) || ! oldValue . contains ( event . getItemId ( ) ) ) { table . setValue ( new HashSet < Object > ( Arrays . asList ( event . getItemId ( ) ) ) ) ; } Collection < T > selection = ( Collection < T > ) table . getValue ( ) ; menu . setEntries ( entries , selection ) ; menu . openForTable ( event , table ) ; } } }
Simple context menu handler for multi - select tables .