MCPcopy Create free account
hub / github.com/dumbledore/AlbiteREADER / loadHyphenator

Method loadHyphenator

src/org/albite/albite/BookCanvas.java:2528–2565  ·  view source on GitHub ↗
(final String language)

Source from the content-addressed store, hash-verified

2526 }
2527
2528 private void loadHyphenator(final String language) {
2529
2530 if (language == null || language.equalsIgnoreCase(Languages.NO_LANGUAGE)) {
2531 hyphenator = null;
2532 return;
2533 }
2534
2535 final String currentLanguage =
2536 (hyphenator != null ? hyphenator.getLanguage() : null);
2537
2538 if ((hyphenator != null && currentLanguage == null)
2539 || language == null
2540 || language.equalsIgnoreCase(currentLanguage)) {
2541 /*
2542 * Already loaded
2543 */
2544 return;
2545 }
2546
2547 if (!Languages.isSupported(language)) {
2548 /*
2549 * Language not supported
2550 */
2551 return;
2552 }
2553
2554 /*
2555 * Free memory beforehand
2556 */
2557 hyphenator = null;
2558
2559 try {
2560 hyphenator = new ZLTextTeXHyphenator(language);
2561 } catch (IOException e) {
2562 //#debug
2563 AlbiteMIDlet.LOGGER.log(e);
2564 }
2565 }
2566
2567 public final void setAutoBookLanguage() {
2568 setBookLanguage(currentBook.getDefaultLanguage());

Callers 2

openBookMethod · 0.95
setBookLanguageMethod · 0.95

Calls 3

isSupportedMethod · 0.95
logMethod · 0.80
getLanguageMethod · 0.45

Tested by

no test coverage detected