javafx8会实现文本字段验证支持吗?

时间:2022-08-18 17:04:27

JavaFX 2 does not provide validation support (masks, input filtering and so on...). It is difficult to adopt a technology that does not offer basic functionalities. I am trying to implement my own validators, but that is a big pain.

JavaFX 2不提供验证支持(掩码、输入过滤等)。采用一种不提供基本功能的技术是困难的。我正在尝试实现我自己的验证器,但这是一个很大的痛苦。

Are there any news in JavaFX 8 about validation? I was trying to find new features, but I don't know where to search, it is difficult to find exactly what will be the changes in JavaFX 8. I need to know about it, because I was considering JavaFX for a new application.

在JavaFX 8中有关于验证的消息吗?我一直在尝试寻找新的特性,但是我不知道到哪里去搜索,很难找到JavaFX 8的具体变化。我需要了解它,因为我正在考虑为一个新的应用程序使用JavaFX。

1 个解决方案

#1


10  

Answer

回答

No, JavaFX 8 will not implement high level validation support.

不,JavaFX 8不会实现高级验证支持。

Opinion

的意见

I think it unlikely that comprehensive validation support will ever be in the JavaFX core libraries (this is just my personal opinion).

我认为全面的验证支持不太可能出现在JavaFX核心库中(这只是我个人的看法)。

JavaFX provides a base library upon which other libraries can be implemented. JavaFX 2.2 provides enough support that you could write validation libraries on top of JavaFX (and people have done so).

JavaFX提供了一个基本库,其他库可以在该库上实现。JavaFX 2.2提供了足够的支持,您可以在JavaFX上编写验证库(而且人们已经这样做了)。

There are some reasons why you might not want validation support in JavaFX core libraries:

您可能不希望在JavaFX核心库中提供验证支持,原因如下:

  1. As JavaFX is part of Java SE and the open-jfx project, it must follow the Java release process, which can be quite slow at times for various reasons. 3rd party projects don't have such restrictions.
  2. 由于JavaFX是Java SE和open-jfx项目的一部分,它必须遵循Java发布过程,由于各种原因,这个过程有时会非常缓慢。第三方项目没有这样的限制。
  3. Things in JavaFX implement just one way of doing things generally, whereas you might wish to have multiple frameworks built on JavaFX, each for different purposes, then choose between the framework which best meets your needs.
  4. JavaFX中的东西只实现了一种通常的方法,而您可能希望在JavaFX上构建多个框架,每个框架都有不同的用途,然后在最符合您需求的框架中进行选择。
  5. Some advanced validation frameworks might make use of things such as Beans Validation, which are currently only part of the Java EE specification. JavaFX is written to work with just Java SE, so the core framework can't make use of anything from Java EE, even though that might be desirable for validation.
  6. 一些高级的验证框架可能会使用诸如bean验证之类的东西,它们目前只是Java EE规范的一部分。JavaFX的编写仅仅是为了使用Java SE,因此核心框架不能使用Java EE中的任何内容,即使这可能是验证的需要。
  7. Generally, validation is not something done in isolation, but is often part of a wider framework (such as a form filling framework or a complete application platform).
  8. 通常,验证不是单独完成的,而是更广泛框架的一部分(例如表单填充框架或完整的应用程序平台)。

3rd Party Validation Libraries

第三方验证库

Some sample 3rd party libraries which perform validation for JavaFX fields are:

对JavaFX字段执行验证的一些示例第三方库如下:

I was trying to find new features, but I don't know where to search, it is difficult to find exactly what will be the changes in JavaFX 8.

我一直在尝试寻找新的特性,但是我不知道到哪里去搜索,很难找到JavaFX 8的具体变化。

I am sure, when Java 8 is officially released in a couple of weeks, it will come with an announcement summarizing new JavaFX features.

我确信,当Java 8在几周后正式发布时,它将附带一个声明,概述新的JavaFX特性。

