Examples of HtmlSchedule


Examples of org.apache.myfaces.custom.schedule.HtmlSchedule

            return;
        }

        super.encodeBegin(context, component);

        HtmlSchedule schedule = (HtmlSchedule) component;
        ResponseWriter writer = context.getResponseWriter();

        //container div for the schedule grid
        writer.startElement(HTML.DIV_ELEM, schedule);
        writer.writeAttribute(HTML.CLASS_ATTR, "schedule-compact", null);
        writer.writeAttribute(
            HTML.STYLE_ATTR, "border-style: none; overflow: hidden;", null
        );

        writer.startElement(HTML.TABLE_ELEM, schedule);
        writer.writeAttribute(HTML.CLASS_ATTR, "month", null);
        writer.writeAttribute(
            HTML.STYLE_ATTR, "position: relative; left: 0px; top: 0px; width: 100%;",
            null
        );
        writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
        writer.writeAttribute(HTML.CELLSPACING_ATTR, "1", null);
        writer.writeAttribute("border", "0", null);
        writer.writeAttribute(HTML.WIDTH_ATTR, "100%", null);
        writer.startElement(HTML.TBODY_ELEM, schedule);

        Calendar cal = GregorianCalendar.getInstance();

        for (
            Iterator dayIterator = schedule.getModel().iterator();
                dayIterator.hasNext();
        ) {
            ScheduleDay day = (ScheduleDay) dayIterator.next();
            cal.setTime(day.getDate());
View Full Code Here

Examples of org.apache.myfaces.custom.schedule.HtmlSchedule

        getDelegateRenderer(component).encodeEnd(context, component);
    }

    private Renderer getDelegateRenderer(UIComponent component)
    {
        HtmlSchedule schedule = (HtmlSchedule) component;

        if ((schedule == null) || (schedule.getModel() == null))
        {
            return dayDelegate;
        }

        switch (schedule.getModel().getMode())
        {
        case ScheduleModel.WEEK:
            return weekDelegate;

        case ScheduleModel.MONTH:
View Full Code Here

Examples of org.apache.myfaces.custom.schedule.HtmlSchedule

            return;
        }

        super.encodeBegin(context, component);

        HtmlSchedule schedule = (HtmlSchedule) component;
        ResponseWriter writer = context.getResponseWriter();

        //container div for the schedule grid
        writer.startElement(HTML.DIV_ELEM, schedule);
        writer.writeAttribute(HTML.CLASS_ATTR, "schedule-compact", null);
        writer.writeAttribute(
            HTML.STYLE_ATTR, "border-style: none; overflow: hidden;", null
        );

        writer.startElement(HTML.TABLE_ELEM, schedule);
        writer.writeAttribute(HTML.CLASS_ATTR, "week", null);
        writer.writeAttribute(
            HTML.STYLE_ATTR, "position: relative; left: 0px; top: 0px; width: 100%;",
            null
        );
        writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
        writer.writeAttribute(HTML.CELLSPACING_ATTR, "1", null);
        writer.writeAttribute("border", "0", null);
        writer.writeAttribute(HTML.WIDTH_ATTR, "100%", null);
        writer.startElement(HTML.TBODY_ELEM, schedule);

        Calendar cal = GregorianCalendar.getInstance();

        for (
            Iterator dayIterator = schedule.getModel().iterator();
                dayIterator.hasNext();
        ) {
            ScheduleDay day = (ScheduleDay) dayIterator.next();
            cal.setTime(day.getDate());
View Full Code Here

Examples of org.apache.myfaces.custom.schedule.HtmlSchedule

            return;
        }

        super.encodeBegin(context, component);

        HtmlSchedule schedule = (HtmlSchedule) component;
        ResponseWriter writer = context.getResponseWriter();

        //the number of rows in the grid is the number of half hours between
        //visible start hour and visible end hour, plus 1 for the header
        int numberOfRows = ((schedule.getVisibleEndHour() - schedule
                .getVisibleStartHour()) * 2) + 1;

        //the grid height = 22 pixels times the number of rows + 3, for the
        //table border and the cellpadding
        int gridHeight = (numberOfRows * 22) + 3 + 10;
View Full Code Here

Examples of org.apache.myfaces.custom.schedule.HtmlSchedule

        if (!component.isRendered())
        {
            return;
        }

        HtmlSchedule schedule = (HtmlSchedule) component;
        ResponseWriter writer = context.getResponseWriter();

        for (Iterator dayIterator = schedule.getModel().iterator(); dayIterator
                .hasNext();)
        {
            ScheduleDay day = (ScheduleDay) dayIterator.next();
            writer.startElement(HTML.TD_ELEM, schedule);
            writer.writeAttribute(HTML.CLASS_ATTR, "column", null);
View Full Code Here

Examples of org.apache.myfaces.custom.schedule.HtmlSchedule

        if (!component.isRendered())
        {
            return;
        }

        HtmlSchedule schedule = (HtmlSchedule) component;
        ResponseWriter writer = context.getResponseWriter();

        writeForegroundEnd(context, schedule, writer);
        writer.endElement(HTML.DIV_ELEM);
    }
View Full Code Here

Examples of org.apache.myfaces.custom.schedule.HtmlSchedule

     */
    public void decode(FacesContext context, UIComponent component)
    {
        if (ScheduleUtil.canModifyValue(component))
        {
            HtmlSchedule schedule = (HtmlSchedule) component;
            Map parameters = context.getExternalContext()
                    .getRequestParameterMap();
            String selectedEntryId = (String) parameters.get((String) schedule
                    .getClientId(context));

            if ((selectedEntryId != null) && (selectedEntryId.length() > 0))
            {
                schedule.setSubmittedEntry(schedule.findEntry(selectedEntryId));
                schedule.queueEvent(new ActionEvent(schedule));
            }
        }
    }
View Full Code Here

Examples of org.apache.myfaces.custom.schedule.HtmlSchedule

        if (!component.isRendered())
        {
            return;
        }

        HtmlSchedule schedule = (HtmlSchedule) component;
        ResponseWriter writer = context.getResponseWriter();

        //determine the CSS file for the chosen theme
        String theme = getTheme(schedule);
        if (theme == null || theme.length() < 1)
            theme = "default";
        String css = "css/" + theme + ".css";

        //add needed CSS and Javascript files to the header

        AddResource.addStyleSheet(HtmlSchedule.class, css, context);
        AddResource.addJavaScriptToHeader(HtmlSchedule.class,
                "javascript/alphaAPI.js", context);
        AddResource.addJavaScriptToHeader(HtmlSchedule.class,
                "javascript/domLib.js", context);
        AddResource.addJavaScriptToHeader(HtmlSchedule.class,
                "javascript/domTT.js", context);
        AddResource.addJavaScriptToHeader(HtmlSchedule.class,
                "javascript/fadomatic.js", context);

        //hidden input field containing the id of the selected entry
        writer.startElement(HTML.INPUT_ELEM, schedule);
        writer.writeAttribute(HTML.TYPE_ATTR, "hidden", null);
        writer.writeAttribute(HTML.NAME_ATTR, schedule.getClientId(context),
                "clientId");
        writer.endElement(HTML.INPUT_ELEM);
    }
