abapGit/src/ui/zcl_abapgit_gui_component.clas.abap
Alexander Tsybulsky 3ecf82777c
UI repo over view page refactoring (#5789)
* improvements in abapgit_html

* linter fix

* repo over code styling

* repo overview refactoring part 1

* move universal cod to chunks

* cleanup new code temporarily

* more clean ups

* ui_component register_hotkeys helper

* move relevant hotkeys to repo overview

* forgotten part

* move event handling to repo over

* reuse td

* move render_repo_url to chunks

* minor

* linter fix

* new > create

Co-authored-by: Lars Hvam <larshp@hotmail.com>
Co-authored-by: Marc Bernard <59966492+mbtools@users.noreply.github.com>
2022-10-07 14:46:43 -04:00

74 lines
1.7 KiB
ABAP

CLASS zcl_abapgit_gui_component DEFINITION
PUBLIC
ABSTRACT
CREATE PUBLIC .
PUBLIC SECTION.
CONSTANTS:
BEGIN OF c_html_parts,
scripts TYPE string VALUE 'scripts',
hidden_forms TYPE string VALUE 'hidden_forms',
END OF c_html_parts.
PROTECTED SECTION.
METHODS register_deferred_script
IMPORTING
ii_part TYPE REF TO zif_abapgit_html
RAISING
zcx_abapgit_exception.
METHODS gui_services
RETURNING
VALUE(ri_gui_services) TYPE REF TO zif_abapgit_gui_services
RAISING
zcx_abapgit_exception.
METHODS register_hotkeys
IMPORTING
ii_hotkey_provider TYPE REF TO zif_abapgit_gui_hotkeys OPTIONAL
RAISING
zcx_abapgit_exception.
PRIVATE SECTION.
DATA mi_gui_services TYPE REF TO zif_abapgit_gui_services.
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_COMPONENT IMPLEMENTATION.
METHOD gui_services.
IF mi_gui_services IS NOT BOUND.
mi_gui_services = zcl_abapgit_ui_factory=>get_gui_services( ).
ENDIF.
ri_gui_services = mi_gui_services.
ENDMETHOD.
METHOD register_deferred_script.
gui_services( )->get_html_parts( )->add_part(
iv_collection = c_html_parts-scripts
ii_part = ii_part ).
ENDMETHOD.
METHOD register_hotkeys.
DATA li_hotkey_provider TYPE REF TO zif_abapgit_gui_hotkeys.
IF ii_hotkey_provider IS BOUND.
li_hotkey_provider = ii_hotkey_provider.
ELSE.
TRY.
li_hotkey_provider ?= me.
CATCH cx_root.
RETURN.
ENDTRY.
ENDIF.
gui_services( )->get_hotkeys_ctl( )->register_hotkeys( li_hotkey_provider->get_hotkey_actions( ) ).
ENDMETHOD.
ENDCLASS.