All files / src/ui/flow zcl_abapgit_flow_exit.clas.abap

83.33% Statements 60/72
100% Branches 0/0
0% Functions 0/1
83.33% Lines 60/72

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 731x 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_flow_exit DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .
 
  PUBLIC SECTION.
 
    INTERFACES zif_abapgit_flow_exit .
 
    CLASS-METHODS get_instance
      RETURNING
        VALUE(ri_exit) TYPE REF TO zif_abapgit_flow_exit.
  PROTECTED SECTION.
  PRIVATE SECTION.
 
    CLASS-DATA gi_global_exit TYPE REF TO zif_abapgit_flow_exit.
    CLASS-DATA gi_exit TYPE REF TO zif_abapgit_flow_exit.
ENDCLASS.
 
 
 
CLASS ZCL_ABAPGIT_FLOW_EXIT IMPLEMENTATION.
 
 
  METHOD get_instance.
* this exit only works with global classes
 
    IF gi_global_exit IS NOT INITIAL.
      ri_exit = gi_global_exit.
      RETURN.
    ENDIF.
 
    TRY.
        CREATE OBJECT gi_exit TYPE ('ZCL_ABAPGIT_FLOW_USER_EXIT').
      CATCH cx_sy_create_object_error ##NO_HANDLER.
    ENDTRY.
 
    CREATE OBJECT gi_global_exit TYPE zcl_abapgit_flow_exit. " this class
 
    ri_exit = gi_global_exit.
 
  ENDMETHOD.
 
 
  METHOD zif_abapgit_flow_exit~on_event.
 
    IF gi_exit IS NOT INITIAL.
      TRY.
          rs_result = gi_exit->on_event(
           ii_event    = ii_event
           it_features = it_features ).
        CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER.
      ENDTRY.
    ENDIF.
 
  ENDMETHOD.
 
 
  METHOD zif_abapgit_flow_exit~toolbar_extras.

    IF gi_exit IS NOT INITIAL.
      TRY.
          gi_exit->toolbar_extras(
            io_toolbar = io_toolbar
            iv_index   = iv_index
            is_feature = is_feature ).
        CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER.
      ENDTRY.
    ENDIF.

  ENDMETHOD.
ENDCLASS.