Improve CMS_LINK to easily add children
This commit is contained in:
@@ -32,6 +32,10 @@ feature -- status report
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
|
has_children: BOOLEAN
|
||||||
|
deferred
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Query
|
feature -- Query
|
||||||
|
|
||||||
parent: detachable CMS_LINK
|
parent: detachable CMS_LINK
|
||||||
|
|||||||
@@ -33,12 +33,29 @@ feature -- Status report
|
|||||||
|
|
||||||
is_expandable: BOOLEAN
|
is_expandable: BOOLEAN
|
||||||
|
|
||||||
|
has_children: BOOLEAN
|
||||||
|
do
|
||||||
|
Result := attached children as l_children and then not l_children.is_empty
|
||||||
|
end
|
||||||
|
|
||||||
permission_arguments: detachable ITERABLE [STRING]
|
permission_arguments: detachable ITERABLE [STRING]
|
||||||
|
|
||||||
children: detachable LIST [CMS_LINK]
|
children: detachable LIST [CMS_LINK]
|
||||||
|
|
||||||
feature -- Element change
|
feature -- Element change
|
||||||
|
|
||||||
|
add_link (lnk: CMS_LINK)
|
||||||
|
local
|
||||||
|
lst: like children
|
||||||
|
do
|
||||||
|
lst := children
|
||||||
|
if lst = Void then
|
||||||
|
create {ARRAYED_LIST [CMS_LINK]} lst.make (1)
|
||||||
|
children := lst
|
||||||
|
end
|
||||||
|
lst.force (lnk)
|
||||||
|
end
|
||||||
|
|
||||||
set_children (lst: like children)
|
set_children (lst: like children)
|
||||||
do
|
do
|
||||||
children := lst
|
children := lst
|
||||||
@@ -47,11 +64,17 @@ feature -- Element change
|
|||||||
set_expanded (b: like is_expanded)
|
set_expanded (b: like is_expanded)
|
||||||
do
|
do
|
||||||
is_expanded := b
|
is_expanded := b
|
||||||
|
if b then
|
||||||
|
is_expandable := True
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
set_expandable (b: like is_expandable)
|
set_expandable (b: like is_expandable)
|
||||||
do
|
do
|
||||||
is_expandable := b
|
is_expandable := b
|
||||||
|
if not b then
|
||||||
|
is_expanded := False
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
get_is_active (req: WSF_REQUEST)
|
get_is_active (req: WSF_REQUEST)
|
||||||
|
|||||||
Reference in New Issue
Block a user