### Summary

This PR adds support for controlling tab stops: the `TAB_STOPS` paragraph 
attribute and the `defaultTabStops` property in the `RichTextModel`.  

While adding the paragraph attribute is a trivial process, adding a model-wide 
property requires adding of a mechanism to support document properties 
(something that was originally omitted in the first incubating release).  Using 
the document properties, we can now persist not only the default tab stops, but 
also provide the version umber for the storage format provided by the 
`RichTextFormatHandler`, which will enable support the format evolution in the 
future [0].

To showcase the feature, the `RichEditorDemoApp` gains a visual ruler and 
additional dialogs and menus.

### Paragraph Attribute

Paragraph-specific tab stops are enabled by:

- `StyleAttributeMap.TAB_STOPS` constant
- `StyleAttributeMap.Builder.setTabStops(double ... positions)`

### Default Tab Stops

After the last paragraph tab stop, or when no paragraph tab stops is set, the 
document provides a way to set default tab stops via the model's 
`defaultTabStops` property:

These changes support the new property and other document properties:

- document-wide properties support in the `StyledTextModel` base class
- `defaultTabStops` property in the `RichTextModel` and `RichTextFormatHandler`
- document properties `VERSION` and `DEFAULT_TAB_STOPS`
- `StyledSegment`: `ofDocumentProperties()` factory, `getDocumentProperties()`

### Other Improvements

A number of other improvements were made along with the tab stop related 
changes:

- `character()`, `paragraph()`, and `document()` factory methods in the 
`StyleAttribute` class
- `isCharacterAttribute()`, `isParagraphAttribute()`, and 
`isDocumentAttribute()` methods in the `StyleAttribute` class
- `RichTextArea`: `documentArea` read-only property

### Dependencies

https://bugs.openjdk.org/browse/JDK-8373936

### References

[0] [Rich Text Area (Incubator) Data Format Version 
2](https://github.com/andy-goryachev-oracle/Test/blob/8356042.ruler/doc/RichTextArea/RichTextArea_DataFormat_v2.md)

-------------

Commit messages:
 - Merge branch 'master' into 8356042.ruler
 - tests
 - v2
 - insert
 - commit
 - whitespace
 - Merge branch 'master' into 8356042.ruler
 - document properties
 - write doc properties
 - Merge branch 'master' into 8356042.ruler
 - ... and 149 more: https://git.openjdk.org/jfx/compare/7b845519...187f6078

Changes: https://git.openjdk.org/jfx/pull/1800/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1800&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8356042
  Stats: 1835 lines in 31 files changed: 1656 ins; 71 del; 108 mod
  Patch: https://git.openjdk.org/jfx/pull/1800.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1800/head:pull/1800

PR: https://git.openjdk.org/jfx/pull/1800

Reply via email to