alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

jEdit example source code file (README.SRC.txt)

This example jEdit source code file (README.SRC.txt) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - jEdit tags/keywords

for, get, if, if, mac, mac, os, os, pdf-format, the, this, windows, x, x

The jEdit README.SRC.txt source code

SOURCE CODE NOTES

This file only contains information about compiling from source.
General jEdit documentation can be found in the 'doc' directory.

* Requirements

 For all tasks:

  - Apache Ant. I use version 1.7; older or newer versions might or might not
    work. If an older version doesn't work, install an update. If a newer
    version doesn't work, please submit a bug report.
    Get it from <http://ant.apache.org>.
  - The Ant-nodeps package. This is included in the download from ants website,
    as well as the AntPlugin from the Plugin Manager,
    but not in some default installs on various *nix systems.
    There you should get the ant-nodeps package through your
    package management system.
  - Configure the build.properties.sample file with your local paths and save it
    as build.properties.
  - Make sure you also have the build-support module.
  - Configure the build.properties.sample file from build-support with your
    local paths and save it as build.properties in the folder jars.

 For building jEdit, the API documentation or any of the
 distribution files except of the source package:

  - A Java compiler of at least version 1.5, such as Sun's javac
    which is included in the JDK. Get it from <http://java.sun.com/downloads/>

 For building the API documentation:

  - Sun's javadoc tool, which is included in the JDK.
    Get it from <http://java.sun.com/downloads/>

 For building the online help in either HTML- or PDF-format:

  - DocBook XML 4.4. called "docbook-dtd" or "docbook-xml" from package managers.
    Get it from <http://www.docbook.org/xml/4.4/>.  Contains catalog information.
  - DocBook XSL. Called "docbook-xsl" in package managers.
    Contains style sheets for transformation into HTML or FO.
    Don't use a ".0" version, these are experimental releases.
    <http://www.sourceforge.net/project/showfiles.php?group_id=21935&package_id=16608>
  - xsltproc. sometimes packaged as "libxslt" from package managers:
    This is originally a *nix program, but there are ports
    e. g. for Windows too. Get it from <http://www.xmlsoft.org/XSLT/downloads.html>
    or <http://www.zlatkovic.com/libxml.en.html>.

 For building the online help in PDF-format:

  - Apache FOP 0.20.5. The 0.92 beta version will NOT work!
    Get it from <http://xmlgraphics.apache.org/fop/download.html>

 For building the windows installer (for the final step):

  - Inno Setup. Get it from <http://www.jrsoftware.org/isdl.php>
  - A box running windows.

 For building the Mac OS X disk image (DMG) for easy distribution (for the final step):

  - A box running Mac OS X


