public static void applyStatusLblStyle ( final Table targetTable , final Button pinBtn , final Object itemId ) { final Item item = targetTable . getItem ( itemId ) ; if ( item != null ) { final TargetUpdateStatus updateStatus = ( TargetUpdateStatus ) item . getItemProperty ( SPUILabelDefinitions . VAR_TARGET_STATUS ) . getValue ( ) ; pinBtn . removeStyleName ( "statusIconRed statusIconBlue statusIconGreen statusIconYellow statusIconLightBlue" ) ; if ( updateStatus == TargetUpdateStatus . ERROR ) { pinBtn . addStyleName ( SPUIStyleDefinitions . STATUS_ICON_RED ) ; } else if ( updateStatus == TargetUpdateStatus . UNKNOWN ) { pinBtn . addStyleName ( SPUIStyleDefinitions . STATUS_ICON_BLUE ) ; } else if ( updateStatus == TargetUpdateStatus . IN_SYNC ) { pinBtn . addStyleName ( SPUIStyleDefinitions . STATUS_ICON_GREEN ) ; } else if ( updateStatus == TargetUpdateStatus . PENDING ) { pinBtn . addStyleName ( SPUIStyleDefinitions . STATUS_ICON_YELLOW ) ; } else if ( updateStatus == TargetUpdateStatus . REGISTERED ) { pinBtn . addStyleName ( SPUIStyleDefinitions . STATUS_ICON_LIGHT_BLUE ) ; } } }
Apply style for status label in target table .