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


Java AbstractFormatterFactory类代码示例

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


AbstractFormatterFactory类属于javax.swing.JFormattedTextField包,在下文中一共展示了AbstractFormatterFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: setFormatterFactory

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入依赖的package包/类
public void setFormatterFactory(final AbstractFormatterFactory formatter)
{
	if (textComponent instanceof JFormattedTextField)
	{
		((JFormattedTextField)textComponent).setFormatterFactory(formatter);
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:8,代码来源:SwingTerminalTextField.java

示例4: getFormatterFactory

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入依赖的package包/类
public AbstractFormatterFactory getFormatterFactory()
{
	if (textComponent instanceof JFormattedTextField)
	{
		return ((JFormattedTextField)textComponent).getFormatterFactory();
	}
	else
	{
		return null;
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:12,代码来源:SwingTerminalTextField.java

示例5: 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

示例6: 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

示例7: getFormatterFactory

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入依赖的package包/类
@Override
public AbstractFormatterFactory getFormatterFactory() {
  return m_factory;
}
 
开发者ID:google,项目名称:binnavi,代码行数:5,代码来源:HexSearcher.java

示例8: getFormatterFactory

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入依赖的package包/类
@Override
public AbstractFormatterFactory getFormatterFactory() {
  return null;
}
 
开发者ID:google,项目名称:binnavi,代码行数:5,代码来源:AsciiSearcher.java

示例9: configureComponents

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入依赖的package包/类
private void configureComponents() {
    dateEchoField.setEditable(false);
    AbstractFormatter formatter = new DateFormatter(DateFormat.getDateTimeInstance());
    AbstractFormatterFactory tf = new DefaultFormatterFactory(formatter);
    dateEchoField.setFormatterFactory(tf);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:7,代码来源:DatePickerDemo.java

示例10: createFormatterFactory

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入依赖的package包/类
/**
 * Convenience method for creating a formatter factory with a
 * {@code ScalableNumberFormatter} and a Java-style DecimalFormat.
 */
public static AbstractFormatterFactory createFormatterFactory(double min, double max, double multiplier, boolean allowsNullValue) {
    JavaNumberFormatter formatter = new JavaNumberFormatter(min, max, multiplier, allowsNullValue, null);
    return new DefaultFormatterFactory(formatter);
}
 
开发者ID:umple,项目名称:umple,代码行数:9,代码来源:JavaNumberFormatter.java

示例11: createFormatterFactory

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入依赖的package包/类
public static AbstractFormatterFactory createFormatterFactory(boolean allowsNullValue) {
    return new DefaultFormatterFactory(new FontFormatter(allowsNullValue));
}
 
开发者ID:umple,项目名称:umple,代码行数:4,代码来源:FontFormatter.java

示例12: createFormatterFactory

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入依赖的package包/类
public static AbstractFormatterFactory createFormatterFactory() {
    return createFormatterFactory(Format.RGB_INTEGER_SHORT, true, true);
}
 
开发者ID:umple,项目名称:umple,代码行数:4,代码来源:ColorFormatter.java

示例13: createControl

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入依赖的package包/类
protected JComponent createControl(Map context) {
    return getComponentFactory().createFormattedTextField(
            (AbstractFormatterFactory)context.get(FORMATTER_FACTORY_KEY));
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:5,代码来源:FormattedTextFieldBinder.java

示例14: createBoundFormattedTextField

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入依赖的package包/类
public Binding createBoundFormattedTextField(String formProperty, AbstractFormatterFactory formatterFactory) {
    Map context = createContext(FormattedTextFieldBinder.FORMATTER_FACTORY_KEY, formatterFactory);
    return createBinding(JFormattedTextField.class, formProperty, context);
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:5,代码来源:SwingBindingFactory.java

示例15: createFormattedTextField

import javax.swing.JFormattedTextField.AbstractFormatterFactory; //导入依赖的package包/类
public JFormattedTextField createFormattedTextField(AbstractFormatterFactory formatterFactory) {
	PatchedJFormattedTextField patchedJFormattedTextField = new PatchedJFormattedTextField(formatterFactory);
	configureTextField(patchedJFormattedTextField);
	return patchedJFormattedTextField;
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:6,代码来源:DefaultComponentFactory.java


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