* Tasks

 If all necessary tools are installed and set up, you can use ant with a couple of targets.
 The default target if you just run "ant" is "build", like running "ant build".

 - build              build the jEdit JAR-file with full debug-information
  builds jEdit in the build-folder, configured in build.properties,
  with full debug information included.

 - run                run jEdit
  runs the jEdit-version in the build-folder, configured in build.properties.
  If there isn't any, it builds it in front of execution.

 - docs-html          generate HTML docs (needs xsltproc)
  builds the online help in HTML-format in the build-folder, configured in build.properties.

 - docs-javadoc       generate JavaDoc API docs
  builds the API documentation in the build-folder, configured in build.properties.

 - docs-pdf-USletter  generate PDF users-guide with US letter paper size (needs xsltproc and fop)
  builds the User's Guide in PDF-format with US letter page size
  in the build-folder, configured in build.properties.

 - docs-pdf-a4        generate PDF users-guide with A4 paper size (needs xsltproc and fop)
  builds the User's Guide in PDF-format with A4 page size
  in the build-folder, configured in build.properties.

 - dist               build all distribution files
  builds all distribution files or prepares the final step for some of them (Win and Mac)
  in the dist-folder, configured in build.properties.

 - dist-deb           build the DEB Package
  builds the DEB Debian package in the dist-folder, configured in build.properties.

 - dist-java          build the Java-installer
  builds the Java installer in the dist-folder, configured in build.properties.

 - dist-mac           build the Mac OS X disk image (DMG-file)
  builds the Mac OS X internet-enabled disk image (DMG-file) if building on a box
  running Mac OS X. If building on a box running something else, there will be a file
  called jedit<version_here>-dist-mac-finish.tar.bz2 in the dist-folder,
  configured in build.properties. Give that to someone running Mac OS X and ask him
  to extract the archive and to execute "ant dist-mac-finish".
  The only thing that needs to be installed for this final step is Apache Ant.

 - dist-mac-finish    finish building the Mac OS X disk image (DMG-file) on Mac OS X
  builds the Mac OS X internet-enabled disk image (DMG-file) in the dist-folder,
  configured in build.properties if building on a box running Mac OS X.
  This target is normally only run directly, if someone just has to do
  the final step that was prepared by "dist-mac" or "dist".

 - dist-manuals       build the PDF-manuals
  builds the User's Guide in PDF-format with both, USletter and A4 page size
  in the dist-folder, configured in build.properties.

 - dist-slackware     build the Slackware Package
  builds the Slackware TGZ package in the dist-folder, configured in build.properties.

 - dist-src           build the src-archive
  builds the source package in the dist-folder, configured in build.properties.

 - dist-win           build the Windows installer (EXE-file)
  builds the windows installer in the dist-folder, configured in build.properties,
  on a box running Windows. If building on a box running something else, there will be
  a file called jedit<version_here>-dist-win-finish.tar.bz2 in the dist-folder,
  configured in build.properties. Give that to someone running Windows and ask him
  to extract the archive and to execute "ant dist-win-finish".
  The only things that need to be installed for this final step is Apache Ant, and
  Inno Setup. Prior to running "ant dist-win-finish", the helper has to set up the
  build.properties file with the path to his Inno Setup installation.

 - dist-win-finish    finish building the Windows installer (EXE-file) on Windows
  build the windows installer in the dist-folder, configured in build.properties if
  building on a box running Winows. This target is normally only run directly, if
  someone just has to do the final step that was prepared by "dist-win" or "dist".

 - clean              clean up build.dir and dist.dir
  cleans up the temporary files from the build- and dist-folder, configured in build.properties.
  Leaves the runnable jEdit, and the distribution files in place.

 - clean-all          clean up build.dir and dist.dir completely
  cleans up all files from the build- and dist-folder, configured in build.properties,
  and the folders itself too.



* Interesting algorithms and tricks

 - org.gjt.sp.jedit.browser.VFSDirectoryEntryTable: a tree table control.

 - org.gjt.sp.jedit.buffer.LineManager: the "gap" optimization allows
   update operations to be performed in O(1) time in certain
   circumstances.

 - org.gjt.sp.jedit.buffer.KillRing: uses a hash to speed up comparisons
   with sets of strings.

 - org.gjt.sp.jedit.search.BoyerMooreSearchMatcher: fast text search.

 - org.gjt.sp.jedit.syntax.TokenMarker: generic tokenizer driven by rules
   defined in an XML file.

 - org.gjt.sp.jedit.textarea.DisplayManager: the fold visibility map
   looks like an RLE-compressed bit set but does lookups in O(log n).

 - org.gjt.sp.util.WorkThreadPool: a pool of threads executing requests
   from a queue, enforcing various concurrency requirements.



* Tips for Eclipse/NetBeans/IDE users:

Some of the source directories are only needed for building packages on
certain platforms. If you add jEdit source to an IDE like Eclipse that tries
to build everything, you'll get some errors from these directories unless
you have the right libraries. However, if you tell Eclipse to exclude these
directories, you can still build and run/debug jEdit from source.
Follow these steps:

 - Project properties - Java build path
 - Source - Excluded dirs - Edit - Add multiple
 - Add these subdirs: jars, net, de, build


Other jEdit examples (source code examples)

Here is a short list of links related to this jEdit README.SRC.txt source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.