src/main/java/org/efaps/ui/wicket/util/DojoWrapper.java
public static CharSequence require(final CharSequence _script,
                                       final DojoClass... _classes)
    {
        final TreeMap<Double, DojoLayer> layers = new TreeMap<>();
        for (final DojoLayer layer : DojoLayer.values()) {
            long count = 0;
            for (final DojoClass dojoClass : _classes) {
                if (layer.getDojoClasses().contains(dojoClass)) {
                    count++;
                }
            }
            if (count > 0) {
                final double weight = (double) count / (double) layer.getDojoClasses().size();
                layers.put(weight, layer);
            }
        }
        return DojoWrapper.require(_script, layers.isEmpty() ? null
                        : layers.descendingMap().values().iterator().next().getName(), _classes);
    }
public static CharSequence require(final CharSequence _script,
                                       final DojoClass... _classes)
    {
        final TreeMap<Double, DojoLayer> layers = new TreeMap<>();
        for (final DojoLayer layer : DojoLayer.values()) {
            long count = 0;
            for (final DojoClass dojoClass : _classes) {
                if (layer.getDojoClasses().contains(dojoClass)) {
                    count++;
                }
            }
            if (count > 0) {
                final double weight = (double) count / (double) layer.getDojoClasses().size();
                layers.put(weight, layer);
            }
        }
        return DojoWrapper.require(_script, layers.isEmpty() ? null
                        : layers.descendingMap().values().iterator().next().getName(), _classes);
    }
Require.

@param _script the script
@param _classes the classes
@return the char sequence