Example usage for org.apache.wicket.cdi CdiContainer get

List of usage examples for org.apache.wicket.cdi CdiContainer get

Introduction

In this page you can find the example usage for org.apache.wicket.cdi CdiContainer get.

Prototype

public static final CdiContainer get() 

Source Link

Document

Retrieves container instance stored in the current thread's application

Usage

From source file:cz.muni.exceptions.web.components.TicketsDataProvider.java

License:Apache License

/**
 * Constructor creates new instance of provider and injects TicketService to itself.
 */
public TicketsDataProvider() {
    CdiContainer.get().getNonContextualManager().inject(this);
}

From source file:eu.uqasar.web.components.behaviour.user.UserProfilePictureBackgroundBehaviour.java

License:Apache License

private UserProfilePictureBackgroundBehaviour(User user, User.PictureDimensions dimension, boolean caching) {
    CdiContainer.get().getNonContextualManager().inject(this);
    if (user == null) {
        if (UQasar.exists() && UQasar.getSession() != null) {
            this.user = UQasar.getSession().getLoggedInUser();
        }//from   w w  w  .j a va  2  s .  c  o m
    } else {
        this.user = user;
    }
    this.caching = caching;
    this.dimension = dimension;
    Args.notNull(this.user, "user");
    Args.notNull(this.dimension, "dimension");
    Args.notNull(this.urlProvider, "urlProvider");
}

From source file:eu.uqasar.web.components.qmtree.util.QMTreeProvider.java

License:Apache License

public QMTreeProvider(QMTreeFilterStructure filter) {
    CdiContainer.get().getNonContextualManager().inject(this);
    this.filter = filter;
}

From source file:eu.uqasar.web.components.tree.util.TreeProvider.java

License:Apache License

public TreeProvider(TreeFilterStructure filter) {
    CdiContainer.get().getNonContextualManager().inject(this);
    this.filter = filter;
}

From source file:eu.uqasar.web.pages.user.panels.UniqueMailValidator.java

License:Apache License

public UniqueMailValidator(TextField<String> mailField, final String allowedValue) {
    Args.notNull(mailField, "mailField");
    this.mailField = mailField;
    this.allowedValue = allowedValue;
    CdiContainer.get().getNonContextualManager().inject(this);
}

From source file:eu.uqasar.web.pages.user.panels.UniqueUsernameValidator.java

License:Apache License

public UniqueUsernameValidator(TextField<String> usernameField, final String allowedValue) {
    Args.notNull(usernameField, "usernameField");
    this.usernameField = usernameField;
    this.allowedValue = allowedValue;
    CdiContainer.get().getNonContextualManager().inject(this);
}

From source file:eu.uqasar.web.provider.EntityProvider.java

License:Apache License

public EntityProvider() {
    CdiContainer.get().getNonContextualManager().inject(this);
}

From source file:eu.uqasar.web.provider.meta.MetaDataChoiceProvider.java

License:Apache License

public MetaDataChoiceProvider(List<T> entities, Class<T> clazz) {
    super(entities);
    CdiContainer.get().getNonContextualManager().inject(this);
    this.clazz = clazz;
}

From source file:eu.uqasar.web.provider.meta.MetaDataCreateMissingEntitiesChoiceProvider.java

License:Apache License

public MetaDataCreateMissingEntitiesChoiceProvider(List<T> entities, Class<T> clazz) {
    super(entities);
    CdiContainer.get().getNonContextualManager().inject(this);
    this.clazz = clazz;
}

From source file:eu.uqasar.web.security.UQasarRoleCheckingStrategy.java

License:Apache License

@Override
public boolean hasAnyRole(Role... roles) {
    CdiContainer.get().getNonContextualManager().inject(this);
    if ((provider == null) || (provider.getLoggedInUser() == null)) {
        return false;
    }//from   w ww .j  a  va  2s.  c om
    return provider.getLoggedInUser().hasAnyRoles(roles);
}