XML highlighter for db_pages

Extension of XML-syntax highliting to yet another page in abapGit.
This commit is contained in:
TheWirtschaftsmann 2017-01-23 22:18:17 +02:00
parent 3e5a97483a
commit f7ba61641f
3 changed files with 16 additions and 7 deletions

View File

@ -593,6 +593,7 @@ div.db_entry {
background-color: #f2f2f2;
padding: 0.5em;
}
div.db_entry pre {
display: block;
overflow: hidden;
@ -603,6 +604,11 @@ div.db_entry pre {
margin: 0.5em 0em;
width: 50em;
}
div.db_entry span.xml_tag { color: #457ce3; }
div.db_entry span.attr { color: #b777fb; }
div.db_entry span.attr_val { color: #7a02f9; }
div.db_entry table.toolbar {
width: 50em;
}

View File

@ -15,7 +15,7 @@
<RELID>MI</RELID>
<OBJID>ZABAPGIT_CSS_COMMON</OBJID>
<NAME>filename</NAME>
<VALUE>~wwwtmp.css</VALUE>
<VALUE>ZABAPGIT_CSS_COMMON.css</VALUE>
</WWWPARAMS>
<WWWPARAMS>
<RELID>MI</RELID>

View File

@ -26,7 +26,9 @@ CLASS lcl_gui_page_db_display IMPLEMENTATION.
METHOD render_content.
DATA: lv_data TYPE lcl_persistence_db=>ty_content-data_str,
DATA:
lo_highlighter TYPE REF TO lcl_syntax_highlighter,
lv_data TYPE lcl_persistence_db=>ty_content-data_str,
ls_action TYPE lcl_persistence_db=>ty_content,
lv_action TYPE string.
@ -37,13 +39,14 @@ CLASS lcl_gui_page_db_display IMPLEMENTATION.
CATCH lcx_not_found ##NO_HANDLER.
ENDTRY.
" Create syntax highlighter
lo_highlighter = lcl_syntax_highlighter=>create( '*.xml' ).
ls_action-type = ms_key-type.
ls_action-value = ms_key-value.
lv_action = lcl_html_action_utils=>dbkey_encode( ls_action ).
lv_data = lcl_xml_pretty=>print( lv_data ).
lv_data = escape( val = lv_data
format = cl_abap_format=>e_html_attr ).
lv_data = lo_highlighter->process_line( lv_data ).
CREATE OBJECT ro_html.