Skip to content

Commits on Source 7

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="i18n"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="src" path="themes"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry exported="true" kind="con" path="org.springsource.ide.eclipse.gradle.classpathcontainer"/>
<classpathentry kind="con" path="org.springsource.ide.eclipse.gradle.dsld.classpathcontainer"/>
<classpathentry kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="con" path="GROOVY_SUPPORT"/>
<classpathentry kind="output" path="bin"/>
</classpath>
ant-classes
bin
dist
javadoc
rsyntaxtextarea_*.zip
*.java~
build
.gradle
/.settings/
......@@ -12,6 +12,8 @@
</buildCommand>
</buildSpec>
<natures>
<nature>org.springsource.ide.eclipse.gradle.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
</natures>
</projectDescription>
#org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences
#Fri Apr 24 23:23:42 EDT 2015
build.family.org.gradle.tooling.model.eclipse.HierarchicalEclipseProject=;
org.springsource.ide.eclipse.gradle.classpath.enableSorting=true
org.springsource.ide.eclipse.gradle.classpath.jar.remap.gradle.to.maven=true
org.springsource.ide.eclipse.gradle.linkedresources=
org.springsource.ide.eclipse.gradle.rootprojectloc=
#org.springsource.ide.eclipse.gradle.core.actions.GradleRefreshPreferences
#Sat Jul 19 01:32:42 EDT 2014
enableDSLD=true
env:
- DISPLAY=:99.0
# xvfb is required to simulate a windowing system for Swing GUI tests.
# http://ecmendenhall.github.io/blog/blog/2013/05/28/two-travis-ci-solutions/
before_install:
- "/bin/sh -e /etc/init.d/xvfb start"
# Oldest JDK supported by Travis CI
jdk:
- openjdk6
script:
- ./gradlew assemble -x signArchives -x uploadArchives
- ./gradlew check
# Update coverage info on coveralls.io
after_success:
- ./gradlew jacocoTestReport coveralls
[![Build Status](https://travis-ci.org/bobbylight/RSyntaxTextArea.svg?branch=master)](https://travis-ci.org/bobbylight/RSyntaxTextArea)
[![Coverage Status](https://coveralls.io/repos/bobbylight/RSyntaxTextArea/badge.svg)](https://coveralls.io/r/bobbylight/RSyntaxTextArea)
RSyntaxTextArea is a customizable, syntax highlighting text component for Java Swing applications. Out of
the box, it supports syntax highlighting for 40+ programming languages, code folding, search and replace,
and has add-on libraries for code completion and spell checking. Syntax highlighting for additional languages
[can be added](https://github.com/bobbylight/RSyntaxTextArea/wiki) via tools such as [JFlex](http://jflex.de).
RSyntaxTextArea is available under a [modified BSD license](https://github.com/bobbylight/RSyntaxTextArea/blob/master/src/main/dist/RSyntaxTextArea.License.txt).
For more information, visit [http://bobbylight.github.io/RSyntaxTextArea/](http://bobbylight.github.io/RSyntaxTextArea/).
Available in the [Maven Central repository](http://search.maven.org/#search%7Cga%7C1%7Crsyntaxtextarea%20jar) (`com.fifesoft:rsyntaxtextarea:XXX`).
# Building
RSyntaxTextArea uses [Gradle](http://gradle.org/) to build. To compile, run
all unit tests, and create the jar, run:
./gradlew build
Note that RSTA only requires Java 5. To that end, the boot classpath will be set to accommodate
this if a variable `java5CompileBootClasspath` is set to the location of `rt.jar` in a Java 5 JDK.
This can be added to `<maven-home>/gradle.properties` if desired, to avoid diffs in the project's
`gradle.properties`.
When building with Java 8 or later, the `javadoc` task currently prints many warnings about Javadoc
"issues." This is because
[doclint](http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html)
is enabled by default in that release of Java. These warnings are harmless, and in a future
release will be cleaned up.
# Example Usage
RSyntaxTextArea is simply a subclass of JTextComponent, so it can be dropped into any Swing application with ease.
```java
import javax.swing.*;
import org.fife.ui.rtextarea.*;
import org.fife.ui.rsyntaxtextarea.*;
public class TextEditorDemo extends JFrame {
public TextEditorDemo() {
JPanel cp = new JPanel(new BorderLayout());
RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
textArea.setCodeFoldingEnabled(true);
RTextScrollPane sp = new RTextScrollPane(textArea);
cp.add(sp);
setContentPane(cp);
setTitle("Text Editor Demo");
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
setLocationRelativeTo(null);
}
public static void main(String[] args) {
// Start all Swing applications on the EDT.
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new TextEditorDemo().setVisible(true);
}
});
}
}
```
# Sister Projects
RSyntaxTextArea provides syntax highlighting, code folding, and many other features out-of-the-box, but when building a code editor you often want to go further. Below is a list of small add-on libraries that add more complex functionality:
* [AutoComplete](https://github.com/bobbylight/AutoComplete) - Adds code completion to RSyntaxTextArea (or any other JTextComponent).
* [RSTALanguageSupport](https://github.com/bobbylight/RSTALanguageSupport) - Code completion for RSTA for the following languages: Java, JavaScript, HTML, PHP, JSP, Perl, C, Unix Shell. Built on both RSTA and AutoComplete.
* [SpellChecker](https://github.com/bobbylight/SpellChecker) - Adds squiggle-underline spell checking to RSyntaxTextArea.
* [RSTAUI](https://github.com/bobbylight/RSTAUI) - Common dialogs needed by text editing applications: Find, Replace, Go to Line, File Properties.
# Getting Help
* Add an issue on GitHub
* Peruse [the wiki](https://github.com/bobbylight/RSyntaxTextArea/wiki)
* Ask in the [project forum](http://fifesoft.com/forum/)
* Check the project's [home page](http://bobbylight.github.io/RSyntaxTextArea/)
['java', 'osgi', 'distribution', 'maven', 'signing'].each { apply plugin: it }
// Jacoco and a coveralls upload plugin needed for publishing coverage results
['jacoco', 'com.github.kt3k.coveralls'].each { apply plugin: it }
group = 'com.fifesoft'
archivesBaseName = 'rsyntaxtextarea'
dependencies {
testCompile 'junit:junit:4.11'
}
// Regenerate local gradlew
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}
// Add coveralls plugin to this build's classpath
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1'
}
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
compileJava {
sourceCompatibility javaVersion
targetCompatibility javaVersion
options.debug = true
options.debugOptions.debugLevel = 'source,vars,lines'
// Most folks will compile with the latest JDK available, but official builds
// use a Java 5 JDK. Add this property to gradle.properties for boot classpath
if (project.hasProperty('java5CompileBootClasspath')) {
if (new File(java5CompileBootClasspath).isFile()) {
println "Bootstrap classpath when compiling Java: ${java5CompileBootClasspath}"
options.bootClasspath = java5CompileBootClasspath
}
else {
println "Warning: Specified java5CompileBootClasspath does not exist: ${java5CompileBootClasspath}"
}
}
options.compilerArgs << "-Xlint:deprecation"
}
ext.sharedManifest = manifest {
attributes('Specification-Title': 'RSyntaxTextArea',
'Specification-Version': version,
'Implementation-Title': 'org.fife.ui',
'Implementation-Version': version,
// Not sure why Require-Capability is not being added by the osgi plugin...
'Require-Capability': 'osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=' + javaVersion + '))"')
}
jar {
manifest { from sharedManifest }
}
// We use "distributions" to create the zip files uploaded to SourceForge
distributions {
main {
baseName = 'rsyntaxtextarea'
contents {
from { [ 'build/libs', 'distfiles' ] }
rename 'RSyntaxTextArea-.*\\.jar', 'rsyntaxtextarea.jar'
}
}
src {
baseName = 'rsyntaxtextarea'
}
}
distZip.classifier = null
distZip.dependsOn jar
srcDistZip.classifier = 'src'
srcDistZip {
from projectDir
include 'src/**/*'
include 'build.gradle'
include '.classpath'
include '.project'
include 'gradle.properties'
include 'gradle/**/*'
include 'gradlew*'
include 'README.md'
include '.settings/**'
}
task buildSourceForgeZips << {
println "Building zip files for SourceForge"
}
buildSourceForgeZips.dependsOn clean, jar, distZip, srcDistZip
// Stuff to generate and upload Maven artifacts
task javadocJar (type: Jar, dependsOn: javadoc) {
manifest { from sharedManifest }
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourceJar (type: Jar) {
manifest { from sharedManifest }
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar, javadocJar, sourceJar
}
signing {
// Don't require signing for e.g. ./gradlew install
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
repositories {
mavenCentral()
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
if (project.hasProperty('upload') && Boolean.parseBoolean(upload)) { // gradlew -Pupload=true
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
}
else {
repository(url: 'file:///' + projectDir + '/../localMavenRepo')
}
pom {
groupId = 'com.fifesoft'
name = 'rsyntaxtextarea'
project {
parent {
groupId 'org.sonatype.oss'
artifactId 'oss-parent'
version '7'
relativePath ''
}
groupId 'com.fifesoft'
artifactId 'rsyntaxtextarea'
packaging 'jar'
name 'rsyntaxtextarea'
description 'RSyntaxTextArea is the syntax highlighting text editor for Swing applications. ' +
'Features include syntax highlighting for 40+ languages, code folding, code completion, ' +
'regex find and replace, macros, code templates, undo/redo, line numbering and bracket ' +
'matching.'
inceptionYear '2003'
url 'http://www.fifesoft.com/rsyntaxtextarea/'
licenses {
license {
name 'Modified BSD License'
url 'http://fifesoft.com/rsyntaxtextarea/RSyntaxTextArea.License.txt'
distribution 'repo'
}
}
scm {
url 'https://github.com/bobbylight/RSyntaxTextArea'
connection 'scm:git:git://github.com/bobbylight/RSyntaxTextArea'
developerConnection 'scm:git:git@github.com:bobbylight/RSyntaxTextArea'
if (!project.version.endsWith('-SNAPSHOT')) {
tag project.version
}
}
developers {
developer {
name 'Robert Futrell'
url 'http://www.fifesoft.com'
organization = 'Fifesoft' /* https://issues.gradle.org/browse/GRADLE-1200 */
organizationUrl 'http://www.fifesoft.com/'
roles {
role 'architect'
role 'developer'
}
timezone '0'
}
}
// Says to enforce 1.5 compatibility when building
// Doesn't work as of Gradle 2.0 due to a Groovy bug; see
// http://jira.codehaus.org/browse/GROOVY-7023
// For now, append it via XML directly
/*
build {
plugins {
plugin {
artifactId 'maven-compiler-plugin'
version '2.3.2'
executions {
execution {
id 'default-compile'
configuration {
source '1.5'
target '1.5'
}
}
}
}
}
}
*/
withXml {
def pluginNode = asNode().appendNode('build').appendNode('plugins').appendNode('plugin')
pluginNode.appendNode('artifactId', 'maven-compiler-plugin')
pluginNode.appendNode('version', '2.3.2')
def executionNode = pluginNode.appendNode('executions').appendNode('execution')
executionNode.appendNode('id', 'default-compile')
executionNode.appendNode('configuration').appendNode('source', '1.5').
parent().appendNode('target', '1.5')
}
}
}
}
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This is the Ant build script for rsyntaxtextarea.jar.
Available targets include:
1. compile: Compiles all org.fife classes into ${class-dir}.
2. make-jar: Creates the jar file.
3. make-source-zip: Creates a source zip file.
3. make-javadoc: Creates the javadoc for RSyntaxTextArea.
Author: Robert Futrell
Version: 1.5
Date: 11aug2013
-->
<project name="RSyntaxTextArea" default="make-jar" basedir=".">
<description>RSyntaxTextArea build file</description>
<!-- Set global properties for this build. -->
<property name="version" value="2.5.0"/>
<property name="source-dir" location="src"/>
<property name="class-dir" location="ant-classes"/>
<property name="dist-dir" location="dist"/>
<property name="doc-dir" location="javadoc"/>
<property name="debug" value="true"/>
<property name="debuglevel" value="lines,vars,source"/>
<property name="java-level" value="1.5"/>
<!-- Compiles the classes. -->
<target name="compile" description="Compile the source">
<echo>Compiling with java: ${java.runtime.version}</echo>
<delete includeEmptyDirs="true" quiet="true" dir="${class-dir}"/>
<mkdir dir="${class-dir}"/>
<javac srcdir="${source-dir}" destdir="${class-dir}"
deprecation="yes" debug="${debug}" debuglevel="${debuglevel}"
source="${java-level}" target="${java-level}" includeantruntime="false"/>
</target>
<!-- Creates the jar file. -->
<target name="make-jar" depends="compile"
description="Create RSyntaxTextArea jar">
<delete includeEmptyDirs="true" quiet="true" dir="${dist-dir}"/>
<mkdir dir="${dist-dir}"/>
<jar destfile="${dist-dir}/rsyntaxtextarea.jar">
<fileset dir="${class-dir}"/>
<fileset dir="i18n"/>
<fileset dir="${source-dir}">
<include name="theme.dtd"/>
</fileset>
<manifest>
<attribute name="Specification-Title" value="RSyntaxTextArea"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Implementation-Title" value="org.fife.ui"/>
<attribute name="Implementation-Version" value="${version}"/>
<section name="RTextArea">
<attribute name="Specification-Title" value="RTextArea"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Implementation-Title" value="org.fife.ui.rtextarea"/>
<attribute name="Implementation-Version" value="${version}"/>
</section>
<section name="RSyntaxTextArea">
<attribute name="Specification-Title" value="RSyntaxTextArea-Core"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Implementation-Title" value="org.fife.ui.rsyntaxtextarea"/>
<attribute name="Implementation-Version" value="${version}"/>
</section>
</manifest>
</jar>
<copy todir="${dist-dir}">
<fileset dir="distfiles"/>
</copy>
</target>
<!-- Builds the source zip file. -->
<target name="make-source-zip" description="Builds the source zip file">
<zip destfile="./rsyntaxtextarea_${version}_Source.zip">
<fileset dir=".">
<include name="distfiles/**"/>
<include name="src/**"/>
<include name="i18n/**"/>
<include name="test/**"/>
<include name="themes/**"/>
<include name="build.xml"/>
<include name=".project"/>
<include name=".classpath"/>
</fileset>
</zip>
</target>
<!-- Builds the javadoc. -->
<target name="make-javadoc" depends="compile">
<javadoc destdir="${doc-dir}" author="true" version="true"
breakiterator="yes">
<packageset dir="${source-dir}" defaultexcludes="yes">
<include name="org/**"/>
</packageset>
</javadoc>
</target>
</project>
# Note that Maven- and signing-related properties are in <maven-home>/gradle.properties
javaVersion=1.5
version=2.5.8
#Fri Aug 15 22:24:22 EDT 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-2.0-bin.zip
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
......@@ -20,14 +20,11 @@ robert -at- fifesoft dot com.
* Compiling
If you wish to compile RSyntaxTextArea from source, the easiest way to do so
is via the included Ant build script. The default target builds the jar.
RSyntaxTextArea compiles with Gradle. To compile the source, run all unit
tests, and create the distribution zip file:
cd RSyntaxTextArea
ant
Other targets are defined to build the source zip for the project, and
generate its Javadoc.
gradlew build
* Feedback
......@@ -41,10 +38,6 @@ robert -at- fifesoft dot com.
* https://github.com/bobbylight/RSyntaxTextArea
Add a bug or enhancement request, peruse the Wiki, etc.
* http://fifesoft.com/rsyntaxtextarea
Project home page, which contains general information and example
source code.
* Thanks
Translations:
......
......@@ -165,9 +165,12 @@ public class UnicodeWriter extends Writer {
* Returns whether UTF-8 files should have a BOM in them when written.
*
* @return Whether to write a BOM for UTF-8 files.
* @see #setWriteUtf8BOM(boolean)
* @see UnicodeWriter
*/
public static boolean getWriteUtf8BOM() {
String prop = System.getProperty(PROPERTY_WRITE_UTF8_BOM);
// We default to writing the BOM, for some reason.
if (prop!=null && Boolean.valueOf(prop).equals(Boolean.FALSE)) {
return false;
}
......@@ -215,6 +218,19 @@ public class UnicodeWriter extends Writer {
}
/**
* Sets whether UTF-8 files should have a BOM written in them.
*
* @param write Whether to write a BOM.
* @see #getWriteUtf8BOM()
* @see UnicodeWriter
*/
public static void setWriteUtf8BOM(boolean write) {
System.setProperty(UnicodeWriter.PROPERTY_WRITE_UTF8_BOM,
Boolean.toString(write));
}
/**
* Writes a portion of an array of characters.
*
......