Package org.apache.myfaces.custom.schedule.model

Examples of org.apache.myfaces.custom.schedule.model.ScheduleEntry


        {
            ScheduleDay day = (ScheduleDay) dayIterator.next();

            for (Iterator iter = day.iterator(); iter.hasNext();)
            {
                ScheduleEntry entry = (ScheduleEntry) iter.next();

                if (id.equals(entry.getId()))
                {
                    return entry;
                }
            }
        }
View Full Code Here


         */
        public void processAction(ActionEvent event)
                throws AbortProcessingException
        {
            UISchedule schedule = (UISchedule) event.getComponent();
            ScheduleEntry entry = schedule.getSubmittedEntry();
            schedule.getModel().setSelectedEntry(entry);
            schedule.setSubmittedEntry(null);
        }
View Full Code Here

        final String formId = parentFormInfo == null ? null : parentFormInfo.getFormName();
        final TreeSet entrySet = new TreeSet(comparator);

        for (Iterator entryIterator = day.iterator(); entryIterator.hasNext();)
        {
            ScheduleEntry entry = (ScheduleEntry) entryIterator.next();
            entrySet.add(entry);
        }

        if (entrySet.size() > 0)
        {
            writer.startElement(HTML.TABLE_ELEM, schedule);
            writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
            writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
            writer.writeAttribute(HTML.STYLE_ATTR, "width: 100%;", null);          

            for (Iterator entryIterator = entrySet.iterator(); entryIterator
            .hasNext();)
            {
                ScheduleEntry entry = (ScheduleEntry) entryIterator.next();
                writer.startElement(HTML.TR_ELEM, schedule);
                writer.startElement(HTML.TD_ELEM, schedule);

                if (isSelected(schedule, entry))
                {
                    writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
                            "selected"), null);
                }

                //compose the CSS style for the entry box
                StringBuffer entryStyle = new StringBuffer();
                entryStyle.append("width: 100%;");
                String entryColor = getEntryRenderer(schedule).getColor(context, schedule, entry, isSelected(schedule, entry));
                if (isSelected(schedule, entry) && entryColor != null) {
                    entryStyle.append(" background-color: ");
                    entryStyle.append(entryColor);
                    entryStyle.append(";");
                    entryStyle.append(" border-color: ");
                    entryStyle.append(entryColor);
                    entryStyle.append(";");
                }

                writer.writeAttribute(HTML.STYLE_ATTR, entryStyle.toString(), null);

                // draw the tooltip
                if (schedule.isTooltip())
                {
                    getEntryRenderer(schedule).renderToolTip(context, writer,
                            schedule, entry, isSelected(schedule, entry));
                }

                if (!isSelected(schedule, entry) && !schedule.isReadonly())
                {
                    writer.startElement(HTML.ANCHOR_ELEM, schedule);
                    writer.writeAttribute(HTML.HREF_ATTR, "#", null);

                    writer.writeAttribute(
                            HTML.ONCLICK_ATTR,
                            "fireEntrySelected('"
                            + formId + "', '"
                            + clientId + "', '"
                            + entry.getId()
                            + "');",
                            null);
                }

                // draw the content
View Full Code Here

        }
    }

    protected boolean isSelected(HtmlSchedule schedule, ScheduleEntry entry)
    {
        ScheduleEntry selectedEntry = schedule.getModel().getSelectedEntry();

        if (selectedEntry == null)
        {
            return false;
        }

        return selectedEntry.getId().equals(entry.getId());
    }
View Full Code Here

     */
    public int compare(Object o1, Object o2)
    {
        if (o1 instanceof ScheduleEntry && o2 instanceof ScheduleEntry)
        {
            ScheduleEntry entry1 = (ScheduleEntry) o1;
            ScheduleEntry entry2 = (ScheduleEntry) o2;

            int returnint = entry1.getStartTime().compareTo(
                    entry2.getStartTime());
            if (returnint == 0)
            {
                returnint = entry1.getEndTime().compareTo(entry2.getEndTime());
            }
            if (returnint == 0)
            {
                returnint = entry1.getId().compareTo(entry2.getId());
            }

            return returnint;
        }

View Full Code Here

        return getStyleClass(schedule, cellClass);
    }

    protected boolean isSelected(HtmlSchedule schedule, EntryWrapper entry)
    {
        ScheduleEntry selectedEntry = schedule.getModel().getSelectedEntry();

        if (selectedEntry == null)
        {
            return false;
        }

        boolean returnboolean = selectedEntry.getId().equals(
                entry.entry.getId());

        return returnboolean;
    }
View Full Code Here

            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;
            }
View Full Code Here

        {
            ScheduleDay day = (ScheduleDay) dayIterator.next();

            for (Iterator iter = day.iterator(); iter.hasNext();)
            {
                ScheduleEntry entry = (ScheduleEntry) iter.next();

                if (id.equals(entry.getId()))
                {
                    return entry;
                }
            }
        }
View Full Code Here

         */
        public void processAction(ActionEvent event)
                throws AbortProcessingException
        {
            UISchedule schedule = (UISchedule) event.getComponent();
            ScheduleEntry entry = schedule.getSubmittedEntry();
            schedule.getModel().setSelectedEntry(entry);
            schedule.setSubmittedEntry(null);
        }
View Full Code Here

        {
            ScheduleDay day = (ScheduleDay) dayIterator.next();

            for (Iterator iter = day.iterator(); iter.hasNext();)
            {
                ScheduleEntry entry = (ScheduleEntry) iter.next();

                if (id.equals(entry.getId()))
                {
                    return entry;
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.custom.schedule.model.ScheduleEntry

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.