本文整理汇总了Java中org.fenixedu.bennu.portal.domain.MenuContainer类的典型用法代码示例。如果您正苦于以下问题:Java MenuContainer类的具体用法?Java MenuContainer怎么用?Java MenuContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MenuContainer类属于org.fenixedu.bennu.portal.domain包,在下文中一共展示了MenuContainer类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateMenuFunctionality
import org.fenixedu.bennu.portal.domain.MenuContainer; //导入依赖的package包/类
/**
* Updates the site's slug and it's respective MenuFunctionality. It should
* be used after setting the site's description, name and slug.
*/
public void updateMenuFunctionality() {
Preconditions.checkNotNull(getDescription());
Preconditions.checkNotNull(getName());
Preconditions.checkNotNull(getSlug());
Preconditions.checkArgument(isValidSlug(getSlug()));
if (getFolder() == null) {
MenuContainer parent =
getFunctionality() == null ? PortalConfiguration.getInstance().getMenu() : getFunctionality().getParent();
if (getFunctionality() != null) {
deleteMenuFunctionality();
}
setFunctionality(new MenuFunctionality(parent, getEmbedded(), getSlug(),
getEmbedded() ? CMSEmbeddedBackend.BACKEND_KEY : CMSBackend.BACKEND_KEY, "anyone", getDescription(),
getName(), getSlug()));
getFunctionality().setAccessGroup(SiteViewersGroup.get(this));
}
}
示例2: findFunctionalityWithPath
import org.fenixedu.bennu.portal.domain.MenuContainer; //导入依赖的package包/类
private static final MenuFunctionality findFunctionalityWithPath(MenuContainer container, int startIndex, String... parts) {
// 1)
if (parts.length == startIndex) {
return container.findInitialContent();
}
// 2)
for (MenuItem child : container.getOrderedChild()) {
if (child.getPath().equals(parts[startIndex])) {
if (child.isMenuFunctionality()) {
return child.getAsMenuFunctionality();
} else {
return findFunctionalityWithPath(child.getAsMenuContainer(), startIndex + 1, parts);
}
}
}
// 3)
return null;
}
示例3: findTopLevelContainer
import org.fenixedu.bennu.portal.domain.MenuContainer; //导入依赖的package包/类
private static MenuItem findTopLevelContainer(final MenuContainer container) {
for (final MenuItem item : container.getOrderedChild()) {
if (item.isVisible() && item.isAvailableForCurrentUser()) {
return item instanceof MenuContainer ? findTopLevelContainer((MenuContainer) item) : item;
}
}
return null;
}
示例4: CMSFolder
import org.fenixedu.bennu.portal.domain.MenuContainer; //导入依赖的package包/类
public CMSFolder(MenuContainer parent, String path, LocalizedString description) {
super();
setBennu(Bennu.getInstance());
setFunctionality(new MenuFunctionality(parent, false, path, "cms", "anyone", description, description, path));
Signal.emit(SIGNAL_CREATED,new DomainObjectEvent<>(this));
}
示例5: make
import org.fenixedu.bennu.portal.domain.MenuContainer; //导入依赖的package包/类
private static MenuContainer make(MenuContainer parent, RoleType role, String pt, String en) {
LocalizedString title = new LocalizedString(PT, pt).with(EN, en);
return new MenuContainer(parent, true, "role(" + role.name() + ")", title, title, en.toLowerCase().replace(' ', '-'));
}
示例6: install
import org.fenixedu.bennu.portal.domain.MenuContainer; //导入依赖的package包/类
private static MenuContainer install(MenuContainer parent, Class<?> appClass) {
return install(parent, appClass.getName());
}
示例7: makeRedirect
import org.fenixedu.bennu.portal.domain.MenuContainer; //导入依赖的package包/类
private static void makeRedirect(MenuContainer parent, String path, String pt, String en) {
LocalizedString str = new LocalizedString(PT, pt).with(EN, en);
new MenuFunctionality(parent, true, path, "redirect", "anyone", str, str, en.toLowerCase().replace(' ', '-'));
}