Package pivot.util

Examples of pivot.util.CalendarDate


        super(buttonData);

        setDataRenderer(DEFAULT_DATA_RENDERER);
        installSkin(CalendarButton.class);

        setSelectedDate(new CalendarDate());
    }
View Full Code Here


     *
     * @param selectedDate
     * The date to select, or <tt>null</tt> to clear the selection.
     */
    public void setSelectedDate(CalendarDate selectedDate) {
        CalendarDate previousSelectedDate = this.selectedDate;

        if (((previousSelectedDate == null) ^ (selectedDate == null))
            || (previousSelectedDate != null
                && !previousSelectedDate.equals(selectedDate))) {
            this.selectedDate = selectedDate;
            calendarButtonSelectionListeners.selectedDateChanged(this,
                previousSelectedDate);
        }
    }
View Full Code Here

    public final void setSelectedDate(String selectedDate) {
        if (selectedDate == null) {
            throw new IllegalArgumentException("selectedDate is null.");
        }

        setSelectedDate(new CalendarDate(selectedDate));
    }
View Full Code Here

    public static final String LANGUAGE_KEY = "language";
    public static final String COUNTRY_KEY = "country";
    public static final String VARIANT_KEY = "variant";

    public Calendar() {
        this(new CalendarDate());
    }
View Full Code Here

     *
     * @param selectedDate
     * The selected date, or <tt>null</tt> to specify no selection
     */
    public void setSelectedDate(CalendarDate selectedDate) {
        CalendarDate previousSelectedDate = this.selectedDate;

        if (((previousSelectedDate == null) ^ (selectedDate == null))
            || (previousSelectedDate != null
                && !previousSelectedDate.equals(selectedDate))) {
            this.selectedDate = selectedDate;
            calendarSelectionListeners.selectedDateChanged(this, previousSelectedDate);
        }
    }
View Full Code Here

    public final void setSelectedDate(String selectedDate) {
        if (selectedDate == null) {
            throw new IllegalArgumentException("selectedDate is null.");
        }

        setSelectedDate(new CalendarDate(selectedDate));
    }
View Full Code Here

    // Calendar button selection events
    public void selectedDateChanged(CalendarButton calendarButton,
        CalendarDate previousSelectedDate) {
        // Set the selected date as the button data
        CalendarDate date = calendarButton.getSelectedDate();
        calendarButton.setButtonData(date);

        calendar.setSelectedDate(date);
        calendar.setYear(date.getYear());
        calendar.setMonth(date.getMonth());
    }
View Full Code Here

        if (data == null) {
            data = "";
        } else {
            if (data instanceof CalendarDate) {
                CalendarDate date = (CalendarDate)data;

                DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, locale);
                data = dateFormat.format(date.toCalendar().getTime());
            }
        }

        super.render(data, button, highlight);
    }
View Full Code Here

    /**
     * Creates a new <tt>CalendarDateSpinnerData</tt> bounded from
     * <tt>1900-01-01</tt> to <tt>2099-12-31</tt>.
     */
    public CalendarDateSpinnerData() {
        this(new CalendarDate(1900, 0, 0), new CalendarDate(2099, 11, 30));
    }
View Full Code Here

        // Calculate the desired fields
        int year = calendar.get(Calendar.YEAR);
        int month = calendar.get(Calendar.MONTH);
        int day = calendar.get(Calendar.DAY_OF_MONTH) - 1;

        return new CalendarDate(year, month, day);
    }
View Full Code Here

TOP

Related Classes of pivot.util.CalendarDate

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.