You can find out what all of the new features for JavaFX 8 are by filtering the JavaFX issue tracker on fixed features for Java 8. Here is a link to the result of a JavaFX 8 fixed feature query. Note, the linked query reports only larger features, not minor tweaks.

通过在Java 8的固定特性上过滤JavaFX问题跟踪器,您可以了解JavaFX 8的所有新特性。这里有一个指向JavaFX 8固定特性查询结果的链接。注意,链接查询只报告较大的特性,而不是小的调整。

#1


10  

Answer

回答

No, JavaFX 8 will not implement high level validation support.

不,JavaFX 8不会实现高级验证支持。

Opinion

的意见

I think it unlikely that comprehensive validation support will ever be in the JavaFX core libraries (this is just my personal opinion).

我认为全面的验证支持不太可能出现在JavaFX核心库中(这只是我个人的看法)。

JavaFX provides a base library upon which other libraries can be implemented. JavaFX 2.2 provides enough support that you could write validation libraries on top of JavaFX (and people have done so).

JavaFX提供了一个基本库,其他库可以在该库上实现。JavaFX 2.2提供了足够的支持,您可以在JavaFX上编写验证库(而且人们已经这样做了)。

There are some reasons why you might not want validation support in JavaFX core libraries:

您可能不希望在JavaFX核心库中提供验证支持,原因如下:

  1. As JavaFX is part of Java SE and the open-jfx project, it must follow the Java release process, which can be quite slow at times for various reasons. 3rd party projects don't have such restrictions.
  2. 由于JavaFX是Java SE和open-jfx项目的一部分,它必须遵循Java发布过程,由于各种原因,这个过程有时会非常缓慢。第三方项目没有这样的限制。
  3. Things in JavaFX implement just one way of doing things generally, whereas you might wish to have multiple frameworks built on JavaFX, each for different purposes, then choose between the framework which best meets your needs.
  4. JavaFX中的东西只实现了一种通常的方法,而您可能希望在JavaFX上构建多个框架,每个框架都有不同的用途,然后在最符合您需求的框架中进行选择。
  5. Some advanced validation frameworks might make use of things such as Beans Validation, which are currently only part of the Java EE specification. JavaFX is written to work with just Java SE, so the core framework can't make use of anything from Java EE, even though that might be desirable for validation.
  6. 一些高级的验证框架可能会使用诸如bean验证之类的东西,它们目前只是Java EE规范的一部分。JavaFX的编写仅仅是为了使用Java SE,因此核心框架不能使用Java EE中的任何内容,即使这可能是验证的需要。
  7. Generally, validation is not something done in isolation, but is often part of a wider framework (such as a form filling framework or a complete application platform).
  8. 通常,验证不是单独完成的,而是更广泛框架的一部分(例如表单填充框架或完整的应用程序平台)。

3rd Party Validation Libraries

第三方验证库

Some sample 3rd party libraries which perform validation for JavaFX fields are:

对JavaFX字段执行验证的一些示例第三方库如下:

I was trying to find new features, but I don't know where to search, it is difficult to find exactly what will be the changes in JavaFX 8.

我一直在尝试寻找新的特性,但是我不知道到哪里去搜索,很难找到JavaFX 8的具体变化。

I am sure, when Java 8 is officially released in a couple of weeks, it will come with an announcement summarizing new JavaFX features.

我确信,当Java 8在几周后正式发布时,它将附带一个声明,概述新的JavaFX特性。

You can find out what all of the new features for JavaFX 8 are by filtering the JavaFX issue tracker on fixed features for Java 8. Here is a link to the result of a JavaFX 8 fixed feature query. Note, the linked query reports only larger features, not minor tweaks.

通过在Java 8的固定特性上过滤JavaFX问题跟踪器,您可以了解JavaFX 8的所有新特性。这里有一个指向JavaFX 8固定特性查询结果的链接。注意,链接查询只报告较大的特性,而不是小的调整。