private boolean isLeaf(EList<Widget> children) { for (Widget w : children) { if (w instanceof Frame) { if (isLeaf(((Frame) w).getChildren())) { return false; } } else if (w instanceof LinkableWidget) { LinkableWidget linkableWidget = (LinkableWidget) w; if (itemUIRegistry.getChildren(linkableWidget).size() > 0) { return false; } } } return true; }
private boolean isLeaf(EList<Widget> children) { for (Widget w : children) { if (w instanceof Frame) { if (isLeaf(((Frame) w).getChildren())) { return false; } } else if (w instanceof LinkableWidget) { LinkableWidget linkableWidget = (LinkableWidget) w; if (itemUIRegistry.getChildren(linkableWidget).size() > 0) { return false; } } } return true; }
@Check public void checkFramesInFrame(final Frame frame) { EList<Widget> _children = frame.getChildren(); for (final Widget w : _children) { if ((w instanceof Frame)) { EStructuralFeature _eStructuralFeature = SitemapPackage.Literals.FRAME.getEStructuralFeature(SitemapPackage.FRAME__CHILDREN); this.error("Frames must not contain other frames", _eStructuralFeature); return; } } }
items.addAll(getAllItems(((Frame) widget).getChildren()));
@Check public void checkFramesInFrame(final Frame frame) { EList<Widget> _children = frame.getChildren(); for (final Widget w : _children) { if ((w instanceof Frame)) { this.error("Frames must not contain other frames", SitemapPackage.Literals.FRAME.getEStructuralFeature(SitemapPackage.FRAME__CHILDREN)); return; } } }
/** * Collects all items that are represented by a given list of widgets * * @param widgets * the widget list to get the items for added to all bundles containing REST resources * @return all items that are represented by the list of widgets */ private Set<Item> getAllItems(EList<Widget> widgets) { Set<Item> items = new HashSet<Item>(); if (itemUIRegistry != null) { for (Widget widget : widgets) { addItemWithName(items, widget.getItem()); if (widget instanceof Frame) { items.addAll(getAllItems(((Frame) widget).getChildren())); } // now scan visibility rules for (VisibilityRule vr : widget.getVisibility()) { addItemWithName(items, vr.getItem()); } } } return items; }
items.addAll(getAllItems(((Frame) widget).getChildren()));
addItemWithName(items, widget.getItem()); if (widget instanceof Frame) { items.addAll(getAllItems(((Frame) widget).getChildren()));