Dave Jarvis' Repositories

M build.gradle
55
repositories {
66
  jcenter()
7
  
8
  maven {
9
    url 'https://oss.sonatype.org/content/repositories/snapshots/' 
10
  }
711
}
812
913
compileJava {
1014
  options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
1115
}
1216
1317
dependencies {
1418
  compile 'org.controlsfx:controlsfx:8.40.12'
15
  compile 'org.fxmisc.richtext:richtextfx:0.7-M3'
19
  //compile 'org.fxmisc.richtext:richtextfx:0.7-M4'
20
  compile group: 'org.fxmisc.richtext', name: 'richtextfx', version: '1.0.0-SNAPSHOT'
1621
  compile 'com.miglayout:miglayout-javafx:5.0'
1722
  compile 'de.jensd:fontawesomefx-fontawesome:4.5.0'
1823
  compile 'org.ahocorasick:ahocorasick:0.3.0'
19
  compile 'com.vladsch.flexmark:flexmark:0.9.0'
20
  compile 'com.vladsch.flexmark:flexmark-ext-gfm-tables:0.9.0'
21
  compile 'com.vladsch.flexmark:flexmark-ext-superscript:0.9.0'
22
  compile 'com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:0.9.0'
24
  compile 'com.vladsch.flexmark:flexmark:0.18.5'
25
  compile 'com.vladsch.flexmark:flexmark-ext-tables:0.18.5'
26
  compile 'com.vladsch.flexmark:flexmark-ext-superscript:0.18.5'
27
  compile 'com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:0.18.5'
2328
  compile 'com.fasterxml.jackson.core:jackson-core:2.8.4'
2429
  compile 'com.fasterxml.jackson.core:jackson-databind:2.8.4'
2530
  compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.4'
2631
  compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.4'
2732
  compile 'org.yaml:snakeyaml:1.17'
2833
  compile 'com.ximpleware:vtd-xml:2.13'
2934
  compile 'net.sf.saxon:Saxon-HE:9.7.0-14'
3035
  compile 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3'
3136
  compile 'org.apache.commons:commons-configuration2:2.1'
32
  compile files('libs/renjin-script-engine-0.8.2324-jar-with-dependencies.jar')
37
  compile files('libs/renjin-script-engine-0.8.2354-jar-with-dependencies.jar')
3338
}
3439
35
version = '1.2.6'
40
version = '1.2.9'
3641
applicationName = 'scrivenvar'
3742
mainClassName = 'com.scrivenvar.Main'
D libs/renjin-script-engine-0.8.2324-jar-with-dependencies.jar
Binary file
A libs/renjin-script-engine-0.8.2354-jar-with-dependencies.jar
Binary file
M src/main/java/com/scrivenvar/Main.java
104104
105105
  private void initApplication() {
106
    app = this;
106
    Main.app = this;
107107
  }
108108
...
190190
191191
  private static Application getApplication() {
192
    return app;
192
    return Main.app;
193193
  }
194194
M src/main/java/com/scrivenvar/processors/MarkdownProcessor.java
3131
import com.vladsch.flexmark.ast.Node;
3232
import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughSubscriptExtension;
33
import com.vladsch.flexmark.ext.gfm.tables.TablesExtension;
33
import com.vladsch.flexmark.ext.tables.TablesExtension;
3434
import com.vladsch.flexmark.html.HtmlRenderer;
3535
import com.vladsch.flexmark.parser.Parser;
M src/main/java/com/scrivenvar/processors/XMLCaretInsertionProcessor.java
3232
import static com.ximpleware.VTDGen.TOKEN_CHARACTER_DATA;
3333
import com.ximpleware.VTDNav;
34
import static java.nio.charset.StandardCharsets.UTF_8;
3435
import java.text.ParseException;
3536
import javafx.beans.value.ObservableValue;
...
132133
    final VTDGen vg = getParser();
133134
134
    // TODO: Use the document's encoding...
135
    vg.setDoc( xml.getBytes() );
135
    // XML recommends UTF-8 encoding.
136
    // See: http://stackoverflow.com/a/36696214/59087
137
    //
138
    // The encoding should be derived, not assumed.
139
    vg.setDoc( xml.getBytes( UTF_8 ) );
136140
    vg.parse( true );
137141
    return vg.getNav();
M src/main/java/com/scrivenvar/service/events/Notifier.java
2828
package com.scrivenvar.service.events;
2929
30
import java.io.File;
31
import java.io.FileWriter;
32
import java.io.IOException;
33
import java.io.PrintWriter;
3034
import java.util.Observer;
3135
import javafx.scene.control.Alert;
...
5761
   */
5862
  default public void notify( final Exception ex ) {
63
    log( ex );
5964
    notify( ex.getMessage() );
65
  }
66
  
67
  /**
68
   * Writes the exception to a log file. The log file should be written
69
   * in the System's temporary directory.
70
   * 
71
   * @param ex The exception to show in the status bar and log to a file.
72
   */
73
  default public void log( final Exception ex ) {
74
    try (
75
      final FileWriter fw = new FileWriter( getLogPath(), true );
76
      final PrintWriter pw = new PrintWriter( fw )
77
      ) {
78
79
      ex.printStackTrace( pw );
80
    } catch (final IOException ioe) {
81
      // The notify method will display the message on the status
82
      // bar.
83
    }
6084
  }
85
  
86
  /**
87
   * Returns the fully qualified path to the log file to write to when
88
   * an exception occurs.
89
   * 
90
   * @return Location of the log file for writing unexpected exceptions.
91
   */
92
  public File getLogPath();
6193
6294
  /**
M src/main/java/com/scrivenvar/service/events/impl/DefaultNotifier.java
2828
package com.scrivenvar.service.events.impl;
2929
30
import static com.scrivenvar.Constants.APP_TITLE;
3031
import static com.scrivenvar.Constants.STATUS_BAR_DEFAULT;
3132
import com.scrivenvar.service.events.Notification;
3233
import com.scrivenvar.service.events.Notifier;
34
import java.io.File;
35
import java.nio.file.Paths;
3336
import java.util.Observable;
3437
import javafx.scene.control.Alert;
...
109112
  public Alert createError( final Window parent, final Notification message ) {
110113
    return createAlertDialog( parent, ERROR, message );
114
  }
115
116
  @Override
117
  public File getLogPath() {
118
    return Paths.get(
119
      System.getProperty("java.io.tmpdir"), APP_TITLE + ".log").toFile();
111120
  }
112121
}