Package org.apache.click.control

Examples of org.apache.click.control.Option


        fieldSet.add(startDateField);

        fieldSet.add(endDateField);

        repeatCountField.add(new Option("-1", "Run continuously"));
        repeatCountField.add(new Option("0", "Run once"));
        repeatCountField.add(new Option("1", "Repeat 1"));
        repeatCountField.add(new Option("2", "Repeat 2"));
        repeatCountField.add(new Option("3", "Repeat 3"));
        repeatCountField.add(new Option("4", "Repeat 4"));
        repeatCountField.add(new Option("5", "Repeat 5"));
        repeatCountField.add(new Option("10", "Repeat 10"));
        repeatCountField.add(new Option("20", "Repeat 20"));
        repeatCountField.setValue("-1");
        fieldSet.add(repeatCountField);

        repeatIntervalField.add(new Option("60000", "1 minute"));
        repeatIntervalField.add(new Option("120000", "2 minutes"));
        repeatIntervalField.add(new Option("300000", "5 minutes"));
        repeatIntervalField.add(new Option("600000", "10 minutes"));
        repeatIntervalField.add(new Option("900000", "15 minutes"));
        repeatIntervalField.add(new Option("1800000", "30 minutes"));
        repeatIntervalField.add(new Option("3600000", "1 hour"));
        repeatIntervalField.add(new Option("7200000", "2 hours"));
        repeatIntervalField.add(new Option("10800000", "3 hours"));
        repeatIntervalField.add(new Option("21600000", "6 hours"));
        repeatIntervalField.add(new Option("43200000", "12 hours"));
        repeatIntervalField.add(new Option("86400000", "24 hours"));
        repeatIntervalField.setValue("3600000");
        fieldSet.add(repeatIntervalField);

        Submit saveSubmit = new Submit("Save");
        saveSubmit.setActionListener(new ActionListener(){
View Full Code Here


        super.onInit();

        List<Customer> customerList = customerService.getCustomers();
        customerSelect.add(Option.EMPTY_OPTION);
        for (Customer customer : customerList) {
            customerSelect.add(new Option(customer.getId(), customer.getName()));
        }

        if (getContext().isForward() && courseBooking != null) {
            customerSelect.setValueObject(courseBooking.getCustomerId());
            dateField.setDate(courseBooking.getBookingDate());
View Full Code Here

        form.setErrorsPosition(Form.POSITION_TOP);

        // Gender Select
        genderSelect = new Select("gender");
        genderSelect.setRequired(true);
        genderSelect.add(new Option("U", ""));
        genderSelect.add(new Option("M", "Male"));
        genderSelect.add(new Option("F", "Female"));
        form.add(genderSelect);

        // Investment Select
        List investmentOptions = new ArrayList();

        OptionGroup property = new OptionGroup("property");
        property.add(new Option("Commerical Property", "Commercial"));
        property.add(new Option("Residential Property", "Residential"));
        investmentOptions.add(property);

        OptionGroup securities = new OptionGroup("securities");
        securities.add(new Option("Bonds"));
        securities.add(new Option("Options"));
        securities.add(new Option("Stocks"));
        investmentOptions.add(securities);

        investmentSelect = new Select("investment");
        investmentSelect.setOptionList(investmentOptions);
        investmentSelect.setMultiple(true);
View Full Code Here

    private PickList pickList = new PickList("languages");

    public PickListDemo() {
        pickList.setHeaderLabel("Languages", "Selected");

        pickList.add(new Option("002", "C/C++"));
        pickList.add(new Option("003", "C#"));
        pickList.add(new Option("004", "Fortran"));
        pickList.add(new Option("005", "Java"));
        pickList.add(new Option("006", "Ruby"));
        pickList.add(new Option("007", "Perl"));
        pickList.add(new Option("008", "Visual Basic"));

        pickList.addSelectedValue("004");

        form.add(pickList);
View Full Code Here

    @Override
    public void onInit() {
        super.onInit();

        List<Customer> customers = customerService.getCustomers();
        select.add(new Option("[Select]"));
        select.addAll(customers, "id", "name");
        applyOptions();
    }
View Full Code Here

    public void onInit() {
        super.onInit();

        List<Customer> customerList = customerService.getCustomersSortedByName(8);
        for (Customer customer : customerList) {
            customerSelect.add(new Option(customer.getId(), customer.getName()));
        }

        customerSelect.setSize(customerList.size());
    }
View Full Code Here

            String msg = "options parameter cannot be null";
            throw new IllegalArgumentException(msg);
        }
        for (Iterator i = options.entrySet().iterator(); i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();
            Option option = new Option(entry.getKey().toString(), entry
                    .getValue().toString());
            getOptionList().add(option);
        }
    }
View Full Code Here

            String msg = "options parameter cannot be null";
            throw new IllegalArgumentException(msg);
        }
        for (int i = 0; i < options.length; i++) {
            String value = options[i];
            getOptionList().add(new Option(value, value));
        }
    }
View Full Code Here

            try {
                Object valueResult = PropertyUtils.getValue(object, value, cache);
                Object labelResult = PropertyUtils.getValue(object, label, cache);

                Option option = null;

                if (labelResult != null) {
                    option = new Option(valueResult, labelResult.toString());
                } else {
                    option = new Option(valueResult.toString());
                }

                getOptionList().add(option);

            } catch (Exception e) {
View Full Code Here

        List optionList     = getOptionList();
        List selectedValues = getSelectedValues();
        List options        = new ArrayList();

        for (int i = 0; i < optionList.size(); i++) {
            Option option = (Option) optionList.get(i);
            Map map = new HashMap();
            map.put("option", option);
            map.put("selected", new Boolean(selectedValues.contains(option.getValue())));
            options.add(map);
        }

        // Add all attributes to buffer
        HtmlStringBuffer attributesBuffer = new HtmlStringBuffer();
View Full Code Here

TOP

Related Classes of org.apache.click.control.Option

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.