Example usage for org.apache.wicket Component isVisibilityAllowed

List of usage examples for org.apache.wicket Component isVisibilityAllowed

Introduction

In this page you can find the example usage for org.apache.wicket Component isVisibilityAllowed.

Prototype

public final boolean isVisibilityAllowed() 

Source Link

Document

Gets whether or not visibility is allowed on this component.

Usage

From source file:org.apache.isis.viewer.wicket.ui.pages.login.IsisSignInPanel.java

License:Apache License

private void setVisibilityAllowedBasedOnAvailableServices(final Component... components) {
    IsisContext.doInSession(new Runnable() {
        @Override/*  w  ww.j av a  2 s . c  o m*/
        public void run() {
            final UserRegistrationService userRegistrationService = lookupService(
                    UserRegistrationService.class);
            final EmailNotificationService emailNotificationService = lookupService(
                    EmailNotificationService.class);
            final boolean visibilityAllowed = userRegistrationService != null
                    && emailNotificationService.isConfigured();
            for (final Component component : components) {
                if (component.isVisibilityAllowed()) {
                    component.setVisibilityAllowed(visibilityAllowed);
                }
            }
        }
    });
}