Skip to content

Commit 59763d4

Browse files
New Sample: FlexBox Direction & Order (#286)
* New Sample: FlexBox Direction & Order (1) * New Sample: FlexBox Direction & Order (2) * New Sample: FlexBox Direction & Order (3) * New Sample: FlexBox Direction & Order (4) * New Sample: FlexBox Direction & Order (5) * New Sample: FlexBox Direction & Order (6) * New Sample: FlexBox Direction & Order (7) * New Sample: FlexBox Direction & Order (8)
1 parent 2b7e0cd commit 59763d4

3 files changed

+153
-0
lines changed

src/z2ui5_cl_demo_app_000.clas.abap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,14 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
932932
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
933933
).
934934

935+
panel->generic_tile(
936+
header = 'Flex Box'
937+
subheader = 'Direction & Order'
938+
press = client->_event( 'Z2UI5_CL_DEMO_APP_245' )
939+
mode = 'LineMode'
940+
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
941+
).
942+
935943
panel = page->panel(
936944
expandable = abap_false
937945
expanded = abap_true

src/z2ui5_cl_demo_app_245.clas.abap

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
class z2ui5_cl_demo_app_245 definition
2+
public
3+
create public .
4+
5+
public section.
6+
7+
interfaces Z2UI5_IF_APP .
8+
9+
data CHECK_INITIALIZED type ABAP_BOOL .
10+
PROTECTED SECTION.
11+
12+
DATA client TYPE REF TO z2ui5_if_client.
13+
14+
METHODS display_view
15+
IMPORTING
16+
client TYPE REF TO z2ui5_if_client.
17+
METHODS on_event
18+
IMPORTING
19+
client TYPE REF TO z2ui5_if_client.
20+
METHODS z2ui5_display_popover
21+
IMPORTING
22+
id TYPE string.
23+
24+
PRIVATE SECTION.
25+
ENDCLASS.
26+
27+
28+
29+
CLASS z2ui5_cl_demo_app_245 IMPLEMENTATION.
30+
31+
32+
METHOD DISPLAY_VIEW.
33+
34+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
35+
)->page(
36+
title = `abap2UI5 - Sample: Flex Box - Direction & Order`
37+
navbuttonpress = client->_event( 'BACK' )
38+
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).
39+
40+
page->header_content(
41+
)->button( id = `hint_icon`
42+
icon = `sap-icon://hint`
43+
tooltip = `Sample information`
44+
press = client->_event( 'POPOVER' ) ).
45+
46+
page->header_content(
47+
)->link(
48+
text = 'UI5 Demo Kit'
49+
target = '_blank'
50+
href = 'https://sapui5.hana.ondemand.com/sdk/#/entity/sap.m.FlexBox/sample/sap.m.sample.FlexBoxDirectionOrder' ).
51+
52+
DATA(layout) = page->vbox(
53+
)->panel( headertext = `Reverse, horizontal`
54+
)->flex_box( direction = `RowReverse` alignItems = `Start`
55+
)->button( text = `1` type = `Emphasized`
56+
)->button( text = `2` type = `Reject`
57+
)->button( text = `3` type = `Accept` )->get_parent( )->get_parent(
58+
59+
)->panel( headertext = `Top to bottom, vertical`
60+
)->flex_box( direction = `Column` alignItems = `Start`
61+
)->button( text = `1` type = `Emphasized`
62+
)->button( text = `2` type = `Reject`
63+
)->button( text = `3` type = `Accept` )->get_parent( )->get_parent(
64+
65+
)->panel( headertext = `Bottom to top, reverse vertical`
66+
)->flex_box( direction = `ColumnReverse` alignItems = `Start`
67+
)->button( text = `1` type = `Emphasized`
68+
)->button( text = `2` type = `Reject`
69+
)->button( text = `3` type = `Accept` )->get_parent( )->get_parent(
70+
71+
)->panel( headertext = `Arbitrary flex item order`
72+
)->flex_box( alignItems = `Start`
73+
)->button( text = `1` type = `Emphasized` class = `sapUiTinyMarginEnd` )->get(
74+
)->layout_data(
75+
)->flex_item_data( order = `2` )->get_parent( )->get_parent(
76+
)->button( text = `2` type = `Reject` class = `sapUiTinyMarginEnd` )->get(
77+
)->layout_data(
78+
)->flex_item_data( order = `3` )->get_parent( )->get_parent(
79+
)->button( text = `3` type = `Accept` class = `sapUiTinyMarginEnd` )->get(
80+
)->layout_data(
81+
)->flex_item_data( order = `1`
82+
).
83+
84+
client->view_display( page->stringify( ) ).
85+
86+
ENDMETHOD.
87+
88+
89+
METHOD ON_EVENT.
90+
91+
CASE client->get( )-event.
92+
WHEN 'BACK'.
93+
client->nav_app_leave( ).
94+
WHEN 'POPOVER'.
95+
z2ui5_display_popover( `hint_icon` ).
96+
ENDCASE.
97+
98+
ENDMETHOD.
99+
100+
101+
METHOD Z2UI5_DISPLAY_POPOVER.
102+
103+
DATA(view) = z2ui5_cl_xml_view=>factory_popup( ).
104+
view->quick_view( placement = `Bottom` width = `auto`
105+
)->quick_view_page( pageid = `sampleInformationId`
106+
header = `Sample information`
107+
description = `You can influence the direction and order of elements in horizontal and vertical Flex Box controls with the direction property.` ).
108+
109+
client->popover_display(
110+
xml = view->stringify( )
111+
by_id = id
112+
).
113+
114+
ENDMETHOD.
115+
116+
117+
METHOD Z2UI5_IF_APP~MAIN.
118+
119+
me->client = client.
120+
121+
IF check_initialized = abap_false.
122+
check_initialized = abap_true.
123+
display_view( client ).
124+
ENDIF.
125+
126+
on_event( client ).
127+
128+
ENDMETHOD.
129+
ENDCLASS.

src/z2ui5_cl_demo_app_245.clas.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<VSEOCLASS>
6+
<CLSNAME>Z2UI5_CL_DEMO_APP_245</CLSNAME>
7+
<LANGU>E</LANGU>
8+
<DESCRIPT>Flex Box - Direction &amp; Order</DESCRIPT>
9+
<STATE>1</STATE>
10+
<CLSCCINCL>X</CLSCCINCL>
11+
<FIXPT>X</FIXPT>
12+
<UNICODE>X</UNICODE>
13+
</VSEOCLASS>
14+
</asx:values>
15+
</asx:abap>
16+
</abapGit>

0 commit comments

Comments
 (0)