Package org.apache.empire.commons

Examples of org.apache.empire.commons.Options


    protected Object formatInputValue(Object value, InputInfo ii)
    {
        if (value == null)
            return "";
        // Check options
        Options options = ii.getOptions();
        if (options != null && !options.isEmpty())
            return value;
        // Format
        return formatValue(value, ii);
    }
View Full Code Here


            {   // Not enough columns
                error(Errors.InvalidArg, sqlCmd, "sqlCmd");
                return null;
            }
            // Check Result
            Options result = new Options();
            while (rs.next())
            {
                Object value = rs.getObject(1);
                String text  = rs.getString(2);
                result.add(value, text, true);
            }
            // No Value
            if (log.isInfoEnabled())
                log.info("queryOptionList retured "+String.valueOf(result.size())+" items. Query completed in " + String.valueOf(System.currentTimeMillis() - start) + " ms");
            clearError();
            return result;
        } catch (SQLException e)
        {
            error(DBErrors.QueryFailed, e);
View Full Code Here

            addIndex("EMPLOYEE_NAME_IDX", true, new DBColumn[] { FIRSTNAME, LASTNAME, DATE_OF_BIRTH });
            // Set timestamp column for save updates
            setTimestampColumn(UPDATE_TIMESTAMP);

            // Create Options for GENDER column
            Options genders = new Options();
            genders.set("M", "Male");
            genders.set("F", "Female");
            GENDER.setOptions(genders);
        }
View Full Code Here

            addIndex("EMPLOYEE_NAME_IDX", true, new DBColumn[] { FIRSTNAME, LASTNAME, DATE_OF_BIRTH });
            // Set timestamp column for save updates
            setTimestampColumn(UPDATE_TIMESTAMP);

            // Create Options for GENDER column
            Options genders = new Options();
            genders.set("M", "Male");
            genders.set("F", "Female");
            GENDER.setOptions(genders);
        }
View Full Code Here

            addIndex("EMPLOYEE_NAME_IDX", true, new DBColumn[] { FIRSTNAME, LASTNAME, DATE_OF_BIRTH });
            // Set timestamp column for save updates
            setTimestampColumn(UPDATE_TIMESTAMP);

            // Create Options for GENDER column
            Options genders = new Options();
            genders.set("M", "Male");
            genders.set("F", "Female");
            GENDER.setOptions(genders);
        }
View Full Code Here

      return this.actionConfigParams.containsKey(key);
    }

    public Options getLanguages()
    {
        Options o = new Options();
        o.add(new OptionEntry(Locale.ENGLISH, Locale.ENGLISH.getDisplayLanguage()));
        o.add(new OptionEntry(Locale.GERMAN, Locale.GERMAN.getDisplayLanguage()));
        return o;
    }
View Full Code Here

                elem.setAttribute("size", String.valueOf(size));
            // add All Attributes
            if (attributes != null)
                attributes.addXml(elem, flags);
            // add All Options
            Options fieldOptions = getOptions();
            if (fieldOptions != null)
                fieldOptions.addXml(elem, flags);
            // done
            return elem;
        }
View Full Code Here

    }

    public Options getDepartments()
    {
        if (!isServiceAvailable())
            return new Options(); // Webservice is note not available ... so do nothing

        if (departments == null)
            departments = EmployeeRecord.getDepartments(new SampleContext());

        return departments;
View Full Code Here

        radioGroupWrapper.addAttribute("class", ci.getCssClass());
        radioGroupWrapper.addAttribute("style", ci.getCssStyle());
        radioGroupWrapper.beginBody();
       
        // Get options
        Options options = ci.getOptions();
        if (options!=null)
        {   // Doing a label top, radio bottom table layout
            if (hasFormatOption(ci, "labelAbove"))
            {
                renderLabelAboveControl(writer, ci, options);
            }
            else
            {   // Label next to control (to the left or to the right)
                renderLabelNextToControl(writer, ci, options, hasFormatOption(ci, "labelLeft"));
            }
            // Add hidden field for NULL_VALUE checking
            if (options.contains(ci.getValue())==false && ci.getDisabled()==false)
            {   // Additionally add a hidden field
                // to detect unchecked state
                HtmlTag hidden = writer.startTag("input");
                hidden.addAttribute("type""hidden");
                hidden.addAttribute("name",  ci.getName() + RBCHECK_POSTFIX);
View Full Code Here

        input.addAttribute("onchange",  ci.getOnchange());
        input.addAttribute("onfocus",   ci.getOnfocus());
        input.addAttribute("onblur",    ci.getOnblur());
        input.beginBody(true);
        // Render List of Options
        Options options = ci.getOptions();
        if (options!=null)
        {   // Render option list
            Object current = ci.getValue();
            if (hasFormatOption(ci, "allownull") && options.contains(null)==false)
            {   // add an empty entry
                addEmtpyEntry(writer, ObjectUtils.isEmpty(current));
            }
            for (OptionEntry entry : options)
            {
View Full Code Here

TOP

Related Classes of org.apache.empire.commons.Options

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.