Package org.apache.ecs.html

Examples of org.apache.ecs.html.Select


     * @return A select object with am/pm.
     */
    public static Select getAMPMSelector(String name,
                                         Calendar now)
    {
        Select ampmSelect = new Select().setName(name);

        Option o = new Option();
        o.addElement("am");
        o.setValue(Calendar.AM);
        if (now.get(Calendar.AM_PM) == Calendar.AM)
        {
            o.setSelected(true);
        }
        ampmSelect.addElement(o);

        o = new Option();
        o.addElement("pm");
        o.setValue(Calendar.PM);
        if (now.get(Calendar.AM_PM) == Calendar.PM)
        {
            o.setSelected(true);
        }
        ampmSelect.addElement(o);

        return(ampmSelect);
    }
View Full Code Here


            this.useDate.setTime ( new Date() );
        }

        ConcreteElement secondSelect = null;

        Select ampmSelect = getAMPMSelector(selName + AMPM_SUFFIX, useDate);

        Select hourSelect = getHourSelector(selName + HOUR_SUFFIX,
                                            useDate, this.timeFormat);

        Select minuteSelect = getMinuteSelector(selName + MINUTE_SUFFIX,        
                                            useDate, this.minuteInterval);
                                           
        if (this.showSeconds)
        {
            Select tmp = getSecondSelector(selName + SECOND_SUFFIX, useDate,
                                                        this.secondInterval);
            if (onChangeSet)
                tmp.setOnChange(onChange);
            secondSelect = tmp;
        }
        else
        {
            secondSelect = new Input(Input.hidden,
View Full Code Here

        this.names = names;
        this.values = values;
        this.size = size;
        this.selected = selected;

        sel = new Select(name, size);
        sel.setName(name);
        sel.setSize(size);
    }
View Full Code Here

    /**
     * Resets the internal state of the SelectorBox.
     */
    public void reset()
    {
        sel = new Select(name, size);
    }
View Full Code Here

     * @param now Calendar to start with.
     * @return A select object with all the months.
     */
    public static Select getMonthSelector(String name, Calendar now)
    {
        Select monthSelect = new Select().setName(name);

        for (int curMonth = 0; curMonth <= 11; curMonth++)
        {
            Option o = new Option();
            o.addElement(monthName[curMonth]);
            o.setValue(curMonth);
            if ((now.get(Calendar.MONTH)) == curMonth)
            {
                o.setSelected(true);
            }
            monthSelect.addElement(o);
        }
        return (monthSelect);
    }
View Full Code Here

     * @param now Calendar to start with.
     * @return A select object with all the days in a month.
     */
    public static Select getDaySelector(String name, Calendar now)
    {
        Select daySelect = new Select().setName(name);

        for (int currentDay = 1; currentDay <= 31; currentDay++)
        {
            Option o = new Option();
            o.addElement(Integer.toString(currentDay));
            o.setValue(currentDay);
            if (now.get(Calendar.DAY_OF_MONTH) == currentDay)
            {
                o.setSelected(true);
            }
            daySelect.addElement(o);
        }
        return (daySelect);
    }
View Full Code Here

     */
    public static Select getYearSelector(String name,
                                         int firstYear, int lastYear,
                                         int selectedYear)
    {
        Select yearSelect = new Select().setName(name);

        for (int currentYear = firstYear;
             currentYear <= lastYear;

             currentYear++)
        {
            Option o = new Option();
            o.addElement(Integer.toString(currentYear));
            o.setValue(currentYear);
            if (currentYear == selectedYear)
            {
                o.setSelected(true);
            }
            yearSelect.addElement(o);
        }
        return (yearSelect);
    }
View Full Code Here

        if (this.useDate == null)
        {
            this.useDate.setTime(new Date());
        }

        Select monthSelect = getMonthSelector(selName + MONTH_SUFFIX, useDate);
        ConcreteElement daySelect = null;
        if (!showDays)
        {
            daySelect = new Input(Input.hidden, selName + DAY_SUFFIX, setDay);
        }
        else
        {
            Select tmp = getDaySelector(selName + DAY_SUFFIX, useDate);
            if (onChangeSet)
            {
                tmp.setOnChange(onChange);
            }
            daySelect = tmp;
        }
        Select yearSelect = null;
        if (useYears)
        {
            yearSelect = getYearSelector(selName + YEAR_SUFFIX,
                    firstYear, lastYear, selectedYear);
        }
        else
        {
            yearSelect = getYearSelector(selName + YEAR_SUFFIX, useDate);
        }
        if (onChangeSet)
        {
            monthSelect.setOnChange(onChange);
            yearSelect.setOnChange(onChange);
        }
        ElementContainer ec = new ElementContainer();
        // ec.addElement(new Comment("== BEGIN org.apache.turbine.util.DateSelector.ecsOutput() =="));
        ec.addElement(monthSelect);
        ec.addElement(daySelect);
View Full Code Here

        this.names = names;
        this.values = values;
        this.size = size;
        this.selected = selected;

        sel = new Select(name, size);
        sel.setName(name);
        sel.setSize(size);
    }
View Full Code Here

    /**
     * Resets the internal state of the SelectorBox.
     */
    public void reset()
    {
        sel = new Select(name, size);
    }
View Full Code Here

TOP

Related Classes of org.apache.ecs.html.Select

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.