diff --git a/src/ui/core/zif_abapgit_gui_hotkey_ctl.intf.abap b/src/ui/core/zif_abapgit_gui_hotkey_ctl.intf.abap index d32db01c9..c25c874bc 100644 --- a/src/ui/core/zif_abapgit_gui_hotkey_ctl.intf.abap +++ b/src/ui/core/zif_abapgit_gui_hotkey_ctl.intf.abap @@ -1,16 +1,14 @@ INTERFACE zif_abapgit_gui_hotkey_ctl - PUBLIC . + PUBLIC. + METHODS register_hotkeys IMPORTING - ii_hotkeys TYPE REF TO zif_abapgit_gui_hotkeys. - + !it_hotkeys TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr. METHODS reset. - METHODS get_registered_hotkeys RETURNING VALUE(rt_registered_hotkeys) TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr RAISING zcx_abapgit_exception. - ENDINTERFACE. diff --git a/src/ui/core/zif_abapgit_gui_hotkeys.intf.abap b/src/ui/core/zif_abapgit_gui_hotkeys.intf.abap index 9941f9534..9bbbd925d 100644 --- a/src/ui/core/zif_abapgit_gui_hotkeys.intf.abap +++ b/src/ui/core/zif_abapgit_gui_hotkeys.intf.abap @@ -2,17 +2,18 @@ INTERFACE zif_abapgit_gui_hotkeys PUBLIC . TYPES: - BEGIN OF ty_hotkey_with_descr. - INCLUDE TYPE zif_abapgit_definitions=>ty_hotkey. - TYPES: - description TYPE string, - END OF ty_hotkey_with_descr . + BEGIN OF ty_hotkey_with_descr, + ui_component TYPE string, + action TYPE string, + hotkey TYPE string, + description TYPE string, + END OF ty_hotkey_with_descr . TYPES: ty_hotkeys_with_descr TYPE STANDARD TABLE OF ty_hotkey_with_descr WITH DEFAULT KEY WITH UNIQUE SORTED KEY action COMPONENTS ui_component action . - CLASS-METHODS get_hotkey_actions " TODO: try to refactor class-method + METHODS get_hotkey_actions RETURNING VALUE(rt_hotkey_actions) TYPE ty_hotkeys_with_descr . diff --git a/src/ui/zcl_abapgit_gui_hotkey_ctl.clas.abap b/src/ui/zcl_abapgit_gui_hotkey_ctl.clas.abap new file mode 100644 index 000000000..60d7181bc --- /dev/null +++ b/src/ui/zcl_abapgit_gui_hotkey_ctl.clas.abap @@ -0,0 +1,167 @@ +CLASS zcl_abapgit_gui_hotkey_ctl DEFINITION + PUBLIC + INHERITING FROM zcl_abapgit_gui_component + FINAL + CREATE PUBLIC. + + PUBLIC SECTION. + + INTERFACES zif_abapgit_gui_hotkeys. + INTERFACES zif_abapgit_gui_hotkey_ctl. + INTERFACES zif_abapgit_gui_renderable. + + CONSTANTS c_showhotkeys_action TYPE string VALUE `showHotkeys` ##NO_TEXT. + + CLASS-METHODS should_show_hint + RETURNING + VALUE(rv_yes) TYPE abap_bool. + PROTECTED SECTION. + PRIVATE SECTION. + + DATA: + mt_hotkeys TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr. + CLASS-DATA gv_hint_was_shown TYPE abap_bool . + + METHODS render_scripts + IMPORTING + !it_hotkeys TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr + RETURNING + VALUE(ri_html) TYPE REF TO zif_abapgit_html . +ENDCLASS. + + + +CLASS zcl_abapgit_gui_hotkey_ctl IMPLEMENTATION. + + + METHOD render_scripts. + + DATA lv_json TYPE string. + + FIELD-SYMBOLS: LIKE LINE OF it_hotkeys. + + lv_json = `{`. + + LOOP AT it_hotkeys ASSIGNING . + + IF sy-tabix > 1. + lv_json = lv_json && |,|. + ENDIF. + + lv_json = lv_json && | "{ -hotkey }" : "{ -action }" |. + + ENDLOOP. + + lv_json = lv_json && `}`. + + CREATE OBJECT ri_html TYPE zcl_abapgit_html. + ri_html->set_title( cl_abap_typedescr=>describe_by_object_ref( me )->get_relative_name( ) ). + ri_html->add( |setKeyBindings({ lv_json });| ). + + ENDMETHOD. + + + METHOD should_show_hint. + IF gv_hint_was_shown = abap_false. + rv_yes = abap_true. + gv_hint_was_shown = abap_true. + ENDIF. + ENDMETHOD. + + + METHOD zif_abapgit_gui_hotkeys~get_hotkey_actions. + + DATA ls_hotkey LIKE LINE OF rt_hotkey_actions. + + ls_hotkey-ui_component = 'Hotkeys'. + ls_hotkey-action = c_showhotkeys_action. + ls_hotkey-description = 'Show hotkeys help'. + ls_hotkey-hotkey = '?'. + INSERT ls_hotkey INTO TABLE rt_hotkey_actions. + + ENDMETHOD. + + + METHOD zif_abapgit_gui_hotkey_ctl~get_registered_hotkeys. + rt_registered_hotkeys = mt_hotkeys. + ENDMETHOD. + + + METHOD zif_abapgit_gui_hotkey_ctl~register_hotkeys. + + FIELD-SYMBOLS LIKE LINE OF it_hotkeys. + + " Compress duplicates + LOOP AT it_hotkeys ASSIGNING . + READ TABLE mt_hotkeys WITH KEY hotkey = -hotkey TRANSPORTING NO FIELDS. + IF sy-subrc = 0. " If found command with same hotkey + DELETE mt_hotkeys INDEX sy-tabix. " Later registered commands enjoys the priority + ENDIF. + APPEND TO mt_hotkeys. + ENDLOOP. + + ENDMETHOD. + + + METHOD zif_abapgit_gui_hotkey_ctl~reset. + CLEAR mt_hotkeys. + ENDMETHOD. + + + METHOD zif_abapgit_gui_renderable~render. + + DATA: + lv_hint TYPE string, + lt_registered_hotkeys TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr, + lv_hotkey TYPE string. + + FIELD-SYMBOLS LIKE LINE OF lt_registered_hotkeys. + + zif_abapgit_gui_hotkey_ctl~register_hotkeys( zif_abapgit_gui_hotkeys~get_hotkey_actions( ) ). + + CREATE OBJECT ri_html TYPE zcl_abapgit_html. + + lt_registered_hotkeys = zif_abapgit_gui_hotkey_ctl~get_registered_hotkeys( ). + SORT lt_registered_hotkeys BY ui_component description. + + register_deferred_script( render_scripts( lt_registered_hotkeys ) ). + + " Render hotkeys + ri_html->add( '
    ' ). + LOOP AT lt_registered_hotkeys ASSIGNING . + ri_html->add( |
  • | + && |{ -hotkey }| + && |{ -description }| + && |
  • | ). + ENDLOOP. + ri_html->add( '
' ). + + CLEAR lv_hotkey. + + READ TABLE lt_registered_hotkeys ASSIGNING + WITH KEY action = c_showhotkeys_action. + IF sy-subrc = 0. + lv_hotkey = -hotkey. + ENDIF. + + lv_hint = |Close window with upper right corner 'X'|. + IF lv_hotkey IS NOT INITIAL. + lv_hint = lv_hint && | or press '{ -hotkey }' again|. + ENDIF. + + ri_html = zcl_abapgit_gui_chunk_lib=>render_infopanel( + iv_div_id = 'hotkeys' + iv_title = 'Hotkeys' + iv_hint = lv_hint + iv_hide = abap_true + iv_scrollable = abap_false + io_content = ri_html ). + + IF lv_hotkey IS NOT INITIAL AND should_show_hint( ) = abap_true. + ri_html->add( |
| + && |Press '{ -hotkey }' to get keyboard shortcuts list| + && |
| ). + ENDIF. + + ENDMETHOD. +ENDCLASS. diff --git a/src/ui/zcl_abapgit_hotkeys.clas.xml b/src/ui/zcl_abapgit_gui_hotkey_ctl.clas.xml similarity index 89% rename from src/ui/zcl_abapgit_hotkeys.clas.xml rename to src/ui/zcl_abapgit_gui_hotkey_ctl.clas.xml index a817964a4..0b693d25c 100644 --- a/src/ui/zcl_abapgit_hotkeys.clas.xml +++ b/src/ui/zcl_abapgit_gui_hotkey_ctl.clas.xml @@ -3,7 +3,7 @@ - ZCL_ABAPGIT_HOTKEYS + ZCL_ABAPGIT_GUI_HOTKEY_CTL E abapGit hotkeys 1 diff --git a/src/ui/zcl_abapgit_gui_page_code_insp.clas.abap b/src/ui/zcl_abapgit_gui_page_code_insp.clas.abap index e2831626f..92b48989f 100644 --- a/src/ui/zcl_abapgit_gui_page_code_insp.clas.abap +++ b/src/ui/zcl_abapgit_gui_page_code_insp.clas.abap @@ -60,7 +60,7 @@ ENDCLASS. -CLASS ZCL_ABAPGIT_GUI_PAGE_CODE_INSP IMPLEMENTATION. +CLASS zcl_abapgit_gui_page_code_insp IMPLEMENTATION. METHOD ask_user_for_check_variant. @@ -185,7 +185,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_CODE_INSP IMPLEMENTATION. RETURN. ENDIF. - gui_services( )->get_hotkeys_ctl( )->register_hotkeys( me ). + gui_services( )->get_hotkeys_ctl( )->register_hotkeys( zif_abapgit_gui_hotkeys~get_hotkey_actions( ) ). ri_html->add( render_variant( mv_check_variant ) ). diff --git a/src/ui/zcl_abapgit_gui_page_main.clas.abap b/src/ui/zcl_abapgit_gui_page_main.clas.abap index ac0b63771..f5032b1ec 100644 --- a/src/ui/zcl_abapgit_gui_page_main.clas.abap +++ b/src/ui/zcl_abapgit_gui_page_main.clas.abap @@ -73,7 +73,8 @@ CLASS zcl_abapgit_gui_page_main IMPLEMENTATION. METHOD render_content. CREATE OBJECT ri_html TYPE zcl_abapgit_html. - gui_services( )->get_hotkeys_ctl( )->register_hotkeys( me ). + + gui_services( )->get_hotkeys_ctl( )->register_hotkeys( zif_abapgit_gui_hotkeys~get_hotkey_actions( ) ). IF mo_repo_overview IS INITIAL. CREATE OBJECT mo_repo_overview. diff --git a/src/ui/zcl_abapgit_gui_page_patch.clas.abap b/src/ui/zcl_abapgit_gui_page_patch.clas.abap index 4e14f8a08..f8d72773a 100644 --- a/src/ui/zcl_abapgit_gui_page_patch.clas.abap +++ b/src/ui/zcl_abapgit_gui_page_patch.clas.abap @@ -156,7 +156,7 @@ ENDCLASS. -CLASS ZCL_ABAPGIT_GUI_PAGE_PATCH IMPLEMENTATION. +CLASS zcl_abapgit_gui_page_patch IMPLEMENTATION. METHOD add_menu_begin. @@ -535,7 +535,8 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_PATCH IMPLEMENTATION. CLEAR: mv_pushed. ENDIF. - gui_services( )->get_hotkeys_ctl( )->register_hotkeys( me ). + gui_services( )->get_hotkeys_ctl( )->register_hotkeys( zif_abapgit_gui_hotkeys~get_hotkey_actions( ) ). + ri_html = super->render_content( ). register_deferred_script( render_scripts( ) ). diff --git a/src/ui/zcl_abapgit_gui_page_repo_view.clas.abap b/src/ui/zcl_abapgit_gui_page_repo_view.clas.abap index 5c3cedc19..ab5905e8d 100644 --- a/src/ui/zcl_abapgit_gui_page_repo_view.clas.abap +++ b/src/ui/zcl_abapgit_gui_page_repo_view.clas.abap @@ -757,7 +757,7 @@ CLASS zcl_abapgit_gui_page_repo_view IMPLEMENTATION. FIELD-SYMBOLS LIKE LINE OF lt_repo_items. - gui_services( )->get_hotkeys_ctl( )->register_hotkeys( me ). + gui_services( )->get_hotkeys_ctl( )->register_hotkeys( zif_abapgit_gui_hotkeys~get_hotkey_actions( ) ). gui_services( )->register_event_handler( me ). TRY. diff --git a/src/ui/zcl_abapgit_gui_page_stage.clas.abap b/src/ui/zcl_abapgit_gui_page_stage.clas.abap index 335bad7ee..4e09000fd 100644 --- a/src/ui/zcl_abapgit_gui_page_stage.clas.abap +++ b/src/ui/zcl_abapgit_gui_page_stage.clas.abap @@ -429,7 +429,7 @@ CLASS zcl_abapgit_gui_page_stage IMPLEMENTATION. ri_html->add( '' ). - gui_services( )->get_hotkeys_ctl( )->register_hotkeys( me ). + gui_services( )->get_hotkeys_ctl( )->register_hotkeys( zif_abapgit_gui_hotkeys~get_hotkey_actions( ) ). gui_services( )->get_html_parts( )->add_part( iv_collection = zcl_abapgit_gui_component=>c_html_parts-hidden_forms ii_part = render_deferred_hidden_events( ) ). diff --git a/src/ui/zcl_abapgit_hotkeys.clas.abap b/src/ui/zcl_abapgit_hotkeys.clas.abap deleted file mode 100644 index d2fb115ad..000000000 --- a/src/ui/zcl_abapgit_hotkeys.clas.abap +++ /dev/null @@ -1,358 +0,0 @@ -CLASS zcl_abapgit_hotkeys DEFINITION - PUBLIC - INHERITING FROM zcl_abapgit_gui_component - FINAL - CREATE PUBLIC . - - PUBLIC SECTION. - - INTERFACES zif_abapgit_gui_hotkey_ctl . - INTERFACES zif_abapgit_gui_hotkeys . - INTERFACES zif_abapgit_gui_renderable . - - CONSTANTS c_showhotkeys_action TYPE string VALUE `showHotkeys` ##NO_TEXT. - - CLASS-METHODS get_all_default_hotkeys - RETURNING - VALUE(rt_hotkey_actions) TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr - RAISING - zcx_abapgit_exception . - CLASS-METHODS should_show_hint - RETURNING - VALUE(rv_yes) TYPE abap_bool . - PROTECTED SECTION. - PRIVATE SECTION. - - DATA: - mt_hotkey_providers TYPE TABLE OF REF TO zif_abapgit_gui_hotkeys . - CLASS-DATA gv_hint_was_shown TYPE abap_bool . - CLASS-DATA gt_interface_implementations TYPE saboo_iimpt . - - CLASS-METHODS filter_relevant_classes - IMPORTING - !it_classes TYPE seo_relkeys - RETURNING - VALUE(rt_classes) TYPE seo_relkeys . - CLASS-METHODS get_class_package - IMPORTING - !iv_class_name TYPE seoclsname - RETURNING - VALUE(rv_package) TYPE devclass . - CLASS-METHODS get_referred_class_name - IMPORTING - !io_ref TYPE any - RETURNING - VALUE(rv_name) TYPE seoclsname . - CLASS-METHODS get_hotkeys_by_class_name - IMPORTING - !iv_class_name TYPE seoclsname - RETURNING - VALUE(rt_hotkeys) TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr . - CLASS-METHODS get_hotkeys_from_global_intf - RETURNING - VALUE(rt_hotkeys) TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr - RAISING - zcx_abapgit_exception . - CLASS-METHODS get_hotkeys_from_local_intf - RETURNING - VALUE(rt_hotkeys) TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr - RAISING - zcx_abapgit_exception . - CLASS-METHODS get_local_intf_implementations - RETURNING - VALUE(rt_interface_implementations) TYPE saboo_iimpt - RAISING - zcx_abapgit_exception . - METHODS render_scripts - IMPORTING - !it_hotkeys TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr - RETURNING - VALUE(ri_html) TYPE REF TO zif_abapgit_html . -ENDCLASS. - - - -CLASS zcl_abapgit_hotkeys IMPLEMENTATION. - - - METHOD filter_relevant_classes. - - DATA lv_this_class_name TYPE seoclsname. - DATA lv_this_class_pkg TYPE devclass. - DATA lv_class_pkg TYPE devclass. - DATA lo_dummy TYPE REF TO zcl_abapgit_hotkeys. - - FIELD-SYMBOLS LIKE LINE OF it_classes. - - lv_this_class_name = get_referred_class_name( lo_dummy ). - lv_this_class_pkg = get_class_package( lv_this_class_name ). - - LOOP AT it_classes ASSIGNING . - lv_class_pkg = get_class_package( -clsname ). - IF lv_class_pkg = lv_this_class_pkg. - APPEND TO rt_classes. - ENDIF. - ENDLOOP. - - ENDMETHOD. - - - METHOD get_all_default_hotkeys. - - IF zcl_abapgit_factory=>get_environment( )->is_merged( ) = abap_true. - rt_hotkey_actions = get_hotkeys_from_local_intf( ). - ELSE. - rt_hotkey_actions = get_hotkeys_from_global_intf( ). - ENDIF. - - ENDMETHOD. - - - METHOD get_class_package. - - SELECT SINGLE devclass FROM tadir - INTO rv_package - WHERE pgmid = 'R3TR' - AND object = 'CLAS' - AND obj_name = iv_class_name. - - ENDMETHOD. - - - METHOD get_hotkeys_by_class_name. - - CALL METHOD (iv_class_name)=>zif_abapgit_gui_hotkeys~get_hotkey_actions - RECEIVING - rt_hotkey_actions = rt_hotkeys. - - ENDMETHOD. - - - METHOD get_hotkeys_from_global_intf. - - DATA: lt_hotkey_actions LIKE rt_hotkeys, - lo_interface TYPE REF TO cl_oo_interface, - li_dummy TYPE REF TO zif_abapgit_gui_hotkeys, - lt_classes TYPE seo_relkeys. - - FIELD-SYMBOLS: LIKE LINE OF lt_classes. - - TRY. - lo_interface ?= cl_oo_class=>get_instance( get_referred_class_name( li_dummy ) ). - CATCH cx_class_not_existent. - RETURN. - ENDTRY. - - lt_classes = lo_interface->get_implementing_classes( ). - lt_classes = filter_relevant_classes( lt_classes ). " For security reasons - - LOOP AT lt_classes ASSIGNING . - lt_hotkey_actions = get_hotkeys_by_class_name( -clsname ). - INSERT LINES OF lt_hotkey_actions INTO TABLE rt_hotkeys. - ENDLOOP. - - ENDMETHOD. - - - METHOD get_hotkeys_from_local_intf. - - DATA lt_hotkey_actions LIKE rt_hotkeys. - DATA lt_interface_implementations TYPE saboo_iimpt. - FIELD-SYMBOLS LIKE LINE OF lt_interface_implementations. - DATA lv_hotkeys_class_name LIKE -refclsname. - DATA li_dummy TYPE REF TO zif_abapgit_gui_hotkeys. - - lv_hotkeys_class_name = get_referred_class_name( li_dummy ). - lt_interface_implementations = get_local_intf_implementations( ). - - LOOP AT lt_interface_implementations ASSIGNING WHERE refclsname = lv_hotkeys_class_name. - lt_hotkey_actions = get_hotkeys_by_class_name( -clsname ). - INSERT LINES OF lt_hotkey_actions INTO TABLE rt_hotkeys. - ENDLOOP. - - ENDMETHOD. - - - METHOD get_local_intf_implementations. - - DATA: ls_type_infos TYPE saboo_vseot, - lt_method_implementations TYPE saboo_method_impl_tab, - lt_source TYPE saboo_sourt. - - IF gt_interface_implementations IS INITIAL. - - READ REPORT sy-cprog INTO lt_source. - IF sy-subrc <> 0. - zcx_abapgit_exception=>raise( |Cannot read { sy-cprog }| ). - ENDIF. - - CALL FUNCTION 'SCAN_ABAP_OBJECTS_CLASSES' - CHANGING - vseo_tabs = ls_type_infos - method_impls = lt_method_implementations - sourc_tab = lt_source - EXCEPTIONS - scan_abap_source_error = 1 - scan_abap_src_line_too_long = 2 - OTHERS = 3. - IF sy-subrc <> 0. - zcx_abapgit_exception=>raise_t100( ). - ENDIF. - - gt_interface_implementations = ls_type_infos-iimpl_tab. - - ENDIF. - - rt_interface_implementations = gt_interface_implementations. - - ENDMETHOD. - - - METHOD get_referred_class_name. - - DATA lo_ref TYPE REF TO cl_abap_refdescr. - lo_ref ?= cl_abap_typedescr=>describe_by_data( io_ref ). - rv_name = lo_ref->get_referenced_type( )->get_relative_name( ). - - ENDMETHOD. - - - METHOD render_scripts. - - DATA lv_json TYPE string. - - FIELD-SYMBOLS: LIKE LINE OF it_hotkeys. - - lv_json = `{`. - - LOOP AT it_hotkeys ASSIGNING . - - IF sy-tabix > 1. - lv_json = lv_json && |,|. - ENDIF. - - lv_json = lv_json && | "{ -hotkey }" : "{ -action }" |. - - ENDLOOP. - - lv_json = lv_json && `}`. - - CREATE OBJECT ri_html TYPE zcl_abapgit_html. - ri_html->set_title( cl_abap_typedescr=>describe_by_object_ref( me )->get_relative_name( ) ). - ri_html->add( |setKeyBindings({ lv_json });| ). - - ENDMETHOD. - - - METHOD should_show_hint. - IF gv_hint_was_shown = abap_false. - rv_yes = abap_true. - gv_hint_was_shown = abap_true. - ENDIF. - ENDMETHOD. - - - METHOD zif_abapgit_gui_hotkeys~get_hotkey_actions. - - DATA ls_hotkey LIKE LINE OF rt_hotkey_actions. - - ls_hotkey-ui_component = 'Hotkeys'. - ls_hotkey-action = c_showhotkeys_action. - ls_hotkey-description = 'Show hotkeys help'. - ls_hotkey-hotkey = '?'. - INSERT ls_hotkey INTO TABLE rt_hotkey_actions. - - ENDMETHOD. - - - METHOD zif_abapgit_gui_hotkey_ctl~get_registered_hotkeys. - - DATA li_hotkey_provider LIKE LINE OF mt_hotkey_providers. - DATA lt_hotkeys LIKE rt_registered_hotkeys. - FIELD-SYMBOLS LIKE LINE OF lt_hotkeys. - - LOOP AT mt_hotkey_providers INTO li_hotkey_provider. - APPEND LINES OF li_hotkey_provider->get_hotkey_actions( ) TO lt_hotkeys. - ENDLOOP. - - " Compress duplicates - LOOP AT lt_hotkeys ASSIGNING . - READ TABLE rt_registered_hotkeys WITH KEY hotkey = -hotkey TRANSPORTING NO FIELDS. - IF sy-subrc = 0. " If found command with same hotkey - DELETE rt_registered_hotkeys INDEX sy-tabix. " Later registered commands enjoys the priority - ENDIF. - APPEND TO rt_registered_hotkeys. - ENDLOOP. - - ENDMETHOD. - - - METHOD zif_abapgit_gui_hotkey_ctl~register_hotkeys. - IF ii_hotkeys IS BOUND. - APPEND ii_hotkeys TO mt_hotkey_providers. - ENDIF. - ENDMETHOD. - - - METHOD zif_abapgit_gui_hotkey_ctl~reset. - CLEAR mt_hotkey_providers. - ENDMETHOD. - - - METHOD zif_abapgit_gui_renderable~render. - - DATA: - lv_hint TYPE string, - lt_registered_hotkeys TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr, - lv_hotkey TYPE string. - - FIELD-SYMBOLS LIKE LINE OF lt_registered_hotkeys. - - zif_abapgit_gui_hotkey_ctl~register_hotkeys( me ). - - CREATE OBJECT ri_html TYPE zcl_abapgit_html. - - lt_registered_hotkeys = zif_abapgit_gui_hotkey_ctl~get_registered_hotkeys( ). - SORT lt_registered_hotkeys BY ui_component description. - - register_deferred_script( render_scripts( lt_registered_hotkeys ) ). - - " Render hotkeys - ri_html->add( '
    ' ). - LOOP AT lt_registered_hotkeys ASSIGNING . - ri_html->add( |
  • | - && |{ -hotkey }| - && |{ -description }| - && |
  • | ). - ENDLOOP. - ri_html->add( '
' ). - - CLEAR lv_hotkey. - - READ TABLE lt_registered_hotkeys ASSIGNING - WITH KEY action = c_showhotkeys_action. - IF sy-subrc = 0. - lv_hotkey = -hotkey. - ENDIF. - - lv_hint = |Close window with upper right corner 'X'|. - IF lv_hotkey IS NOT INITIAL. - lv_hint = lv_hint && | or press '{ -hotkey }' again|. - ENDIF. - - ri_html = zcl_abapgit_gui_chunk_lib=>render_infopanel( - iv_div_id = 'hotkeys' - iv_title = 'Hotkeys' - iv_hint = lv_hint - iv_hide = abap_true - iv_scrollable = abap_false - io_content = ri_html ). - - IF lv_hotkey IS NOT INITIAL AND should_show_hint( ) = abap_true. - ri_html->add( |
| - && |Press '{ -hotkey }' to get keyboard shortcuts list| - && |
| ). - ENDIF. - - ENDMETHOD. -ENDCLASS. diff --git a/src/ui/zcl_abapgit_ui_factory.clas.abap b/src/ui/zcl_abapgit_ui_factory.clas.abap index bc0389cc4..d03807a12 100644 --- a/src/ui/zcl_abapgit_ui_factory.clas.abap +++ b/src/ui/zcl_abapgit_ui_factory.clas.abap @@ -148,7 +148,7 @@ CLASS zcl_abapgit_ui_factory IMPLEMENTATION. lo_html_preprocessor->preserve_css( 'css/common.css' ). CREATE OBJECT li_router TYPE zcl_abapgit_gui_router. - CREATE OBJECT li_hotkey_ctl TYPE zcl_abapgit_hotkeys. + CREATE OBJECT li_hotkey_ctl TYPE zcl_abapgit_gui_hotkey_ctl. CREATE OBJECT go_gui EXPORTING diff --git a/src/zif_abapgit_definitions.intf.abap b/src/zif_abapgit_definitions.intf.abap index 33da0de94..ddfdda8ce 100644 --- a/src/zif_abapgit_definitions.intf.abap +++ b/src/zif_abapgit_definitions.intf.abap @@ -59,17 +59,6 @@ INTERFACE zif_abapgit_definitions END OF ty_git_tag . TYPES: ty_git_tag_list_tt TYPE STANDARD TABLE OF ty_git_tag WITH DEFAULT KEY . - TYPES: - BEGIN OF ty_hotkey, - ui_component TYPE string, - action TYPE string, - hotkey TYPE string, - END OF ty_hotkey . - TYPES: - ty_hotkey_tt TYPE STANDARD TABLE OF ty_hotkey - WITH NON-UNIQUE DEFAULT KEY - WITH NON-UNIQUE SORTED KEY action - COMPONENTS ui_component action. TYPES: BEGIN OF ty_git_user, name TYPE string, @@ -325,7 +314,6 @@ INTERFACE zif_abapgit_definitions show_default_repo TYPE abap_bool, link_hints_enabled TYPE abap_bool, link_hint_key TYPE c LENGTH 1, - hotkeys TYPE ty_hotkey_tt, parallel_proc_disabled TYPE abap_bool, icon_scaling TYPE c LENGTH 1, ui_theme TYPE string,