GSaha567/seq_level_training_data
052
1text,length,is_long_context,metric_val,label_metric2"class ZCL_WD_STATIC definition3 public4 final5 create public .6 7*""* public components of class ZCL_WD_STATIC8*""* do not include other source files here!!!9public section.10 11 types:12 begin of ts_metadata,13 field type fieldname,14 visible(1),15 enabled(1),16 editable(1),17 required(1),18 end of ts_metadata .19 types:20 tt_metadata type table of ts_metadata .21 22 constants ICON_APPROVE type STRING value '~Icon/Approve' ##NO_TEXT.23 constants ICON_DELETE type STRING value '~Icon/Delete' ##NO_TEXT.24 constants ICON_FAILURE type STRING value '~Icon/Failure' ##NO_TEXT.25 constants ICON_GREEN_LED type STRING value '~Icon/GreenLed' ##NO_TEXT.26 constants ICON_RED_LED type STRING value '~Icon/RedLed' ##NO_TEXT.27 constants ICON_REFRESH type STRING value '~Icon/TbRefresh' ##NO_TEXT.28 constants ICON_YELLOW_LED type STRING value '~Icon/YellowLed' ##NO_TEXT.29 30 class-methods GET_URL31 importing32 !I_APP type SIMPLE33 !I_GUID type SIMPLE optional34 !I_LANGUAGE type LANGU default SY-LANGU35 !IT_PARAMETERS type TIHTTPNVP optional36 returning37 value(E_URL) type STRING .38 class-methods OPEN_URL39 importing40 !IR_CONTROLLER type ref to IF_WD_COMPONENT41 !I_URL type STRING .42 class-methods CLEAR_MESSAGES43 importing44 !IR_CONTROLLER type ref to IF_WD_COMPONENT .45 class-methods ADD_MESSAGE46 importing47 !IR_CONTROLLER type ref to IF_WD_COMPONENT48 !IS_MESSAGE type ZSMESSAGE optional .49 class-methods ADD_MESSAGES50 importing51 !IR_CONTROLLER type ref to IF_WD_COMPONENT optional52 !IT_MESSAGES type ZIMESSAGES .53 class-methods FILE_DOWNLOAD54 importing55 !I_FILE type SIMPLE56 !I_DATA type XSTRING .57 class-methods GET_PARAMETER58 importing59 !I_NAME type DATA60 returning61 value(E_VALUE) type STRING .62 class-methods GET_GUID63 returning64 value(E_GUID) type GUID .65 class-methods CREATE_USAGE66 importing67 !IR_CONTROLLER type ref to IF_WD_COMPONENT68 !I_COMPONENT type STRING69 !I_USAGE type STRING optional70 !I_REFRESH type ABAP_BOOL default ABAP_TRUE .71 class-methods CONF_WINDOW72 importing73 !IR_WINDOW type ref to IF_WD_WINDOW optional74 !IR_VIEW type ref to IF_WD_VIEW_CONTROLLER optional75 !I_WINDOW type SIMPLE optional76 !I_TITLE type SIMPLE optional77 !I_WIDTH type SIMPLE optional78 !I_HEIGHT type SIMPLE optional79 !I_BUTTON_KIND type WDR_POPUP_BUTTON_KIND default IF_WD_WINDOW=>CO_BUTTONS_NONE80 !I_ACTION_OK type SIMPLE optional81 !I_TEXT_OK type SIMPLE optional82 !I_ACTION_CANCEL type SIMPLE optional83 !I_TEXT_CANCEL type SIMPLE optional84 !I_ACTION_CLOSE type SIMPLE optional85 !I_ACTION_YES type SIMPLE optional86 !I_ACTION_NO type SIMPLE optional87 !I_FPM type ABAP_BOOL default ABAP_FALSE88 !I_OPEN type ABAP_BOOL default ABAP_TRUE89 !I_CLOSE type ABAP_BOOL default ABAP_TRUE .90 class-methods OPEN_WINDOW91 importing92 !IR_CONTROLLER type ref to IF_WD_COMPONENT93 !IR_VIEW type ref to IF_WD_VIEW_CONTROLLER optional94 !I_WINDOW type SIMPLE95 !I_TITLE type SIMPLE optional96 !I_BUTTON_KIND type WDR_POPUP_BUTTON_KIND default IF_WD_WINDOW=>CO_BUTTONS_NONE97 !I_ACTION_OK type SIMPLE optional98 !I_TEXT_OK type SIMPLE optional99 !I_ACTION_CANCEL type SIMPLE optional100 !I_TEXT_CANCEL type SIMPLE optional101 !I_ACTION_CLOSE type SIMPLE optional102 !I_ACTION_YES type SIMPLE optional103 !I_ACTION_NO type SIMPLE optional104 !I_OPEN type ABAP_BOOL default ABAP_TRUE105 !I_BUTTON_CLOSE type ABAP_BOOL default ABAP_TRUE106 !I_CLOSE type ABAP_BOOL default ABAP_TRUE107 !I_WIDTH type SIMPLE optional108 returning109 value(ER_WINDOW) type ref to IF_WD_WINDOW .110 class-methods OPEN_USAGE_WINDOW111 importing112 !IR_CONTROLLER type ref to IF_WD_COMPONENT113 !IR_VIEW type ref to IF_WD_VIEW_CONTROLLER optional114 !I_COMPONENT type SIMPLE optional115 !I_USAGE type SIMPLE optional116 !I_REFRESH type ABAP_BOOL default ABAP_TRUE117 !I_WINDOW type SIMPLE default 'W_MAIN'118 !I_TITLE type SIMPLE optional119 !I_BUTTON_KIND type WDR_POPUP_BUTTON_KIND default IF_WD_WINDOW=>CO_BUTTONS_NONE120 !I_ACTION_OK type SIMPLE optional121 !I_TEXT_OK type SIMPLE optional122 !I_ACTION_CANCEL type SIMPLE optional123 !I_TEXT_CANCEL type SIMPLE optional124 !I_ACTION_CLOSE type SIMPLE optional125 !I_ACTION_YES type SIMPLE optional126 !I_ACTION_NO type SIMPLE optional127 !I_OPEN type ABAP_BOOL default ABAP_TRUE128 !I_CLOSE type ABAP_BOOL default ABAP_TRUE129 returning130 value(ER_WINDOW) type ref to IF_WD_WINDOW .131 class-methods OPEN_CONFIRMATION_POPUP132 importing133 !IR_CONTROLLER type ref to IF_WD_COMPONENT134 !IR_VIEW type ref to IF_WD_VIEW_CONTROLLER optional135 !I_TITLE type SIMPLE optional136 !I_TEXT type SIMPLE137 !I_MESSAGE_TYPE type WDR_POPUP_MSG_TYPE default IF_WD_WINDOW=>CO_MSG_TYPE_NONE138 !I_BUTTON_KIND type WDR_POPUP_BUTTON_KIND default IF_WD_WINDOW=>CO_BUTTONS_OKCANCEL139 !I_ACTION_OK type STRING optional140 !I_ACTION_CANCEL type STRING optional141 !I_ACTION_YES type STRING optional142 !I_ACTION_NO type STRING optional143 !I_ACTION_CLOSE type STRING optional144 !I_OPEN type ABAP_BOOL default ABAP_TRUE145 returning146 value(ER_POPUP) type ref to IF_WD_WINDOW .147 class-methods OPEN_SEARCH_HELP148 importing149 !IR_CONTROLLER type ref to IF_WD_COMPONENT150 !IR_VIEW type ref to IF_WD_VIEW_CONTROLLER151 !I_SEARCH_HELP type SIMPLE152 !I_FIELD_NAME type SIMPLE153 !I_EVENT_HANDLER type SIMPLE154 !I_MULTI_SELECT type ABAP_BOOL default ABAP_FALSE155 raising156 ZCX_GENERIC .157 class-methods CLOSE158 importing159 !IR_VIEW type ref to IF_WD_VIEW_CONTROLLER160 !I_PLUG type SIMPLE default 'EXIT' .161 class-methods GET_ELEMENTS162 importing163 !IR_VIEW type ref to IF_WD_VIEW164 !I_NAME type SIMPLE default 'ROOTUIELEMENTCONTAINER'165 returning166 value(ET_ELEMENTS) type WDR_VIEW_ELEMENTS .167 class-methods SET_METADATA168 importing169 !IR_VIEW type ref to IF_WD_VIEW170 !IT_METADATA type TT_METADATA171 !I_READONLY type ABAP_BOOL default ABAP_FALSE .172 class-methods IS_CONFIG_MODE173 returning174 value(E_IS) type ABAP_BOOL .175 class-methods IS_PORTAL_MODE176 importing177 !IR_CONTROLLER type ref to IF_WD_COMPONENT178 returning179 value(E_IS) type ABAP_BOOL180 raising181 ZCX_GENERIC .182 class-methods IS_DEBUG_MODE183 returning184 value(E_IS) type ABAP_BOOL .185 protected section.186*""* protected components of class ZCLSRM_WD187*""* do not include other source files here!!!188 private section.189*""* private components of class ZCL_WD_STATIC190*""* do not include other source files here!!!191ENDCLASS.192 193 194 195CLASS ZCL_WD_STATIC IMPLEMENTATION.196 197 198 method add_message.199 200 data ls_message like is_message.201 if is_message is supplied.202 ls_message = is_message.203 else.204 move-corresponding sy to ls_message.205 endif.206 207 if ls_message-msgty ca 'AX'.208 ls_message-msgty = 'E'.209 endif.210 211 data lr_message_manager type ref to if_wd_message_manager.212 lr_message_manager = ir_controller->get_message_manager( ).213 214 lr_message_manager->report_t100_message(215 msgid = ls_message-msgid216 msgno = ls_message-msgno217 msgty = ls_message-msgty218 p1 = ls_message-msgv1219 p2 = ls_message-msgv2220 p3 = ls_message-msgv3221 p4 = ls_message-msgv4 ).222 223 endmethod.224 225 226 method add_messages.227 228 data ls_message like line of it_messages.229 loop at it_messages into ls_message.230 231 add_message(232 ir_controller = ir_controller233 is_message = ls_message ).234 235 endloop.236 237 endmethod.238 239 240 method clear_messages.241 242 data lr_message_manager type ref to if_wd_message_manager.243 lr_message_manager = ir_controller->get_message_manager( ).244 245 lr_message_manager->clear_messages( ).246 247 endmethod.248 249 250 method close.251 252 data lr_controller type ref to if_wd_window_controller.253 lr_controller = ir_view->get_embedding_window_ctlr( ).254 255 data lr_window type ref to if_wd_window.256 lr_window = lr_controller->get_window( ).257 258 if lr_window is bound.259 260 lr_window->close( ).261 262 else.263 264 data lt_parameters type wdr_event_parameter_list.265 data ls_parameter like line of lt_parameters.266 ls_parameter-name = 'CLOSE_WINDOW'.267 create data ls_parameter-value type c.268 269 field-symbols <lv_value> type any.270 assign ls_parameter-value->* to <lv_value>.271 <lv_value> = abap_true.272 273 insert ls_parameter into table lt_parameters.274 275 data l_plug type string.276 l_plug = i_plug.277 278 lr_controller->if_wd_view_controller~fire_plug(279 plug_name = l_plug280 parameters = lt_parameters ).281 282 endif.283 284 endmethod.285 286 287 method conf_window.288 289 if ir_window is bound.290 data lr_window like ir_window.291 lr_window = ir_window.292 else.293 lr_window = ir_view->get_embedding_window( ).294 endif.295 296 if i_title is not initial.297 298 data l_title type string.299 l_title = i_title.300 301 lr_window->set_window_title( l_title ).302 303 endif.304 305 if i_width is not initial or306 i_height is not initial.307 308 data l_width type string.309 l_width = i_width.310 311 data l_height type string.312 l_height = i_height.313 314 lr_window->set_window_size(315 width = l_width316 height = l_height ).317 318 endif.319 320 if i_button_kind is not initial.321 lr_window->set_button_kind( i_button_kind ).322 endif.323 324 lr_window->set_close_in_any_case( i_close ).325 326 lr_window->set_window_position( position = if_wd_window=>co_center ).327 328 if i_action_ok is not initial.329 330 assert ir_view is bound.331 332 if i_fpm eq abap_true.333 334 data l_action type string.335 l_action = 'CONFIRM_ACTION'.336 337*** data lt_event_mapping type /sapsrm/t_ch_wd_event_mapping.338*** field-symbols <ls_event_mapping> like line of lt_event_mapping.339*** append initial line to lt_event_mapping assigning <ls_event_mapping>.340*** <ls_event_mapping>-action_name = 'ON_OK'.341*** <ls_event_mapping>-event_name = i_action_ok.342 343 else.344 l_action = i_action_ok.345 endif.346 347 if i_text_ok is initial.348 data l_button_text type string.349 l_button_text = text-001.350 else.351 l_button_text = i_text_ok.352 endif.353 354 lr_window->subscribe_to_button_event(355 button = if_wd_window=>co_button_ok356 button_text = l_button_text357 action_name = l_action358 action_view = ir_view ).359 360 endif.361 362 if i_action_cancel is not initial.363 364 assert ir_view is bound.365 366 if i_fpm eq abap_true.367 368 l_action = 'CONFIRM_ACTION'.369 370*** append initial line to lt_event_mapping assigning <ls_event_mapping>.371*** <ls_event_mapping>-action_name = 'ON_OK'.372*** <ls_event_mapping>-event_name = i_action_ok.373 374 else.375 l_action = i_action_cancel.376 endif.377 378 if i_text_cancel is initial.379 l_button_text = text-002.380 else.381 l_button_text = i_text_cancel.382 endif.383 384 lr_window->subscribe_to_button_event(385 button = if_wd_window=>co_button_cancel386 button_text = l_button_text387 action_name = i_action_cancel388 action_view = ir_view ).389 390 endif.391 392 if i_action_yes is not initial.393 394 assert ir_view is bound.395 396 lr_window->subscribe_to_button_event(397 button = if_wd_window=>co_button_yes398 action_name = i_action_yes399 action_view = ir_view ).400 401 endif.402 403 if i_action_no is not initial.404 405 assert ir_view is bound.406 407 lr_window->subscribe_to_button_event(408 button = if_wd_window=>co_button_no409 action_name = i_action_no410 action_view = ir_view ).411 412 endif.413 414 if i_action_close is not initial.415 416 assert ir_view is bound.417 418 lr_window->set_on_close_action(419 action_name = i_action_close420 view = ir_view ).421 422 endif.423 424 if i_fpm eq abap_true.425*** ir_view->get_context( )->root_node->get_child_node(426*** name = 'EVENT_MAPPING' )->bind_table(427*** new_items = lt_event_mapping ).428 endif.429 430 endmethod.431 432 433 method create_usage.434 435 if i_usage is initial.436 data l_usage type string.437 l_usage = i_component.438 else.439 l_usage = i_usage.440 endif.441 442 if ir_controller->has_cmp_usage_group( i_component ) eq abap_false.443 444 data lr_group type ref to if_wd_component_usage_group.445 lr_group =446 ir_controller->create_cmp_usage_group(447 name = i_component448 used_component = l_usage ).449 450 else.451 452 if i_refresh eq abap_true.453 454 data ls_usage type wdapi_component_usage.455 ls_usage = ir_controller->get_component_usage( l_usage ).456 457 if ls_usage-component_usage->has_active_component( ) eq abap_true.458 ls_usage-component_usage->delete_component( ).459 endif.460 461 endif.462 463 endif.464 465 endmethod.466 467 468 method file_download.469 470 data l_file type string.471 l_file = i_file.472 473 cl_wd_runtime_services=>attach_file_to_response(474 i_filename = l_file475 i_mime_type = zcl_file_static=>get_mime( l_file )476 i_content = i_data ).477 478 endmethod.479 480 481 method get_elements.482 483 data l_name type string.484 l_name = i_name.485 486 data lr_element like line of et_elements.487 lr_element ?= ir_view->get_element( l_name ).488 489 check lr_element is bound.490 491 insert lr_element into table et_elements.492 493 case lr_element->_definition_name.494 when 'TRANSPARENT_CONTAINER' or 'GROUP' or 'TRAY'.495 496 data lr_container type ref to cl_wd_uielement_container.497 lr_container ?= lr_element.498 499 data lt_elements like et_elements.500 lt_elements = lr_container->get_children( ).501 502 when 'PAGE_HEADER'.503 504 data lr_page_header type ref to cl_wd_page_header.505 lr_page_header ?= lr_element.506 507 data lt_page_areas type cl_wd_page_header_area=>tt_page_header_area.508 lt_page_areas = lr_page_header->get_areas( ).509 510 data lr_page_area like line of lt_page_areas.511 loop at lt_page_areas into lr_page_area.512 513 lr_element ?= lr_page_area.514 515 insert lr_element into table lt_elements.516 517 endloop.518 519 when 'PAGE_HEADER_AREA'.520 521 lr_page_area ?= lr_element.522 523 lr_element ?= lr_page_area->get_content( ).524 525 check lr_element is bound.526 527 insert lr_element into table lt_elements.528 529 when 'TABSTRIP'.530 531 data lr_tabstip type ref to cl_wd_tabstrip.532 lr_tabstip ?= lr_element.533 534 data lt_tabs type wd_tr_tab.535 lt_tabs = lr_tabstip->get_tabs( ).536 537 data lr_tab type ref to cl_wd_tab.538 loop at lt_tabs into lr_tab.539 540 lr_element ?= lr_tab->get_content( ).541 542 check lr_element is bound.543 544 insert lr_element into table lt_elements.545 546 endloop.547 548 when 'TOOLBAR'.549 550 data lr_toolbar type ref to cl_wd_toolbar.551 lr_toolbar ?= lr_element.552 553 data lt_toolbar_items type if_wd_toolbar_item=>tt_toolbar_item.554 lt_toolbar_items = lr_toolbar->get_toolbar_items( ).555 556 data lr_toolbar_item like line of lt_toolbar_items.557 loop at lt_toolbar_items into lr_toolbar_item.558 559 lr_element ?= lr_toolbar_item.560 561 insert lr_element into table lt_elements.562 563 endloop.564 565 when 'TOOLBAR_BTN_CHOICE'.566 567 data lr_toolbar_btn_choice type ref to cl_wd_toolbar_btn_choice.568 lr_toolbar_btn_choice ?= lr_element.569 570 data lt_choices type cl_wd_menu_action_item=>tt_menu_action_item.571 lt_choices = lr_toolbar_btn_choice->get_choices( ).572 573 data lr_choice like line of lt_choices.574 loop at lt_choices into lr_choice.575 576 lr_element ?= lr_choice.577 578 insert lr_element into table lt_elements.579 580 endloop.581 582 when others.583 return.584 585 endcase.586 587 loop at lt_elements into lr_element.588 589 l_name = lr_element->get_id( ).590 591 data lt_elements2 like et_elements.592 lt_elements2 =593 get_elements(594 ir_view = ir_view595 i_name = l_name ).596 597 insert lines of lt_elements2 into table et_elements.598 599 endloop.600 601 endmethod.602 603 604 method get_guid.605 606 e_guid = get_parameter( 'guid' ).607 608 endmethod.609 610 611 method get_parameter.612 613 data l_name type string.614 l_name = i_name.615 616 e_value = cl_wd_runtime_services=>get_url_parameter( l_name ).617 618 endmethod.619 620 621 method get_url.622 623 data l_app type string.624 l_app = i_app.625 626 data lt_parameters like it_parameters.627 lt_parameters = it_parameters.628 629 field-symbols <ls_parameter> like line of lt_parameters.630 read table lt_parameters transporting no fields631 with key632 name = 'sap-ui-language'.633 if sy-subrc ne 0.634 append initial line to lt_parameters assigning <ls_parameter>.635 <ls_parameter>-name = 'sap-ui-language'.636 <ls_parameter>-value = zcl_abap_static=>write( i_language ).637 endif.638 639 if i_guid is not initial.640 append initial line to lt_parameters assigning <ls_parameter>.641 <ls_parameter>-name = 'guid'.642 <ls_parameter>-value = i_guid.643 endif.644 645 call method cl_wd_utilities=>construct_wd_url646 exporting647 application_name = l_app648 in_parameters = lt_parameters649 importing650 out_absolute_url = e_url.651 652 endmethod.653 654 655 method is_config_mode.656 657 e_is = get_parameter( 'sap-config-mode' ).658 659 endmethod.660 661 662 method is_debug_mode.663 664 e_is = get_parameter( 'debug' ).665 666 endmethod.667 668 669 method is_portal_mode.670 671 data lr_manager type ref to if_wd_portal_integration.672 lr_manager = ir_controller->get_portal_manager( ).673 674 if lr_manager->m_portal_version is not initial.675 e_is = abap_true.676 endif.677 678 endmethod.679 680 681 method open_confirmation_popup.682 683 data lr_window_manager type ref to if_wd_window_manager.684 lr_window_manager = ir_controller->get_window_manager( ).685 686 data l_title type string.687 l_title = i_title.688 689 data l_text type string.690 l_text = i_text.691 692 data lt_text type string_table.693 insert l_text into table lt_text.694 695 er_popup = lr_window_manager->create_popup_to_confirm(696 text = lt_text697 button_kind = i_button_kind698 message_type = i_message_type699 window_title = l_title700 window_position = if_wd_window=>co_center ).701 702 if i_action_ok is not initial.703 assert ir_view is bound.704 er_popup->subscribe_to_button_event(705 exporting706 button = if_wd_window=>co_button_ok707 action_name = i_action_ok708 action_view = ir_view ).709 endif.710 711 if i_action_cancel is not initial.712 assert ir_view is bound.713 er_popup->subscribe_to_button_event(714 exporting715 button = if_wd_window=>co_button_cancel716 action_name = i_action_cancel717 action_view = ir_view ).718 endif.719 720 if i_action_yes is not initial.721 assert ir_view is bound.722 er_popup->subscribe_to_button_event(723 exporting724 button = if_wd_window=>co_button_yes725 action_name = i_action_yes726 action_view = ir_view ).727 endif.728 729 if i_action_no is not initial.730 assert ir_view is bound.731 er_popup->subscribe_to_button_event(732 exporting733 button = if_wd_window=>co_button_no734 action_name = i_action_no735 action_view = ir_view ).736 endif.737 738 if i_action_close is not initial.739 assert ir_view is bound.740 er_popup->set_on_close_action(741 exporting742 action_name = i_action_close743 view = ir_view ).744 endif.745 746 er_popup->set_window_position( position = if_wd_window=>co_center ).747 748 if i_open eq abap_true.749 er_popup->open( ).750 endif.751 752 endmethod.753 754 755 method open_search_help.756 757 data l_search_help type shlpname.758 l_search_help = i_search_help.759 760 data l_field_name type string.761 l_field_name = i_field_name.762 763 data l_event_handler type string.764 l_event_handler = i_event_handler.765 766 data lr_window_manager type ref to if_wd_window_manager.767 lr_window_manager = ir_controller->get_window_manager( ).768 769 try.770 771 lr_window_manager->open_value_help(772 view = ir_view773 event_handler = l_event_handler774 searchhelp = l_search_help775 fieldname = l_field_name776 multi_select = i_multi_select ).777 778 data lx_exception type ref to cx_wd_valuehelp.779 catch cx_wd_valuehelp into lx_exception.780 zcx_generic=>raise(781 i_text = lx_exception->get_text( ) ).782 endtry.783 784 endmethod.785 786 787 method open_url.788 789 check i_url is not initial.790 791 data lr_window_manager type ref to if_wd_window_manager.792 lr_window_manager ?= ir_controller->get_window_manager( ).793 794 data lr_window type ref to if_wd_window.795 lr_window =796 lr_window_manager->create_external_window(797 url = i_url ).798 799 lr_window->open( ).800 801 endmethod.802 803 804 method open_usage_window.805 806 if i_usage is initial.807 data l_usage type string.808 l_usage = i_component.809 else.810 l_usage = i_usage.811 endif.812 813 if i_component is not initial.814 815 create_usage(816 ir_controller = ir_controller817 i_component = i_component818 i_usage = l_usage819 i_refresh = i_refresh ).820 821 endif.822 823 data l_window type string.824 l_window = i_window.825 826 data lr_window_manager type ref to if_wd_window_manager.827 lr_window_manager = ir_controller->get_window_manager( ).828 829 er_window =830 lr_window_manager->create_window_for_cmp_usage(831 interface_view_name = l_window832 component_usage_name = l_usage833 message_display_mode = if_wd_window=>co_msg_display_mode_selected834 close_in_any_case = i_close835 is_resizable = abap_true ).836 837 conf_window(838 ir_window = er_window839 ir_view = ir_view840 i_title = i_title841 i_button_kind = i_button_kind842 i_action_ok = i_action_ok843 i_text_ok = i_text_ok844 i_action_cancel = i_action_cancel845 i_text_cancel = i_text_cancel846 i_action_close = i_action_close847 i_action_yes = i_action_yes848 i_action_no = i_action_no849 i_open = i_open850 i_close = i_close ).851 852 endmethod.853 854 855 method open_window.856 857 data lr_window_manager type ref to if_wd_window_manager.858 lr_window_manager = ir_controller->get_window_manager( ).859 860 data l_window type string.861 l_window = i_window.862 863 data l_title type string.864 l_title = i_title.865 866 er_window =867 lr_window_manager->create_window(868 window_name = l_window869 title = l_title870 is_resizable = abap_true871 message_display_mode = if_wd_window=>co_msg_display_mode_selected872 message_type = if_wd_window=>co_msg_type_none873 button_kind = i_button_kind874 close_button = i_button_close875 close_in_any_case = i_close ).876 877 conf_window(878 ir_window = er_window879 ir_view = ir_view880 i_title = i_title881 i_button_kind = i_button_kind882 i_action_ok = i_action_ok883 i_text_ok = i_text_ok884 i_action_cancel = i_action_cancel885 i_text_cancel = i_text_cancel886 i_action_close = i_action_close887 i_action_yes = i_action_yes888 i_action_no = i_action_no889 i_close = i_close890 i_width = i_width ).891 892 "" Open893 if i_open eq abap_true.894 er_window->open( ).895 endif.896 897 endmethod.898 899 900 method set_metadata.901 902 define set_visible.903 if &2-visible eq zcl_abap_static=>yes.904 &1->set_visible( 02 ).905 elseif &2-visible eq zcl_abap_static=>no.906 &1->set_visible( 01 ).907 endif.908 end-of-definition.909 910 define set_visible_boolean.911 if &2-visible eq zcl_abap_static=>yes.912 &1->set_visible( abap_true ).913 elseif &2-visible eq zcl_abap_static=>no.914 &1->set_visible( abap_false ).915 endif.916 end-of-definition.917 918 define set_enabled.919 if &2-enabled eq zcl_abap_static=>yes.920 &1->set_enabled( abap_true ).921 elseif &2-enabled eq zcl_abap_static=>no.922 &1->set_enabled( abap_false ).923 endif.924 end-of-definition.925 926 define set_editable.927 if &2-editable eq zcl_abap_static=>yes.928 &1->set_read_only( abap_false ).929 elseif &2-editable eq zcl_abap_static=>no.930 &1->set_read_only( abap_true ).931 endif.932 end-of-definition.933 934 define set_required.935 if &2-required = zcl_abap_static=>yes.936 &1->set_state( 1 ).937 elseif &2-required = zcl_abap_static=>no.938 &1->set_state( 0 ).939 endif.940 end-of-definition.941 942 define set_all.943 set_visible &1 &2.944 set_enabled &1 &2.945 set_editable &1 &2.946 set_required &1 &2.947 end-of-definition.948 949 "" Получаем элементы экрана950 data lt_elements type wdr_view_elements.951 lt_elements = zcl_wd_static=>get_elements( ir_view ).952 953 "" Обрабатываем элементы экрана в соответствии с метаданными954 data lr_element like line of lt_elements.955 loop at lt_elements into lr_element.956 957 data ls_metadata like line of it_metadata.958 clear ls_metadata.959 read table it_metadata into ls_metadata960 with key961 field = lr_element->id.962 check sy-subrc eq 0.963 964 if i_readonly eq abap_true.965 ls_metadata-editable = zcl_abap_static=>no.966 endif.967 968 if lr_element->_definition_name = 'LABEL'.969 970 data lr_label type ref to cl_wd_label.971 lr_label ?= lr_element.972 973 set_visible lr_label ls_metadata.974 set_enabled lr_label ls_metadata.975 976 elseif lr_element->_definition_name = 'INPUT_FIELD'.977 978 data lr_input_field type ref to cl_wd_input_field.979 lr_input_field ?= lr_element.980 981 set_all lr_input_field ls_metadata.982 983 elseif lr_element->_definition_name = 'TEXT_EDIT'.984 985 data lr_text_edit type ref to cl_wd_text_edit.986 lr_text_edit ?= lr_element.987 988 set_all lr_text_edit ls_metadata.989 990 elseif lr_element->_definition_name = 'DROPDOWN_BY_KEY'.991 992 data lr_dropkey type ref to cl_wd_dropdown_by_key.993 lr_dropkey ?= lr_element.994 995 set_all lr_dropkey ls_metadata.996 997 elseif lr_element->_definition_name = 'DROPDOWN_BY_IDX'.998 999 data lr_dropidx type ref to cl_wd_dropdown_by_idx.1000 lr_dropidx ?= lr_element.1001 1002 set_all lr_dropidx ls_metadata.1003 1004 elseif lr_element->_definition_name = 'BUTTON'.1005 1006 data lr_button type ref to cl_wd_button.1007 lr_button ?= lr_element.1008 1009 set_visible lr_button ls_metadata.1010 set_enabled lr_button ls_metadata.1011 1012 elseif lr_element->_definition_name = 'TOOLBAR'.1013 1014 data lr_toolbar type ref to cl_wd_toolbar.1015 lr_toolbar ?= lr_element.1016 1017 set_visible lr_toolbar ls_metadata.1018 set_enabled lr_toolbar ls_metadata.1019 1020 elseif lr_element->_definition_name = 'TOOLBAR_BUTTON'.1021 1022 data lr_toolbar_button type ref to cl_wd_toolbar_button.1023 lr_toolbar_button ?= lr_element.1024 1025 set_visible lr_toolbar_button ls_metadata.1026 set_enabled lr_toolbar_button ls_metadata.1027 1028 elseif lr_element->_definition_name = 'TOOLBAR_BTN_CHOICE'.1029 1030 data lr_toolbar_btn_choice type ref to cl_wd_toolbar_btn_choice.1031 lr_toolbar_btn_choice ?= lr_element.1032 1033 set_visible lr_toolbar_btn_choice ls_metadata.1034 set_enabled lr_toolbar_btn_choice ls_metadata.1035 1036 elseif lr_element->_definition_name = 'MENU_ACTION_ITEM'.1037 1038 data lr_menu_action_item type ref to cl_wd_menu_item.1039 lr_menu_action_item ?= lr_element.1040 1041 set_visible_boolean lr_menu_action_item ls_metadata.1042 1043 elseif lr_element->_definition_name = 'TRANSPARENT_CONTAINER'.1044 1045 data lr_container type ref to cl_wd_transparent_container.1046 lr_container ?= lr_element.1047 1048 set_visible lr_container ls_metadata.1049 set_enabled lr_container ls_metadata.1050 1051 elseif lr_element->_definition_name = 'TRAY'.1052 1053 data lr_tray type ref to cl_wd_tray.1054 lr_tray ?= lr_element.1055 1056 set_visible lr_tray ls_metadata.1057 set_enabled lr_tray ls_metadata.1058 1059 elseif lr_element->_definition_name = 'VIEW_CONTAINER_UIELEMENT'.1060 1061 data lr_vcuie type ref to cl_wd_view_container_uielement.1062 lr_vcuie ?= lr_element.1063 1064 set_visible lr_vcuie ls_metadata.1065 set_enabled lr_vcuie ls_metadata.1066 1067 elseif lr_element->_definition_name = 'CHECKBOX'.1068 1069 data lr_checkbox type ref to cl_wd_checkbox.1070 lr_checkbox ?= lr_element.1071 1072 set_all lr_checkbox ls_metadata.1073 1074 elseif lr_element->_definition_name = 'LINK_TO_ACTION'.1075 1076 data lr_lnk_a type ref to cl_wd_link_to_action.1077 lr_lnk_a ?= lr_element.1078 1079 set_visible lr_lnk_a ls_metadata.1080 set_enabled lr_lnk_a ls_metadata.1081 1082 elseif lr_element->_definition_name = 'IMAGE'.1083 1084 data lr_image type ref to cl_wd_image.1085 lr_image ?= lr_element.1086 1087 set_visible lr_image ls_metadata.1088 set_enabled lr_image ls_metadata.1089 1090 elseif lr_element->_definition_name = 'GROUP'.1091 1092 data lr_group type ref to cl_wd_group.1093 lr_group ?= lr_element.1094 1095 set_visible lr_group ls_metadata.1096 set_enabled lr_group ls_metadata.1097 1098 elseif lr_element->_definition_name = 'TEXT_VIEW'.1099 1100 data lr_text_view type ref to cl_wd_text_view.1101 lr_text_view ?= lr_element.1102 1103 set_visible lr_text_view ls_metadata.1104 set_enabled lr_text_view ls_metadata.1105 1106 elseif lr_element->_definition_name = 'FORMATTED_TEXT_VIEW'.1107 1108 data lr_formatted_text_view type ref to cl_wd_formatted_text_view.1109 lr_formatted_text_view ?= lr_element.1110 1111 set_visible lr_formatted_text_view ls_metadata.1112 set_enabled lr_formatted_text_view ls_metadata.1113 1114 elseif lr_element->_definition_name = 'TABLE'.1115 1116 data lr_table type ref to cl_wd_table.1117 lr_table ?= lr_element.1118 1119 set_visible lr_table ls_metadata.1120 1121 data lt_table_columns type cl_wd_abstr_table_column=>tt_abstr_table_column.1122 lt_table_columns = lr_table->get_grouped_columns( ).1123 1124 data ls_column like line of lt_table_columns.1125 loop at lt_table_columns into ls_column.1126 1127 data ls_col_meta like line of it_metadata.1128 read table it_metadata into ls_col_meta1129 with key1130 field = ls_column->id.1131 1132 check sy-subrc eq 0.1133 1134 data lr_table_column type ref to cl_wd_table_column.1135 lr_table_column ?= ls_column.1136 1137 data lr_table_cell_editor type ref to if_wd_table_cell_editor.1138 lr_table_cell_editor = lr_table_column->get_table_cell_editor( ).1139 1140 set_visible ls_column ls_col_meta.1141 1142 lr_element ?= lr_table_cell_editor.1143 1144 try.1145 1146 case lr_element->_definition_name.1147 when 'INPUT_FIELD'.1148 1149 lr_input_field ?= lr_table_cell_editor.1150 1151 set_all lr_input_field ls_col_meta.1152 1153 when 'TEXT_EDIT'.1154 1155 lr_text_edit ?= lr_table_cell_editor.1156 1157 set_all lr_text_edit ls_col_meta.1158 1159 when 'CHECKBOX'.1160 1161 lr_checkbox ?= lr_table_cell_editor.1162 1163 set_all lr_checkbox ls_col_meta.1164 1165 endcase.1166 1167 catch cx_root.1168 endtry.1169 1170 endloop.1171 1172 endif.1173 1174 endloop.1175 1176 endmethod.1177ENDCLASS.1178",7421,False,1461.703592428515,median1179"////1180DO NOT EDIT THIS FILE. IT WAS GENERATED.1181Manual changes to this file will be lost when it is generated again.1182Edit the files in the src/main/asciidoc/ directory instead.1183////1184 1185 1186:jdkversion: 1.81187:github-tag: master1188:github-repo: spring-cloud/spring-cloud-stream-binder-rabbit1189 1190:github-raw: https://raw.githubusercontent.com/{github-repo}/{github-tag}1191:github-code: https://github.com/{github-repo}/tree/{github-tag}1192 1193image::https://circleci.com/gh/spring-cloud/spring-cloud-stream-binder-rabbit.svg?style=svg[""CircleCI"", link=""https://circleci.com/gh/spring-cloud/spring-cloud-stream-binder-rabbit""]1194image::https://codecov.io/gh/spring-cloud/spring-cloud-stream-binder-rabbit/branch/{github-tag}/graph/badge.svg[""codecov"", link=""https://codecov.io/gh/spring-cloud/spring-cloud-stream-binder-rabbit""]1195image::https://badges.gitter.im/spring-cloud/spring-cloud-stream-binder-rabbit.svg[Gitter, link=""https://gitter.im/spring-cloud/spring-cloud-stream-binder-rabbit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge""]1196 1197// ======================================================================================1198 1199//= Overview1200[partintro]