View Full Code Here

Examples of org.apache.myfaces.custom.schedule.HtmlSchedule

     * @see javax.faces.render.Renderer#decode(javax.faces.context.FacesContext,
     *      javax.faces.component.UIComponent)
     */
    public void decode(FacesContext context, UIComponent component)
    {
        HtmlSchedule schedule = (HtmlSchedule) component;
        boolean queueAction = false;
        if (ScheduleUtil.canModifyValue(component))
        {
            Map parameters = context.getExternalContext()
                    .getRequestParameterMap();
            String selectedEntryId = (String) parameters.get((String) schedule
                    .getClientId(context));
            String lastClickedDateId = (String) parameters
                    .get((String) schedule.getClientId(context)
                            + LAST_CLICKED_DATE);
            String lastClickedY = (String) parameters.get((String) schedule
                    .getClientId(context)
                    + LAST_CLICKED_Y);

            ScheduleMouseEvent mouseEvent = null;

            if ((selectedEntryId != null) && (selectedEntryId.length() > 0))
            {
                ScheduleEntry entry = schedule.findEntry(selectedEntryId);
                schedule.setSubmittedEntry(entry);
                mouseEvent = new ScheduleMouseEvent(schedule,
                        ScheduleMouseEvent.SCHEDULE_ENTRY_CLICKED);
                queueAction = true;
            }

            if (schedule.isSubmitOnClick())
            {
                schedule.resetMouseEvents();
                if ((lastClickedY != null) && (lastClickedY.length() > 0))
                {
                    //the body of the schedule was clicked
                    schedule
                            .setLastClickedDateAndTime(determineLastClickedDate(
                                    schedule, lastClickedDateId, lastClickedY));
                    mouseEvent = new ScheduleMouseEvent(schedule,
                            ScheduleMouseEvent.SCHEDULE_BODY_CLICKED);
                    queueAction = true;
                }
                else if ((lastClickedDateId != null)
                        && (lastClickedDateId.length() > 0))
                {
                    //the header of the schedule was clicked
                    schedule
                            .setLastClickedDateAndTime(determineLastClickedDate(
                                    schedule, lastClickedDateId, "0"));
                    mouseEvent = new ScheduleMouseEvent(schedule,
                            ScheduleMouseEvent.SCHEDULE_HEADER_CLICKED);
                    queueAction = true;
                }
                else if (mouseEvent == null)
                {
                    //the form was posted without mouse events on the schedule
                    mouseEvent = new ScheduleMouseEvent(schedule,
                            ScheduleMouseEvent.SCHEDULE_NOTHING_CLICKED);
                }
            }

            if (mouseEvent != null)
                schedule.queueEvent(mouseEvent);
        }
        if (queueAction)
        {
            schedule.queueEvent(new ActionEvent(schedule));
        }
    }
