Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.sourceforge.jsdialect.collapse;
 
 
public class CollapseCommand {
    private Arguments arguments;
    private Element element;
    private String attributeName;
    public CollapseCommand(Arguments argumentsElement elementString attributeName) {
        this. = arguments;
        this. = element;
        this. = attributeName;
    }
    protected void execute() {
        String attributeValue = .getAttributeValue();
        String labelKey = JsDialectUtil.expressionValue(attributeValue).toString();
        String label = MessageResolutionUtils.resolveMessageForTemplate(labelKeynull);
        String inputId = DomUtils.getOrCreateId(.getDocument(), "nav");
        JavaScriptComposer.addOnDocumentReady(.getDocument(), jsCode(inputIdlabel));
        // Housekeeping
    }
    private String jsCode(String inputIdString label) {
        StringBuilder responsiveJs = new StringBuilder();
        // TODO: responsive-nav.js does not work in IE8-. Replace by another library.
        responsiveJs.append("if (isNotIE8orWorse()) { \n");
        responsiveJs.append("   responsiveNav(\"#" + inputId + "\", ");
        responsiveJs.append("     { label:\"" + "\\u2630 " + label + "\", insert: \"before\" }");
        responsiveJs.append("   );");
        responsiveJs.append("}\n");
        return responsiveJs.toString();
    }
New to GrepCode? Check out our FAQ X