-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update documentation regarding ICU removal (#348)
* Update documentation regarding ICU removal We switched from the Bidi and BreakIterator implementation contributed by com.ibm.icu to the native Java implementation. Because those implementations are not 100% compatible, we should note this in the changelog and also inform users about how they may be able to contribute their own implementation. * Add Draw2D changes from 3.15 to changelog and online help. Document removal of dependency to ICU and changed behavior for actions registered to the GraphicalEditor.
- Loading branch information
Showing
7 changed files
with
129 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
= User-specific Extensions | ||
|
||
== BreakIterator | ||
|
||
The link:../reference/api/org/eclipse/draw2d/text/FlowUtilities.html[*`FlowUtilities`*] | ||
class uses the native _BreakIterator_ class to determine the boundaries between | ||
words. Clients may contribute their own implementation by contributing a custom | ||
_BreakIteratorProvider_ via SPI. If multiple services are contributed, the first | ||
one is chosen. | ||
|
||
=== Example: How to supply a custom BreakIterator | ||
|
||
____ | ||
Users may want to use the break rules from e.g. ICU instead of the JDK rules. | ||
Because those classes don't share a common interface, the user has to extend | ||
the abstract _BreakIterator_ class and call the corresponding ICU method for | ||
abstract method that is overwritten. | ||
____ | ||
|
||
=== Solution: | ||
|
||
____ | ||
SPI uses the context-classloader to instantiate the custom implementation. In | ||
order to use this mechanism in OSGi with minimal complications, it is | ||
recommended to create this class within a Draw2D fragment. Also note that this | ||
class needs to be registered via _META-INF/services/java.text.spi.BreakIteratorProvider_ | ||
[source,java] | ||
---- | ||
public class CustomBreakIteratorProvider extends BreakIteratorProvider { | ||
@Override | ||
public BreakIterator getWordInstance(Locale locale) { | ||
... | ||
} | ||
@Override | ||
public BreakIterator getLineInstance(Locale locale) { | ||
... | ||
} | ||
@Override | ||
public BreakIterator getCharacterInstance(Locale locale) { | ||
... | ||
} | ||
@Override | ||
public BreakIterator getSentenceInstance(Locale locale) { | ||
... | ||
} | ||
@Override | ||
public Locale[] getAvailableLocales() { | ||
... | ||
} | ||
} | ||
---- | ||
____ | ||
|
||
== Bidi | ||
|
||
Similarly to the _BreakIterator_, the link:../reference/api/org/eclipse/draw2d/text/BidiProcessor.html[BidiProcessor] | ||
class uses the native _Bidi_ class to determine whether a text requires a Bidi | ||
analysis. Clients may contribute their own implementation by contributing a | ||
custom link:../reference/api/org/eclipse/draw2d/text/BidiProvider.html[BidiProvider] | ||
via SPI. If multiple services are contributed, the first one is chosen. | ||
|
||
=== Example: Custom BidiProvider Service | ||
|
||
____ | ||
The Bidi algorithm provided by the JDK might not be sufficient to determine, | ||
whether a given text requires further analysis. | ||
____ | ||
|
||
=== Solution: | ||
|
||
____ | ||
SPI uses the context-classloader to instantiate the custom implementation. In | ||
order to use this mechanism in OSGi with minimal complications, it is | ||
recommended to create this class within a Draw2D fragment. Also note that this | ||
class needs to be registered via _META-INF/services/org.eclipse.draw2d.text.BidiProvider_. | ||
[source,java] | ||
---- | ||
public class CustomBidiProvider implements BidiProvider { | ||
@Override | ||
public boolean requiresBidi(char[] text, int start, int limit) { | ||
... | ||
} | ||
} | ||
---- | ||
____ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
= Plug-in Migration Guide | ||
|
||
== Contents | ||
|
||
* link:#3.15[Migrating from 3.14 to 3.15] | ||
|
||
=== [#3.15]#Migrating from 3.14 to 3.15# | ||
|
||
Draw2D has dropped ICU as the default Java implementation for *`Bidi`* and | ||
*`BreakIterator`*. If clients require a different behavior, they may contribute | ||
their own implementation as described in link:extensions.html[User-specific extensions]. | ||
|
||
The selection, stack and property `Actions` of the `GraphicalEditor` can only | ||
hold Strings and no longer support objects of type IAction. Clients can convert | ||
their actions by explicitly calling *`IAction.getId()`*. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters