Examples of FieldExpanderContext


Examples of com.volantis.mcs.protocols.widgets.FieldExpanderContext

            return;
        }
       
        // Push new FieldExpander context, which will be used
        // to gather data from inner elements for further rendering.
        FieldExpanderContext context = pushContext();
       
        require(MODULE, protocol, attributes);
       
        // Generate an ID, if it's not already there.
        if(attributes.getId() == null) {
            attributes.setId(
                   protocol.getMarinerPageContext().generateUniqueFCID());
        }      
       
        // Open the <div> element enclosing FieldExpander content.
        openDivElement(protocol, attributes);
       
        // Set attributes, which will be used to create marker element.
        context.setMarkerAttributes(attributes);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.widgets.FieldExpanderContext

        if (!isWidgetSupported(protocol)) {
            // Fallback behaviour
            return;
        }
     
        FieldExpanderContext context = getCurrentContext();

        // Close outstanding <div> element.
        DOMOutputBuffer currentBuffer = getCurrentBuffer(protocol);
       
        closeDivElement(protocol);
       
        Styles styles = attributes.getStyles();
        StyleValue unfoldon = styles.getPropertyValues().getSpecifiedValue(StylePropertyDetails.MCS_TOGGLE_EVENT);
        StyleValue initial_state = styles.getPropertyValues().getSpecifiedValue(StylePropertyDetails.MCS_INITIAL_STATE);
               
        // Create instances of styles extractors.
        StylesExtractor stylesExtractor =
            createStylesExtractor(protocol, attributes.getStyles());
       
        StylesExtractor disappearStylesExtractor =
            createStylesExtractor(protocol, attributes.getStyles());
        disappearStylesExtractor.setPseudoClass(StatefulPseudoClasses.MCS_CONCEALED);
       
        StylesExtractor unfoldedStylesExtractor =
            createStylesExtractor(protocol, attributes.getStyles());
        unfoldedStylesExtractor.setPseudoClass(StatefulPseudoClasses.MCS_UNFOLDED);
       
        stylesExtractor.setProtocol(protocol);
        unfoldedStylesExtractor.setProtocol(protocol);
        disappearStylesExtractor.setProtocol(protocol);
       
        stylesExtractor.getJavaScriptStyles();
        unfoldedStylesExtractor.getJavaScriptStyles();

       
        StringBuffer textToScript = new StringBuffer(150);
        textToScript.append("Widget.register(");
        textToScript.append(createJavaScriptString(attributes.getId()));
        textToScript.append(",new Widget.FieldExpander(");
        textToScript.append(createJavaScriptString(attributes.getId()));
        textToScript.append(", {");
        textToScript.append(" delay: ");
        textToScript.append(stylesExtractor.getTransitionInterval());
        textToScript.append(", ").append(getDisappearableOptions(disappearStylesExtractor));
        textToScript.append(", ").append(getAppearableOptions(stylesExtractor));
        textToScript.append(", unfoldedStyle: ");
        textToScript.append(unfoldedStylesExtractor.getJavaScriptStyles());
        if (unfoldon != null) {
            textToScript.append(", unfoldon: ");
            textToScript.append(createJavaScriptString(unfoldon.getStandardCSS()));
        }
        if (initial_state != null) {
            textToScript.append(", initial_state: ");
            textToScript.append(createJavaScriptString(initial_state.getStandardCSS()));
        }

        if (context.getSummaryElementId() != null) {
            textToScript.append(", ftElementId: ");
            textToScript.append(createJavaScriptString(context.getSummaryElementId()));
        }
       
        if (context.getDetailsElementId() != null) {
            textToScript.append(", fdElementId: ");
            textToScript.append(createJavaScriptString(context.getDetailsElementId()));
        }
       
        if (context.getSummaryFieldId() != null) {
            textToScript.append(", primFieldId: ");
            textToScript.append(createJavaScriptString(context.getSummaryFieldId()));
        }
       
        if (context.getFoldedMarkerId() != null) {
            textToScript.append(", foldedSpanId: ");
            textToScript.append(createJavaScriptString(context.getFoldedMarkerId()));
        }
       
        if (context.getUnfoldedMarkerId() != null) {
            textToScript.append(", unfoldedSpanId: ");
            textToScript.append(createJavaScriptString(context.getUnfoldedMarkerId()));
        }
       
        textToScript.append("}));");
    
          
View Full Code Here

Examples of com.volantis.mcs.protocols.widgets.FieldExpanderContext

     * Creates a marker indicating the state of the widged - folded or unfolded
     */
    private void createMarker(VolantisProtocol protocol, MCSAttributes attributes,
            DOMOutputBuffer currentBuffer) throws ProtocolException {
       
        FieldExpanderContext fieldExpander = getCurrentContext();
       
        // Generate ID for folded and unfolded markers,
        // so they can be passed to the Widget.FieldExpander()
        // JavaScript constructor.
     
        // common mechanism used for all marker-related scenarios
        Styles markerFoldedStyles = getFoldedMarkerStyles(protocol, attributes);
        String foldedMarkerId = renderFoldedMarker(protocol, DEFAULT_FOLDED_MARKER, markerFoldedStyles, null);
        fieldExpander.setFoldedMarkerId(foldedMarkerId);

        Styles markerUnfoldedStyles = getUnfoldedMarkerStyles(protocol, attributes);
        String unfoldedMarkerId = renderUnfoldedMarker(protocol, DEFAULT_UNFOLDED_MARKER, markerUnfoldedStyles, null);
        fieldExpander.setUnfoldedMarkerId(unfoldedMarkerId);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.widgets.FieldExpanderContext

     * Creates and returns new instance of FieldExpander.
     *
     * @return The FieldExpander.
     */
    private FieldExpanderContext createContext() {
        return new FieldExpanderContext();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.