JDK-8103256 : Inspector Editors Error Checking
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: tools-scenebuilder
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-04-17
  • Updated: 2015-06-16
  • Resolved: 2013-11-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
We propose to implement a two stage process.

Stage 1
We check each key pressed for valid input. For example, we ignore letters and symbols (except '.') if we are typing into a numeric field. There will be a special case for properties such as fx:id where we allow numbers, characters and symbols that are valid for the fx:id syntax.

Stage 2 (special case for properties such as fx:id and controller class)
On submit and loss of focus we do a final check for valid input. By valid input we mean "a value that can be saved to the document". If the value is invalid then we show a dialogue with a warning and 2 buttons: "Discard Change" and "Fix it" (default). The item focus is persisted on the value editor. If the user chooses "Discard Change" then the previous value is restored in the value editor.

The following scenario would use stage 2. The user could edit a value for fx:id by using the delete key and submit the value, not knowing it was a duplicate id. As no characters were typed, stage 1 error checking was never used. Hence stage 2 dialogue provides a fallback.

In the corner case where a menu command is chosen while invalid input is inside the focused editor, we do the following.
- allow the menu item to be selected
- check if the menu item will modify or save the document and if so, abort the menu command and show the dialog in stage 2.
Comments
Note for docs: In SB 1.1, when an invalid value is entered, the inspector automatically reset it to the previous value. In SB 2.0, when an invalid value is entered, a dialog appears, one can either: - "Fix the value": in the case the focus come back to the text field with the invalid value - "Come back to the previous value"
21-01-2014

Available in 2.0-b05.
14-11-2013

Implementation of this error checking is highly dependent on RT-30881 : Add contentFilter property to TextInputControl
01-08-2013

For simple double numbers, Stage 1 will be not enough in some cases. For instance we have to allow : - an empty text (e.g. a user erase an existing double with backspace to enter a new one) - "-", ".", "-.", etc...
01-08-2013

Stage 1 is done for simple double editor, i.e double properties with no ComboBox (e.g. opacity, layoutX, layoutY, ...). For double editors based on ComboBox, RT-30406 prevent to do the same thing.
21-05-2013

Right now, I am not convinced we need visual feedback for invalid key, it's just ignored as described in Stage 1 above.
10-05-2013