Package org.openfaces.util

Examples of org.openfaces.util.ScriptBuilder


        Rendering.renderInitScripts(currentInstance, initScript);

    }

    protected InitScript renderInitScript(FacesContext context, ScrollButton scrollButton) throws IOException {
        ScriptBuilder buf = new ScriptBuilder();
        JSONObject stylingParams = getStylingParamsObj(context, scrollButton);

        buf.initScript(context, scrollButton, "O$.ScrollButton._init",
                scrollButton.getParent().getClientId(context),
                scrollButton.getScrollDirection().toString(),
                stylingParams
        );
        return new InitScript(buf.toString(), new String[]{
                TableUtil.getTableUtilJsURL(context),
                Resources.internalURL(context, "timetable/scrollButton.js")
        });
    }
View Full Code Here


        String cancelButtonStyle = Styles.getCSSClass(context, component, confirmation.getCancelButtonStyle(), DEFAULT_NO_BUTTON_CLASS, confirmation.getCancelButtonClass());
        String rolloverCancelButtonStyle = Styles.getCSSClass(context, component, confirmation.getRolloverCancelButtonStyle(), StyleGroup.rolloverStyleGroup(), confirmation.getRolloverCancelButtonClass(), DEFAULT_ROLLOVER_BUTTON_CLASS);
        rolloverCancelButtonStyle = Styles.mergeClassNames(cancelButtonStyle, rolloverCancelButtonStyle);

        ScriptBuilder sb = new ScriptBuilder();
        String event = Rendering.getEventWithOnPrefix(context, confirmation, "o:confirmation");

        sb.initScript(context, confirmation, "O$.Confirmation._init",
                invokerId,
                event,
                confirmation.getDefaultButton(),
                confirmation.getAlignToInvoker(),
                new Object[]{
View Full Code Here

    }

    private void renderInitScript(FacesContext context, UIComponent component) throws IOException {
        TwoListSelection tls = (TwoListSelection) component;

        ScriptBuilder sb = new ScriptBuilder();
        sb.initScript(context, tls, "O$.TwoListSelection._init",
                Rendering.getEventsParam(tls, "onadd", "onremove", "onchange"),
                tls.isAllowAddRemoveAll(),
                tls.getReorderingAllowed(),
                tls.isDisabled(),
                Rendering.getRolloverClass(context, tls));
View Full Code Here

    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        MenuItem menuItem = (MenuItem) component;
        if (menuItem.getValue() == null)
            menuItem.setValue("Save");

        menuItem.setOnclick(new ScriptBuilder().functionCall("O$.ChartMenu._saveChart",
                getChart("<o:saveChartMenuItem>", menuItem)).getScript());
        if (menuItem.getIconUrl() == null)
            menuItem.setIconUrl(Resources.internalURL(
                    context, null, "chart/save.png", false));
View Full Code Here

        LoadingMode loadingMode = tabbedPane.getLoadingMode();

        String focusedClass = Styles.getCSSClass(context, tabbedPane,
                tabbedPane.getFocusedStyle(), StyleGroup.selectedStyleGroup(1), tabbedPane.getFocusedClass(), null);

        ScriptBuilder sb = new ScriptBuilder();
        String onselectionchange = tabbedPane.getOnselectionchange();
        sb.initScript(context, tabbedPane, "O$.TabbedPane._init",
                Rendering.getRolloverClass(context, tabbedPane),
                containerClass,
                rolloverContainerClass,
                borderClass,
                loadingMode,
View Full Code Here

        String switcherClassName = switcher.getClass().getName();
        int i = switcherClassName.lastIndexOf(".");
        switcherClassName = switcherClassName.substring(i + 1);

        ScriptBuilder script = new ScriptBuilder().initScript(context, switcher, "O$." + switcherClassName + "._init",
                concatenateArrays(params, additionalParams)
        );

        Rendering.renderInitScript(context, script,
                Resources.utilJsURL(context),
View Full Code Here

        final Integer entityIndex = chart.getEntityIndex();
        chart.setEntityIndex(-1);
        final String chartId = chart.getClientId(context);
        chart.setEntityIndex(entityIndex);

        ScriptBuilder buf = new ScriptBuilder();
        buf.functionCall("O$.ChartPopup._init", clientId, popup.getLoadingMode().toString(), chartId).semicolon();

        Rendering.renderInitScript(context, buf,
                Resources.utilJsURL(context),
                Resources.internalURL(context, "chart/chart.js"),
                (!clientLoadingMode ? Resources.ajaxUtilJsURL(context) : null));
View Full Code Here

        Object pullPopupFromContainerObj = dropDown.getAttributes().get("pullPopupFromContainer");
        boolean pullPopupFromContainer = pullPopupFromContainerObj != null &&
                (pullPopupFromContainerObj.equals("true") || pullPopupFromContainerObj.equals(Boolean.TRUE));
        params.add(pullPopupFromContainer);
        ScriptBuilder buf = new ScriptBuilder().initScript(facesContext, dropDown, "O$.DropDown._init",
                params.toArray());

        InitScript commonInitScript = new InitScript(buf, new String[]{
                Resources.utilJsURL(facesContext),
                getDropdownJsURL(facesContext)
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.