Example usage for org.apache.wicket.markup.html SecurePackageResourceGuard getPattern

List of usage examples for org.apache.wicket.markup.html SecurePackageResourceGuard getPattern

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html SecurePackageResourceGuard getPattern.

Prototype

public List<SearchPattern> getPattern() 

Source Link

Document

Gets the current list of pattern.

Usage

From source file:com.googlecode.wicket.jquery.ui.plugins.Initializer.java

License:Apache License

@Override
public void init(Application application) {
    // Wysiwyg Plugin //
    IPackageResourceGuard packageResourceGuard = application.getResourceSettings().getPackageResourceGuard();

    if (packageResourceGuard instanceof SecurePackageResourceGuard) {
        SecurePackageResourceGuard guard = (SecurePackageResourceGuard) packageResourceGuard;

        if (!guard.getPattern().contains(new SearchPattern("+*.eot"))) {
            guard.addPattern("+*.eot");
            guard.addPattern("+*.woff");
            guard.addPattern("+*.ttf");
        }/*www.  j av  a 2s. c o m*/
    }
}

From source file:com.googlecode.wicket.jquery.ui.plugins.wysiwyg.WysiwygBehavior.java

License:Apache License

/**
 * Constructor/*www. jav  a  2  s .co  m*/
 * @param selector the html selector (ie: "#myId")
 * @param options the {@link Options}
 */
public WysiwygBehavior(String selector, Options options) {
    super(selector, METHOD, options);

    IPackageResourceGuard packageResourceGuard = Application.get().getResourceSettings()
            .getPackageResourceGuard();

    if (packageResourceGuard instanceof SecurePackageResourceGuard) {
        SecurePackageResourceGuard guard = (SecurePackageResourceGuard) packageResourceGuard;
        if (!guard.getPattern().contains(new SearchPattern("+*.eot"))) {
            guard.addPattern("+*.eot");
            guard.addPattern("+*.woff");
            guard.addPattern("+*.ttf");
        }
    }

    this.initReferences();
}