Improve CMS_LINK to easily add children
This commit is contained in:
@@ -32,6 +32,10 @@ feature -- status report
|
||||
deferred
|
||||
end
|
||||
|
||||
has_children: BOOLEAN
|
||||
deferred
|
||||
end
|
||||
|
||||
feature -- Query
|
||||
|
||||
parent: detachable CMS_LINK
|
||||
|
||||
@@ -33,12 +33,29 @@ feature -- Status report
|
||||
|
||||
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]
|
||||
|
||||
children: detachable LIST [CMS_LINK]
|
||||
|
||||
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)
|
||||
do
|
||||
children := lst
|
||||
@@ -47,11 +64,17 @@ feature -- Element change
|
||||
set_expanded (b: like is_expanded)
|
||||
do
|
||||
is_expanded := b
|
||||
if b then
|
||||
is_expandable := True
|
||||
end
|
||||
end
|
||||
|
||||
set_expandable (b: like is_expandable)
|
||||
do
|
||||
is_expandable := b
|
||||
if not b then
|
||||
is_expanded := False
|
||||
end
|
||||
end
|
||||
|
||||
get_is_active (req: WSF_REQUEST)
|
||||
|
||||
Reference in New Issue
Block a user