public static void setHiddenOn ( final UIObject uiObject , final DeviceSize deviceSize ) { // Split the enum up by _ to get the different devices // Separates the SM_MD into [SM, MD] so we can add the right styles final String [ ] deviceString = deviceSize . name ( ) . split ( "_" ) ; for ( final String device : deviceString ) { // Case back to basic enum (PRINT, XS, SM, MD, LG) final DeviceSize size = DeviceSize . valueOf ( device ) ; switch ( size ) { case PRINT : addEnumStyleName ( uiObject , Responsiveness . HIDDEN_PRINT ) ; break ; case XS : addEnumStyleName ( uiObject , Responsiveness . HIDDEN_XS ) ; break ; case SM : addEnumStyleName ( uiObject , Responsiveness . HIDDEN_SM ) ; break ; case MD : addEnumStyleName ( uiObject , Responsiveness . HIDDEN_MD ) ; break ; case LG : addEnumStyleName ( uiObject , Responsiveness . HIDDEN_LG ) ; break ; default : break ; } } }
Sets the ui object to be hidden on the device size