Package org.openfaces.util

Examples of org.openfaces.util.ScriptBuilder


        String userSpecifiedStyle = Styles.getCSSClass(context, actionBar, actionBar.getStyle(), actionBar.getStyleClass());
        JSONArray eventActions = getEventActions(context, actionBar);
        double actionRolloverBackgroundIntensity = actionBar.getActionRolloverBackgroundIntensity();
        double actionPressedBackgroundIntensity = actionBar.getActionPressedBackgroundIntensity();
        Rendering.renderInitScript(context, new ScriptBuilder().initScript(context, actionBar, "O$.Timetable._initEventActionBar",
                actionBar.getBackgroundIntensity(),
                userSpecifiedStyle,
                eventActions,
                actionRolloverBackgroundIntensity,
                actionPressedBackgroundIntensity));
View Full Code Here


* @author Dmitry Pikhulya
*/
public abstract class OUIClientActionRendererHelper {
    public void encodeAutomaticInvocationMode(FacesContext context, OUIClientAction clientAction) throws IOException {
        String invokerId = OUIClientActionHelper.getClientActionInvoker(context, clientAction, true);
        ScriptBuilder javaScript = new ScriptBuilder();
        if (invokerId != null) {
            javaScript.functionCall("O$.byIdOrName", invokerId).dot();
            javaScript.append(Rendering.getEventWithOnPrefix(context, clientAction, null)).append("=");
            javaScript.anonymousFunction(getClientActionScript(context, clientAction), "event").semicolon();
        }
        encodeAdditionalScript(context, javaScript, clientAction);
        AjaxUtil.renderAjaxSupport(context);
        Rendering.renderInitScript(context, new ScriptBuilder().onLoadScript(javaScript).semicolon());
    }
View Full Code Here

        Timetable timetable = timetableView.getTimetable();

        try {
            Rendering.renderInitScript(context,
                    new ScriptBuilder().initScript(context, timetableView, getJsInitFunctionName(),
                            DataUtil.formatDateTimeForJs(timetableView.getDay(), timeZone),
                            timetableView.getLocale(),
                            "MMMM, dd yyyy",
                            timetableView.getStartTime(),
                            timetableView.getEndTime(),
View Full Code Here

        writeIdAttribute(context, switcher);
        LayeredPane layeredPane = getLayeredPane(switcher);
        layeredPane.encodeAll(context);

        Timetable timetable = switcher.getTimetableView();
        Rendering.renderInitScript(context, new ScriptBuilder().initScript(context, switcher,
                "O$.TimePeriodSwitcher._init", timetable),
                Resources.utilJsURL(context),
                TimetableRenderer.getTimetableJsURL(context));

        writer.endElement("span");
View Full Code Here

    }

    protected String getClientActionScript(FacesContext context, OUIClientAction clientAction) {
        Ajax ajax = (Ajax) clientAction;
        AjaxInitializer initializer = new AjaxInitializer();
        ScriptBuilder script = new ScriptBuilder();
        script.functionCall("O$._ajaxReload",
                initializer.getRenderArray(context, ajax, ajax.getRender()),
                initializer.getAjaxParams(context, ajax)).semicolon();
        if (isDisableDefaultRequired(ajax))
            script.append("return false;");
        return script.toString();
    }
View Full Code Here

    @Override
    protected void encodeScriptsAndStyles(FacesContext context, PopupLayer component) throws IOException {
        super.encodeScriptsAndStyles(context, component);
        Rendering.renderInitScript(context,
                new ScriptBuilder().initScript(context, component, "O$.Debug._init"),
                Resources.internalURL(context, "util/debug.js"));

    }
View Full Code Here

        String styleClass = getInitialStyleClass(context, levelIndicator);
        String rolloverStyleClass = Styles.getCSSClass(context, levelIndicator, levelIndicator.getRolloverStyle(),
                StyleGroup.rolloverStyleGroup(), levelIndicator.getRolloverClass());

        ScriptBuilder buf = new ScriptBuilder().initScript(context, levelIndicator,
                "O$.LevelIndicator._init",
                getValue(levelIndicator),
                levelIndicator.getSegmentSize(),
                levelIndicator.getOrientation().toString(),
                levelIndicator.getFillDirection().toString(),
View Full Code Here

            encodeHint(context, hintLabel, hintClass, hint);

        writer.startElement("div", hintLabel);
        String clientId = component.getClientId(context);
        writer.writeAttribute("id", clientId + "::innerscripts", null);
        ScriptBuilder sb = new ScriptBuilder();
        sb.initScript(context, hintLabel, "O$.HintLabel._init",
                hintLabel.getHintTimeout(),
                hintClass,
                Rendering.getRolloverClass(context, hintLabel),
                hint != null);
View Full Code Here

                tabSet.getFocusedStyle(), StyleGroup.selectedStyleGroup(1), tabSet.getFocusedClass(), null);

        String onchange = tabSet.getOnchange();

        String defaultDisabledClass = DEFAULT_CLASS_PREFIX + "disabled";
             ScriptBuilder sb = new ScriptBuilder();
        sb.initScript(context, tabSet, "O$.TabSet._init",
                getTabIds(context, tabSet, tabs),
                selectedIndex,
                placement,
                new String[]{
                        tabClass,
View Full Code Here

        writer.writeAttribute("style", "display: none", null);
        String clientId = action.getClientId(context);
        writer.writeAttribute("id", clientId, null);

        Rendering.renderInitScript(context,
                new ScriptBuilder().initScript(context, action, "O$._initAction",
                        action.getId(),
                        ActionHelper.extractActionStr(action, "action"),
                        ActionHelper.extractActionStr(action, "listener")),
                Resources.utilJsURL(context));
View Full Code Here

TOP

Related Classes of org.openfaces.util.ScriptBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.