Package org.openfaces.component.timetable

Examples of org.openfaces.component.timetable.EventPreview


    @Override
    public void setComponentProperties(FacesContext facesContext, UIComponent component) {
        super.setComponentProperties(facesContext, component);

        EventPreview eventPreview = (EventPreview) component;
        setStringProperty(eventPreview, "eventNameStyle");
        setStringProperty(eventPreview, "eventNameClass");
        setStringProperty(eventPreview, "eventDescriptionStyle");
        setStringProperty(eventPreview, "eventDescriptionClass");
        setBooleanProperty(eventPreview, "escapeEventName");
View Full Code Here


*/
public class EventPreviewRenderer extends RendererBase {

    @Override
    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        EventPreview eventPreview = (EventPreview) component;
        String clientId = eventPreview.getClientId(context);
        ResponseWriter writer = context.getResponseWriter();
        writer.startElement("div", eventPreview);
        writer.writeAttribute("id", clientId, null);

        PopupLayer popupLayer = Components.getOrCreateFacet(
                context, component, PopupLayer.COMPONENT_TYPE, "_popupLayer", PopupLayer.class);
        popupLayer.setId(eventPreview.getId() + Rendering.SERVER_ID_SUFFIX_SEPARATOR + "popupLayer");
        popupLayer.setStyle(eventPreview.getStyle());
        popupLayer.setStyleClass(eventPreview.getStyleClass());
        popupLayer.setHideOnOuterClick(true);
        popupLayer.encodeAll(context);

        OUIComponent timetableView = (OUIComponent) eventPreview.getParent();

        String componentJs;
        if (timetableView instanceof MonthTable) {
            componentJs = "timetable/monthTable.js";
        } else if (timetableView instanceof WeekTable) {
            componentJs = "timetable/weekTable.js";
        } else {
            componentJs = "timetable/dayTable.js";
        }

        Rendering.renderInitScript(context,
                new ScriptBuilder().initScript(context, eventPreview, "O$.Timetable._initEventPreview",
                        timetableView,
                        eventPreview.getShowingDelay(),
                        Styles.getCSSClass(context, eventPreview, eventPreview.getStyle(), StyleGroup.regularStyleGroup(), eventPreview.getStyleClass(), "o_eventPreview"),
                        Styles.getCSSClass(context, eventPreview, eventPreview.getEventNameStyle(), StyleGroup.regularStyleGroup(), eventPreview.getEventNameClass()),
                        Styles.getCSSClass(context, eventPreview, eventPreview.getEventDescriptionStyle(), eventPreview.getEventDescriptionClass()),
                        eventPreview.getHorizontalAlignment(),
                        eventPreview.getVerticalAlignment(),
                        eventPreview.getHorizontalDistance(),
                        eventPreview.getVerticalDistance()),
                Resources.utilJsURL(context),
                Resources.internalURL(context, "timetable/rangeMap.js"),
                Resources.internalURL(context, "timetable/timetable.js"),
                Resources.internalURL(context, componentJs));

View Full Code Here

TOP

Related Classes of org.openfaces.component.timetable.EventPreview

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.