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

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


            throws IOException
    {
        for (Iterator entryIterator = entity.iterator(); entryIterator
                .hasNext();)
        {
            ScheduleEntry entry = (ScheduleEntry) entryIterator.next();

            if (containsEntry(planner, day, entry))
            {
                EntryWrapper wrapper = new EntryWrapper(entry, day, entity);
                writer.startElement(HTML.DIV_ELEM, planner);
View Full Code Here


                entityIterator.hasNext();
        ) {
            PlannerEntity entity = (PlannerEntity) entityIterator.next();

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

                if (id.equals(entry.getId())) {
                    return entry;
                }
            }
        }
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

        UIForm parentForm = getParentForm(schedule);
        TreeSet entrySet = new TreeSet(comparator);

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

        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, "selected", null);
            }

            writer.writeAttribute(HTML.STYLE_ATTR, "width: 100%", null);

            //draw the tooltip
            if (showTooltip(schedule))
            {
                writer.writeAttribute("onmouseover", getTooltipText(entry,
                        schedule), null);
            }

            if (!isSelected(schedule, entry) && !schedule.isReadonly())
            {
                writer.startElement("a", schedule);
                writer.writeAttribute("href", "#", null);

                String clientId = schedule.getClientId(context);
                StringBuffer mousedown = new StringBuffer();
                mousedown.append("document.forms['");
                mousedown.append(parentForm.getClientId(context));
                mousedown.append("']['");
                mousedown.append(clientId);
                mousedown.append("'].value='");
                mousedown.append(entry.getId());
                mousedown.append("'; document.forms['");
                mousedown.append(parentForm.getClientId(context));
                mousedown.append("'].submit()");
                writer
                        .writeAttribute("onmousedown", mousedown.toString(),
View Full Code Here

        return returnString;
    }

    private 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

        return cellClass;
    }

    private 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

                dayIterator.hasNext();
        ) {
            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);

            if (schedule.getAction() != null) {
                getFacesContext().getApplication().getActionListener()
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

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.