View Full Code Here

Examples of org.apache.myfaces.custom.schedule.HtmlSchedule

        if (!component.isRendered())
        {
            return;
        }

        HtmlSchedule schedule = (HtmlSchedule) component;
        ResponseWriter writer = context.getResponseWriter();

        //add needed CSS and Javascript files to the header

        AddResource addResource = AddResourceFactory.getInstance(context);
        String theme = getTheme(schedule);
        //The default css file is only loaded if the theme is one of the provided
        //themes.
        if (DEFAULT_THEME.equals(theme) || OUTLOOK_THEME.equals(theme)
                || EVOLUTION_THEME.equals(theme))
        {
            addResource.addStyleSheet(context, AddResource.HEADER_BEGIN,
                    HtmlSchedule.class, CSS_RESOURCE);
        }
        addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
                HtmlSchedule.class, "javascript/schedule.js");
        addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
                HtmlSchedule.class, "javascript/alphaAPI.js");
        addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
                HtmlSchedule.class, "javascript/domLib.js");
        addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
                HtmlSchedule.class, "javascript/domTT.js");
        addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
                HtmlSchedule.class, "javascript/fadomatic.js");

        //hidden input field containing the id of the selected entry
        writer.startElement(HTML.INPUT_ELEM, schedule);
        writer.writeAttribute(HTML.TYPE_ATTR, "hidden", null);
        writer.writeAttribute(HTML.NAME_ATTR, schedule.getClientId(context),
                "clientId");
        writer.endElement(HTML.INPUT_ELEM);
        //hidden input field containing the id of the last clicked date
        writer.startElement(HTML.INPUT_ELEM, schedule);
        writer.writeAttribute(HTML.TYPE_ATTR, "hidden", null);
        writer.writeAttribute(HTML.NAME_ATTR, schedule.getClientId(context)
                + "_last_clicked_date", "clicked_date");
        writer.endElement(HTML.INPUT_ELEM);
        //hidden input field containing the y coordinate of the mouse when
        //the schedule was clicked. This will be used to determine the hour
        //of day.
        writer.startElement(HTML.INPUT_ELEM, schedule);
        writer.writeAttribute(HTML.TYPE_ATTR, "hidden", null);
        writer.writeAttribute(HTML.NAME_ATTR, schedule.getClientId(context)
                + "_last_clicked_y", "clicked_y");
        writer.endElement(HTML.INPUT_ELEM);
    }
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.