Samples / Controls / sap.tnt

InfoLabel

InfoLabel with all available color schemes

Class
z2ui5_cl_smpc_app_113
Repository
abap2UI5/samples-controls
Ports
sap.tnt.sample.InfoLabel
UI5 libraries
sap.m, sap.tnt, sap.ui.core
Lowest UI5 release
1.74
In the browser
Runs in the playground
Controls it builds
sap.m.FlexBox, sap.m.ScrollContainer, sap.m.Text, sap.tnt.InfoLabel, sap.ui.core.mvc.View

The class

" @keywords infolabel info label sap.tnt status labels scrollcontainer flexbox text
" @summary InfoLabel with all available color schemes
" @origin sap.tnt.sample.InfoLabel - https://sdk.openui5.org/entity/sap.tnt.InfoLabel/sample/sap.tnt.sample.InfoLabel (status: reviewed - read against the original, not run)
CLASS z2ui5_cl_smpc_app_113 DEFINITION PUBLIC.

  PUBLIC SECTION.
    INTERFACES z2ui5_if_app.

  PROTECTED SECTION.
    DATA client TYPE REF TO z2ui5_if_client.
    METHODS view_display.

  PRIVATE SECTION.
ENDCLASS.


CLASS z2ui5_cl_smpc_app_113 IMPLEMENTATION.

  METHOD z2ui5_if_app~main.

    me->client = client.
    IF client->check_on_navigated( ).
      view_display( ).
    ENDIF.

  ENDMETHOD.


  METHOD view_display.

    DATA(view) = z2ui5_cl_ui5_view_builder=>factory( ).

    view->ele( n = `View` ns = `mvc`
        )->a( n = `xmlns`     v = `sap.m`
        )->a( n = `xmlns:mvc` v = `sap.ui.core.mvc`
        )->a( n = `xmlns:tnt` v = `sap.tnt`
        )->a( n = `height`    v = `100%`

        )->ele( `ScrollContainer`
            )->a( n = `vertical` v = `true`
            )->a( n = `height`   v = `100%`

            )->ele( `FlexBox`
                )->a( n = `direction`  v = `Column`
                )->a( n = `alignItems` v = `Start`
                )->a( n = `class`      v = `sapUiMediumMargin`

                )->ele( `FlexBox`
                    )->a( n = `direction`  v = `Row`
                    )->a( n = `alignItems` v = `Start`
                    )->a( n = `class`      v = `sapUiTinyMarginBottom`

                    )->tag( `Text`
                        )->a( n = `text`  v = `Color Scheme 1`
                        )->a( n = `class` v = `sapUiTinyMarginEnd`
                    )->tag( n = `InfoLabel` ns = `tnt`
                        )->a( n = `id`          v = `il1`
                        )->a( n = `text`        v = `2`
                        )->a( n = `renderMode`  v = `Narrow`
                        )->a( n = `colorScheme` v = `1`

                )->end(
                )->ele( `FlexBox`
                    )->a( n = `direction`  v = `Row`
                    )->a( n = `alignItems` v = `Start`
                    )->a( n = `class`      v = `sapUiTinyMarginBottom`

                    )->tag( `Text`
                        )->a( n = `text`  v = `Color Scheme 2`
                        )->a( n = `class` v = `sapUiTinyMarginEnd`
                    )->tag( n = `InfoLabel` ns = `tnt`
                        )->a( n = `id`          v = `il2`
                        )->a( n = `text`        v = `5`
                        )->a( n = `renderMode`  v = `Narrow`
                        )->a( n = `colorScheme` v = `2`

                )->end(
                )->ele( `FlexBox`
                    )->a( n = `direction`  v = `Row`
                    )->a( n = `alignItems` v = `Start`
                    )->a( n = `class`      v = `sapUiTinyMarginBottom`

                    )->tag( `Text`
                        )->a( n = `text`  v = `Color Scheme 3`
                        )->a( n = `class` v = `sapUiTinyMarginEnd`
                    )->tag( n = `InfoLabel` ns = `tnt`
                        )->a( n = `id`          v = `il3`
                        )->a( n = `text`        v = `12.5`
                        )->a( n = `renderMode`  v = `Narrow`
                        )->a( n = `colorScheme` v = `3`

                )->end(
                )->ele( `FlexBox`
                    )->a( n = `direction`  v = `Row`
                    )->a( n = `alignItems` v = `Start`
                    )->a( n = `class`      v = `sapUiTinyMarginBottom`

                    )->tag( `Text`
                        )->a( n = `text`  v = `Color Scheme 4`
                        )->a( n = `class` v = `sapUiTinyMarginEnd`
                    )->tag( n = `InfoLabel` ns = `tnt`
                        )->a( n = `id`          v = `il4`
                        )->a( n = `text`        v = `2k`
                        )->a( n = `renderMode`  v = `Narrow`
                        )->a( n = `colorScheme` v = `4`

                )->end(
                )->ele( `FlexBox`
                    )->a( n = `direction`  v = `Row`
                    )->a( n = `alignItems` v = `Start`
                    )->a( n = `class`      v = `sapUiTinyMarginBottom`

                    )->tag( `Text`
                        )->a( n = `text`  v = `Color Scheme 5`
                        )->a( n = `class` v = `sapUiTinyMarginEnd`
                    )->tag( n = `InfoLabel` ns = `tnt`
                        )->a( n = `id`          v = `il5`
                        )->a( n = `text`        v = `text info label`
                        )->a( n = `renderMode`  v = `Loose`
                        )->a( n = `colorScheme` v = `5`

                )->end(
                )->ele( `FlexBox`
                    )->a( n = `direction`  v = `Row`
                    )->a( n = `alignItems` v = `Start`
                    )->a( n = `class`      v = `sapUiTinyMarginBottom`

                    )->tag( `Text`
                        )->a( n = `text`  v = `Color Scheme 6`
                        )->a( n = `class` v = `sapUiTinyMarginEnd`
                    )->tag( n = `InfoLabel` ns = `tnt`
                        )->a( n = `id`          v = `il6`
                        )->a( n = `text`        v = `just a long info label`
                        )->a( n = `colorScheme` v = `6`
                        )->a( n = `width`       v = `140px`

                )->end(
                )->ele( `FlexBox`
                    )->a( n = `direction`  v = `Row`
                    )->a( n = `alignItems` v = `Start`
                    )->a( n = `class`      v = `sapUiTinyMarginBottom`

                    )->tag( `Text`
                        )->a( n = `text`  v = `Color Scheme 7`
                        )->a( n = `class` v = `sapUiTinyMarginEnd`
                    )->tag( n = `InfoLabel` ns = `tnt`
                        )->a( n = `id`          v = `il7`
                        )->a( n = `text`        v = `label shorter than width`
                        )->a( n = `colorScheme` v = `7`
                        )->a( n = `width`       v = `250px`

                )->end(
                )->ele( `FlexBox`
                    )->a( n = `direction`  v = `Row`
                    )->a( n = `alignItems` v = `Start`
                    )->a( n = `class`      v = `sapUiTinyMarginBottom`

                    )->tag( `Text`
                        )->a( n = `text`  v = `Color Scheme 8`
                        )->a( n = `class` v = `sapUiTinyMarginEnd`
                    )->tag( n = `InfoLabel` ns = `tnt`
                        )->a( n = `id`          v = `il8`
                        )->a( n = `text`        v = `with icon`
                        )->a( n = `colorScheme` v = `8`
                        )->a( n = `icon`        v = `sap-icon://home-share`

                )->end(
                )->ele( `FlexBox`
                    )->a( n = `direction`  v = `Row`
                    )->a( n = `alignItems` v = `Start`
                    )->a( n = `class`      v = `sapUiTinyMarginBottom`

                    )->tag( `Text`
                        )->a( n = `text`  v = `Color Scheme 9`
                        )->a( n = `class` v = `sapUiTinyMarginEnd`
                    )->tag( n = `InfoLabel` ns = `tnt`
                        )->a( n = `id`          v = `il9`
                        )->a( n = `text`        v = `in warehouse`
                        )->a( n = `colorScheme` v = `9`

                )->end(
                )->ele( `FlexBox`
                    )->a( n = `direction`  v = `Row`
                    )->a( n = `alignItems` v = `Start`
                    )->a( n = `class`      v = `sapUiTinyMarginBottom`

                    )->tag( `Text`
                        )->a( n = `text`  v = `Any Color Scheme in Display Only Mode`
                        )->a( n = `class` v = `sapUiTinyMarginEnd`
                    )->tag( n = `InfoLabel` ns = `tnt`
                        )->a( n = `id`          v = `il10`
                        )->a( n = `text`        v = `display only in form`
                        )->a( n = `colorScheme` v = `1`
                        )->a( n = `displayOnly` v = `true`

                )->end( ).

    client->view_display( view->stringify( ) ).

  ENDMETHOD.

ENDCLASS.