Package org.apache.ecs.html

Examples of org.apache.ecs.html.Select


    /**
     * Resets the internal state of the SelectorBox.
     */
    public void reset()
    {
        sel = new Select(name, size);
    }
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

                                                   int componentType,
                                                   String createButtonText,
                                                   Locale locale) {

        List componentImplChoices = pers.loadComponentImplementations(componentType);
        Select implSelect = new Select("compImpl" + componentType);
       
        // Sort components into alphabetical order by component names
        Collections.sort(componentImplChoices, new Comparator() {
            public int compare(Object o1, Object o2) {
                String componentName1 = ((PipeComponentIF) o1).getName();
                String componentName2 = ((PipeComponentIF) o2).getName();
                return componentName1.compareTo(componentName2);
            }
        });
       
        for(Iterator i = componentImplChoices.iterator(); i.hasNext();) {
            PipeComponentIF impl = (PipeComponentIF) i.next();
            implSelect.addElement(new Option(impl.getID()).addElement(impl.getName()));
        }

        Input createButton = new Input(Input.BUTTON, "cb", createButtonText);
        createButton.setOnClick("document.forms[0]." + CREATE_COMPONENT_OF_TYPE + ".value="
                + componentType + ";document.forms[0].action.value=" + ACTION_OK
View Full Code Here

        }
       
        // ---------------
        // Language select
        // ---------------
        Select languageSelect = new Select(LANGUAGE);
        for(int i = 0; i < LANGUAGES.length; i++)
            languageSelect.addElement(new Option(LANGUAGES[i][1]).addElement(LANGUAGES[i][0]));

        Table table = new Table()
            .addElement(
                new TR().addElement(
                    new TD().setAlign(AlignType.RIGHT).addElement(new B("Database"))).addElement(
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

     * @return A select object with second options.
     */
    public static Select getSecondSelector(String name, Calendar now,
                                           int interval)
    {
        Select secondSelect = new Select().setName(name);

        for (int currentSecond = 0; currentSecond <= 59; currentSecond += interval)
        {
            Option o = new Option();
            o.addElement(nbrFmt.format(currentSecond));
            o.setValue(currentSecond);
            int nearestSecond =
                    ((now.get(Calendar.SECOND) / interval) * interval);

            if (nearestSecond == currentSecond)
            {
                o.setSelected(true);
            }
            secondSelect.addElement(o);
        }
        return (secondSelect);
    }
View Full Code Here

     * @return A select object with minute options.
     */
    public static Select getMinuteSelector(String name, Calendar now,
                                           int interval)
    {
        Select minuteSelect = new Select().setName(name);

        for (int curMinute = 0; curMinute <= 59; curMinute += interval)
        {
            Option o = new Option();
            o.addElement(nbrFmt.format(curMinute));
            o.setValue(curMinute);
            int nearestMinute =
                    ((now.get(Calendar.MINUTE)) / interval) * interval;

            if (nearestMinute == curMinute)
            {
                o.setSelected(true);
            }
            minuteSelect.addElement(o);
        }
        return (minuteSelect);
    }
View Full Code Here

     * @param format Time format.
     * @return A select object with all the hours.
     */
    public static Select getHourSelector(String name, Calendar now, int format)
    {
        Select hourSelect = new Select().setName(name);

        if (format == TWENTY_FOUR_HOUR)
        {
            for (int currentHour = 0; currentHour <= 23; currentHour++)
            {
                Option o = new Option();
                o.addElement(nbrFmt.format(currentHour));
                o.setValue(currentHour);
                if (now.get(Calendar.HOUR_OF_DAY) == currentHour)
                {
                    o.setSelected(true);
                }
                hourSelect.addElement(o);
            }
        }
        else
        {
            for (int curHour = 1; curHour <= 12; curHour++)
            {
                Option o = new Option();

                o.addElement(nbrFmt.format((long) curHour));
                o.setValue(curHour);
                if (now.get(Calendar.AM_PM) == Calendar.AM)
                {
                    if (((now.get(Calendar.HOUR_OF_DAY)) == 0) &&
                            (curHour == 12))
                    {
                        o.setSelected(true);
                    }
                    else
                    {
                        if (now.get(Calendar.HOUR_OF_DAY) == curHour)
                        {
                            o.setSelected(true);
                        }
                    }
                }
                else
                {
                    if (((now.get(Calendar.HOUR_OF_DAY)) == 12) &&
                            (curHour == 12))
                    {
                        o.setSelected(true);
                    }
                    else
                    {
                        if (now.get(Calendar.HOUR_OF_DAY) == curHour + 12)
                        {
                            o.setSelected(true);
                        }
                    }
                }
                hourSelect.addElement(o);
            }
        }
        return (hourSelect);
    }
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.