All files / src/ui/lib zcl_abapgit_gui_in_page_modal.clas.abap

100% Statements 82/82
100% Branches 0/0
100% Functions 0/0
100% Lines 82/82

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 831x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
CLASS zcl_abapgit_gui_in_page_modal DEFINITION
  PUBLIC
  CREATE PUBLIC.
 
  PUBLIC SECTION.
 
    INTERFACES zif_abapgit_gui_renderable.
 
    CLASS-METHODS create
      IMPORTING
        !ii_child      TYPE REF TO zif_abapgit_gui_renderable
        !iv_width      TYPE i OPTIONAL
        !iv_height     TYPE i OPTIONAL
      RETURNING
        VALUE(ro_wrap) TYPE REF TO zcl_abapgit_gui_in_page_modal
      RAISING
        zcx_abapgit_exception .
    METHODS constructor
      IMPORTING
        !ii_child  TYPE REF TO zif_abapgit_gui_renderable
        !iv_width  TYPE i OPTIONAL
        !iv_height TYPE i OPTIONAL.
 
  PROTECTED SECTION.
  PRIVATE SECTION.
 
    DATA mi_child TYPE REF TO zif_abapgit_gui_renderable.
 
    DATA:
      BEGIN OF ms_attrs,
        width  TYPE i,
        height TYPE i,
      END OF ms_attrs.
 
ENDCLASS.
 
 
 
CLASS zcl_abapgit_gui_in_page_modal IMPLEMENTATION.
 
 
  METHOD constructor.
 
    ms_attrs-width  = iv_width.
    ms_attrs-height = iv_height.
    mi_child        = ii_child.
 
  ENDMETHOD.
 
 
  METHOD create.
    CREATE OBJECT ro_wrap
      EXPORTING
        ii_child  = ii_child
        iv_width  = iv_width
        iv_height = iv_height.
  ENDMETHOD.
 
 
  METHOD zif_abapgit_gui_renderable~render.
 
    DATA lo_style TYPE REF TO zcl_abapgit_string_buffer.
 
    CREATE OBJECT ri_html TYPE zcl_abapgit_html.
    CREATE OBJECT lo_style.
 
    IF ms_attrs-width IS NOT INITIAL.
      lo_style->add( |width:{ ms_attrs-width }px;| ).
    ENDIF.
    IF ms_attrs-height IS NOT INITIAL.
      lo_style->add( |height:{ ms_attrs-height }px;| ).
    ENDIF.
 
    ri_html->add( |<div class="modal" style="{ lo_style->join_w_space_and_flush( ) }">| ).
    ri_html->add( |<div class="modal-guts">| ).
    ri_html->add( mi_child->render( ) ).
    ri_html->add( |</div>| ).
    ri_html->add( |</div>| ).
    ri_html->add( |<div class="modal-overlay"></div>| ).
 
  ENDMETHOD.
ENDCLASS.