Example usage for org.apache.wicket.markup.html.link AbstractLink isVisible

List of usage examples for org.apache.wicket.markup.html.link AbstractLink isVisible

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.link AbstractLink isVisible.

Prototype

public boolean isVisible() 

Source Link

Document

Gets whether this component and any children are visible.

Usage

From source file:ro.nextreports.server.web.dashboard.DashboardPopupMenuModel.java

License:Apache License

@Override
protected List<MenuItem> load() {
    Injector.get().inject(this);
    List<MenuItem> menuItems = new ArrayList<MenuItem>();
    Object dashboard = model.getObject();

    DashboardSection dashboardSection = (DashboardSection) sectionManager.getSection(DashboardSection.ID);
    List<ActionContributor> popupContributors = dashboardSection.getPopupContributors();
    if (popupContributors != null) {
        for (ActionContributor contributor : popupContributors) {
            if (contributor.isVisible()) {
                AbstractLink link = contributor.getLink(createActionContext(dashboard));
                if (link.isVisible()) {
                    menuItems/* w  ww. j a v a2  s.  c  o m*/
                            .add(new MenuItem(link, contributor.getActionName(), contributor.getActionImage()));
                }
            }
        }
    }

    //MenuItem menuItem = new MenuItem("images/" + ThemesManager.getActionImage(storageService.getSettings().getColorTheme()), null);
    MenuItem menuItem = new MenuItem("images/actions.png", null);
    menuItem.setMenuItems(menuItems);

    return Arrays.asList(menuItem);
}