当前位置: 首页>>代码示例>>Java>>正文


Java AbstractFormatterFactory.getFormatter方法代码示例

本文整理汇总了Java中javax.swing.JFormattedTextField.AbstractFormatterFactory.getFormatter方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractFormatterFactory.getFormatter方法的具体用法?Java AbstractFormatterFactory.getFormatter怎么用?Java AbstractFormatterFactory.getFormatter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JFormattedTextField.AbstractFormatterFactory的用法示例。


在下文中一共展示了AbstractFormatterFactory.getFormatter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCustomFormats

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入方法依赖的package包/类
/**
     * Checks and returns custom formats on the editor, if any.
     * 
     * @param editor the editor to check
     * @return the custom formats uses in the editor or null if it had
     *   used defaults as defined in the datepicker properties
     */
    private DateFormat[] getCustomFormats(JFormattedTextField editor) {
        DateFormat[] formats = null;
        if (editor != null) {
            AbstractFormatterFactory factory = editor.getFormatterFactory();
            if (factory != null) {
                AbstractFormatter formatter = factory.getFormatter(editor);
                // fix for #1144: classCastException for custom formatters
                // PENDING JW: revisit for #1138
                if ((formatter instanceof DatePickerFormatter) && !(formatter instanceof UIResource)) {
//                if (!(formatter instanceof DatePickerFormatterUIResource))  {
                    formats = ((DatePickerFormatter) formatter).getFormats();
                }
            }

        }
        return formats;
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:25,代码来源:BasicDatePickerUI.java

示例2: getFormats

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入方法依赖的package包/类
/**
 * Returns an array of the formats used by the installed formatter
 * if it is a subclass of <code>JXDatePickerFormatter<code>.
 * <code>javax.swing.JFormattedTextField.AbstractFormatter</code>
 * and <code>javax.swing.text.DefaultFormatter</code> do not have
 * support for accessing the formats used.
 *
 * @return array of formats guaranteed to be not null, but might be empty.
 */
public DateFormat[] getFormats() {
    // Dig this out from the factory, if possible, otherwise return null.
    AbstractFormatterFactory factory = _dateField.getFormatterFactory();
    if (factory != null) {
        AbstractFormatter formatter = factory.getFormatter(_dateField);
        if (formatter instanceof DatePickerFormatter) {
            return ((DatePickerFormatter) formatter).getFormats();
        }
    }
    return EMPTY_DATE_FORMATS;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:21,代码来源:JXDatePicker.java

示例3: getCustomFormats

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入方法依赖的package包/类
/**
 * Checks and returns custom formats on the editor, if any.
 * 
 * @param editor the editor to check
 * @return the custom formats uses in the editor or null if it had
 *   used defaults as defined in the datepicker properties
 */
private DateFormat[] getCustomFormats(JFormattedTextField editor) {
    DateFormat[] formats = null;
    if (editor != null) {
        AbstractFormatterFactory factory = editor.getFormatterFactory();
        if (factory != null) {
            AbstractFormatter formatter = factory.getFormatter(editor);
            if (!(formatter instanceof DatePickerFormatterUIResource))  {
                formats = ((DatePickerFormatter) formatter).getFormats();
            }
        }

    }
    return formats;
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:22,代码来源:BasicDatePickerUI.java

示例4: getFormats

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入方法依赖的package包/类
/**
 * Returns an array of the formats used by the installed formatter
 * if it is a subclass of <code>JXDatePickerFormatter<code>.
 * <code>javax.swing.JFormattedTextField.AbstractFormatter</code>
 * and <code>javax.swing.text.DefaultFormatter</code> do not have
 * support for accessing the formats used.
 *
 * @return array of formats or null if unavailable.
 */
public DateFormat[] getFormats() {
    // Dig this out from the factory, if possible, otherwise return null.
    AbstractFormatterFactory factory = _dateField.getFormatterFactory();
    if (factory != null) {
        AbstractFormatter formatter = factory.getFormatter(_dateField);
        if (formatter instanceof JXDatePickerFormatter) {
            return ((JXDatePickerFormatter)formatter).getFormats();
        }
    }
    return null;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:21,代码来源:DateRangeDatePicker.java


注:本文中的javax.swing.JFormattedTextField.AbstractFormatterFactory.getFormatter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。