Skip to content
Commits on Source (20)
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true">
<fileset name="all" enabled="true" check-config-name="Sun Checks" local="false">
<file-match-pattern match-pattern="." include-pattern="true"/>
</fileset>
</fileset-config>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test-integration/src"/>
<classpathentry kind="src" path="gen/src"/>
<classpathentry kind="src" path="test/src"/>
<classpathentry kind="src" path="lib-mnemonics/src"/>
<classpathentry exported="true" kind="lib" path="lib/htmlparser.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jna.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jmyspell-core-1.0.0-beta-2.jar"/>
<classpathentry exported="true" kind="lib" path="test/lib/junit-4.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/pdfbox-app-1.8.1.jar"/>
<classpathentry kind="lib" path="lib/jsch-0.1.49.jar"/>
<classpathentry kind="lib" path="lib/sequence-library-1.0.2.jar"/>
<classpathentry kind="lib" path="lib/antlr-runtime-3.4.jar"/>
<classpathentry kind="lib" path="lib/dictzip.jar"/>
<classpathentry kind="lib" path="lib/diff.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-3.6.2.jar"/>
<classpathentry kind="lib" path="lib/lucene-core-3.6.2.jar"/>
<classpathentry kind="lib" path="lib/lucene-kuromoji-3.6.2.jar"/>
<classpathentry kind="lib" path="lib/lucene-smartcn-3.6.2.jar"/>
<classpathentry kind="lib" path="lib/tinysegmenter.jar"/>
<classpathentry kind="lib" path="lib/commons-lang-2.4.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/LanguageTool/cjftransform-1.0.1.jar"/>
<classpathentry kind="lib" path="lib/LanguageTool/ictclas4j-1.0.1.jar"/>
<classpathentry kind="lib" path="lib/LanguageTool/jwordsplitter-3.4.jar"/>
<classpathentry kind="lib" path="lib/LanguageTool/languagetool-core-2.2.jar"/>
<classpathentry kind="lib" path="lib/LanguageTool/LanguageTool-data.jar"/>
<classpathentry kind="lib" path="lib/LanguageTool/morfologik-fsa-1.5.4.jar"/>
<classpathentry kind="lib" path="lib/LanguageTool/morfologik-speller-1.5.4.jar"/>
<classpathentry kind="lib" path="lib/LanguageTool/morfologik-stemming-1.5.4.jar"/>
<classpathentry kind="lib" path="lib/LanguageTool/segment-1.4.1.jar"/>
<classpathentry kind="lib" path="lib/LanguageTool/lucene-gosen-2.0.2-ipadic.jar"/>
<classpathentry kind="lib" path="lib/groovy-all-2.2.2.jar"/>
<classpathentry kind="lib" path="lib/KoreanAnalyzer-3x-120223.jar"/>
<classpathentry kind="lib" path="lib/SuperTMXMerge-for_OmegaT.jar"/>
<classpathentry kind="lib" path="lib/swing-layout-1.0.4.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.7.jar"/>
<classpathentry kind="lib" path="lib/slf4j-jdk14-1.7.7.jar"/>
<classpathentry kind="lib" path="lib/sqljet-1.1.10.jar"/>
<classpathentry kind="lib" path="lib/svnkit-1.8.5.jar"/>
<classpathentry kind="lib" path="lib/trilead-ssh2-1.0.0-build217.jar"/>
<classpathentry kind="lib" path="lib/vldocking-3.0.5-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="lib/juniversalchardet-1.0.3.jar"/>
<classpathentry kind="lib" path="lib/org.eclipse.jgit-3.7.1.201504261725-r.jar"/>
<classpathentry exported="true" kind="lib" path="test/lib/xmlunit-1.6.jar"/>
<classpathentry kind="lib" path="lib/commons-io-2.4.jar" sourcepath="lib/sources/commons-io-2.4-sources.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
This diff is collapsed.
classes
dist
build
dist2
manifest.mf
/nbproject/private/
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>OmegaT trunk</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
OmegaT is a computer-assisted translation (CAT) tool.
* [General information](release/readme.txt)
* [For developers](docs_devel/README.txt)
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<project name="javahelp-filters" default="default" basedir=".">
<description>Builds, tests, and runs the project javahelp-filters.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="javahelp-filters-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
Manifest-Version: 1.0
OmegaT-Plugin: true
Name: org.omegat.filters2.javahelp.helpset.HelpSetFilter
OmegaT-Filter: true
Name: org.omegat.filters2.javahelp.toc.TOCFilter
OmegaT-Filter: true
This diff is collapsed.
build.xml.data.CRC32=9eab5f91
build.xml.script.CRC32=0147d762
build.xml.stylesheet.CRC32=e2435cb5
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=9eab5f91
nbproject/build-impl.xml.script.CRC32=6f286c58
nbproject/build-impl.xml.stylesheet.CRC32=3b89b5a6
file.reference.xerces-2.6.2.jar=lib/xerces-2.6.2.jar
manifest.file=manifest.mf
application.args=
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/javahelp-filters.jar
dist.javadoc.dir=${dist.dir}/javadoc
jar.compress=false
javac.classpath=\
${reference.OmegaT.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.source=${default.javac.source}
javac.target=${default.javac.target}
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
platform.active=default_platform
project.OmegaT=../../../omegat
reference.OmegaT.jar=${project.OmegaT}/dist/OmegaT.jar
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
src.dir=src
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/2">
<name>javahelp-filters</name>
<minimum-ant-version>1.6</minimum-ant-version>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots/>
</data>
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
<reference>
<foreign-project>OmegaT</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
</references>
</configuration>
</project>
/*
* HelpSetFilter.java
*
* Created on 5 Íîÿáðü 2005 ã., 5:10
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package org.omegat.filters2.javahelp.helpset;
import org.omegat.filters2.Instance;
import org.omegat.filters2.TranslationException;
import org.omegat.filters2.xml2.XMLFilter2;
/**
* Filter for JavaHelp Helpset files (*.hs).
*
* @author Maxym Mykhalchuk
*/
public class HelpSetFilter extends XMLFilter2
{
/** Creates a new instance of HelpSetFilter */
public HelpSetFilter()
throws TranslationException
{
super("helpset");
addTranslatableTag("title");
addTranslatableTag("label");
}
/** Human-readable name of the File Format this filter supports. */
public String getFileFormatName()
{
return "Java HelpSet files";
}
/** The default list of filter instances that this filter class has. */
public Instance[] getDefaultInstances()
{
return new Instance[]
{
new Instance("*.hs", null, "UTF-8")
};
}
}
/*
* TOCFilter.java
*
* Created on 5 Íîÿáðü 2005 ã., 5:11
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package org.omegat.filters2.javahelp.toc;
import org.omegat.filters2.Instance;
import org.omegat.filters2.TranslationException;
import org.omegat.filters2.xml2.XMLFilter2;
/**
* JavaHelp TOC (Table of Contents) filter.
*
* @author Maxym Mykhalchuk
*/
public class TOCFilter extends XMLFilter2
{
/** Creates a new instance of TOCFilter */
public TOCFilter()
throws TranslationException
{
super("toc");
addTranslatableAttribute("text", "tocitem");
}
public String getFileFormatName()
{
return "JavaHelp Table of Contents files";
}
public Instance[] getDefaultInstances()
{
return new Instance[]
{
new Instance("*.xml", null, "UTF-8")
};
}
}
/*
* XMLFilter2.java
*
* Created on 5 Íîÿáðü 2005 ã., 5:10
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package org.omegat.filters2.xml2;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.omegat.filters2.AbstractFilter;
import org.omegat.filters2.TranslationException;
import org.omegat.filters2.xml.XMLWriter;
import org.omegat.util.AntiCRReader;
import org.omegat.util.EncodingAwareReader;
import org.omegat.util.OConsts;
import org.omegat.util.StaticUtils;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
/**
* Next Generation Filter for XML Files.
* It uses SAX Parser to process XML file.
*
* @author Maxym Mykhalchuk
*/
public abstract class XMLFilter2 extends AbstractFilter
{
/** SAX Parser to parse XML file. */
SAXParser parser;
/**
* Root Element of the handled XML file.
* It's used to differentiate between filters so that a filter doesn't
* handle the XML file that is not his to handle.
*/
String rootElement;
/**
* Creates a new instance of XMLFilter2.
* <p>
* Needs a root element of the XML file that it should handle.
* Root element is used to differentiate between filters so that a filter
* doesn't handle the XML file that is not his to handle.
* If root element is null, all the files are handled.
* <p>
* Subclasses have to setup translatable tags and attributes
* by calling {@link #addTranslatableTag(String)} and
* {@link #addTranslatableAttribute(String,String)}.
*/
public XMLFilter2(String rootElement)
throws TranslationException
{
try
{
this.rootElement = rootElement;
SAXParserFactory factory = SAXParserFactory.newInstance();
parser = factory.newSAXParser();
}
catch( Exception e )
{
throw new TranslationException(e.getLocalizedMessage());
}
}
/**
* Returns whether the file is supported by the filter.
* <p>
* XMLFilter2 uses supplied rootElement to tell whether it's his file or no.
*/
public boolean isFileSupported(BufferedReader reader)
{
if( rootElement==null )
return true;
try
{
char[] buf = new char[OConsts.READ_AHEAD_LIMIT];
int len = reader.read(buf);
String s = new String(buf, 0, len);
int pos = -1;
while( (pos=s.indexOf('<', pos+1))>=0 )
{
char ch = s.charAt(pos+1);
if( ch=='!' )
{
// skipping comments and DTD
char ch2 = s.charAt(pos+2);
if( ch2=='-' )
pos = s.indexOf("-->", pos)+2; // comment
else
pos = s.indexOf('>', pos); // DTD
if( pos<0 )
break;
}
else if( Character.isJavaIdentifierStart(ch) )
{
// found <"english", testing
int pos2 = pos+1;
while( Character.isJavaIdentifierPart(s.charAt(pos2)) )
pos2++;
String id = s.substring(pos+1, pos2);
return id.equals(rootElement);
}
}
return false;
}
catch( Exception e )
{
return false;
}
}
/** Tags with translatable content. */
private HashSet translatableTags = new HashSet();
/** Tags whose attributes are translatable. */
private HashMap translatableAttributes = new HashMap();
/**
* Adds a tag, whose content is translatable.
* <p>
* For example, in XHTML the text in
* <code>&lt;h1&gt;Something here&lt;/h1&gt;</code>
* needs to be translated,
* so XHTML filter should call
* <code>addTranslatableTag("h1");</code>.
*/
protected void addTranslatableTag(String tag)
{
translatableTags.add(tag);
}
/**
* Adds an attribute, whose content is translatable.
* <p>
* For example, in XHTML the alternative text of an image
* <code>&lt;img src="..." alt="image description"&gt;</code>
* needs to be translated,
* so XHTML filter should call
* <code>addTranslatableAttribute("alt", "img");</code>.
*/
protected void addTranslatableAttribute(String attribute, String tag)
{
HashSet hs = (HashSet)translatableAttributes.get(tag);
if( hs==null )
hs = new HashSet();
hs.add(attribute);
translatableAttributes.put(tag, hs);
}
/**
* Package private processEntry to give it to XMLHandler2
*/
String privateProcessEntry(String entry)
{
return processEntry(entry);
}
/** Processes a single file. */
public void processFile(BufferedReader infile, BufferedWriter outfile)
throws IOException, TranslationException
{
XMLHandler2 handler;
handler = new XMLHandler2(this, outfile, translatableTags, translatableAttributes);
InputSource is = new InputSource(infile);
try
{
XMLReader reader = parser.getXMLReader();
reader.setContentHandler(handler);
reader.setDTDHandler(handler);
reader.setEntityResolver(handler);
reader.setErrorHandler(handler);
reader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
reader.setProperty("http://xml.org/sax/properties/declaration-handler", handler);
parser.parse(is, handler);
}
catch( SAXException saxe )
{
saxe.printStackTrace(StaticUtils.getLogStream());
throw new TranslationException(saxe.getLocalizedMessage());
}
}
/**
* Whether source encoding can be varied by the user.
* <p>
* Default is true, but note that user-supplied encoding will be used
* only if XML reader class fails to find encoding declaration in XML file.
*/
public boolean isSourceEncodingVariable()
{
return true;
}
/**
* Whether target encoding can be varied by the user.
* <p>
* Default is true. XML writer class will write out encoding declaration.
*/
public boolean isTargetEncodingVariable()
{
return true;
}
/**
* Creates a reader of an input file.
* <p>
* By default creates an encoding-aware reader, that is a reader that
* finds and uses encoding declaration in XML file.
*/
public BufferedReader createReader(File infile, String encoding)
throws UnsupportedEncodingException, IOException
{
return new BufferedReader(
new AntiCRReader(
new EncodingAwareReader(
infile.getAbsolutePath(),
EncodingAwareReader.ST_XML,
encoding)));
}
/**
* Creates a writer of the translated file.
* <p>
* By default creates a writer that will write out encoding declaration.
*/
public BufferedWriter createWriter(File outfile, String encoding)
throws UnsupportedEncodingException, IOException
{
return new BufferedWriter(
new XMLWriter(outfile.getAbsolutePath(),
encoding));
}
/**
* Returns the hint displayed while the user edits the filter.
* <p>
* By default returns a note stating that user-supplied encoding will be used
* only if XML reader class fails to find encoding declaration in XML file.
*/
public String getHint()
{
return "Note: Source File Encoding setting will be used only if the file does not have an encoding declaration.";
}
}
/*
* XMLHandler2.java
*
* Created on 5 Íîÿáðü 2005 ã., 5:37
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package org.omegat.filters2.xml2;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.HashSet;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.ext.DefaultHandler2;
/**
* Callback to be called by SAX Parser.
* Does the real job of feeding strings to OmegaT core.
*
* @author Maxym Mykhalchuk
*/
public class XMLHandler2 extends DefaultHandler2
{
/** My parent XML Filter. */
XMLFilter2 filter;
/** The writer I write translated file into. */
BufferedWriter writer;
/** Tags with translatable content. */
private HashSet translatableTags;
/** Tags whose attributes are translatable. */
private HashMap translatableAttributes;
/**
* Creates a new instance of XMLHandler2
*/
public XMLHandler2(XMLFilter2 filter, BufferedWriter writer,
HashSet translatableTags, HashMap translatableAttributes)
{
this.filter = filter;
this.writer = writer;
this.translatableTags = translatableTags;
this.translatableAttributes = translatableAttributes;
}
/** Utility Method: Writes some data into the supplied writer. */
private void write(char[] ch, int start, int length) throws SAXException
{
try
{
writer.write(ch, start, length);
}
catch( IOException ioe )
{
throw new SAXException(ioe);
}
}
/** Utility Method: Writes some data into the supplied writer. */
private void write(String s) throws SAXException
{
try
{
writer.write(s);
}
catch( IOException ioe )
{
throw new SAXException(ioe);
}
}
/** A buffer to collect a translatable string. */
StringBuffer collected;
/** If a collectable element started. */
boolean started = false;
/** The collectable element. */
String element;
/** Receive notification of the start of an element. */
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException
{
if(weAreInEntity)
return;
if( translatableTags.contains(qName) && !started )
{
started = true;
element = qName;
collected = new StringBuffer();
}
write("<"+qName);
for(int i=0; i<attributes.getLength();i++)
{
String attr = attributes.getQName(i);
String value = attributes.getValue(i);
write(" ");
write(attr);
write("=\"");
if( translatableAttributes.containsKey(qName) )
{
HashSet hs = (HashSet)translatableAttributes.get(qName);
if( hs.contains(attr) )
value = filter.privateProcessEntry(value);
}
write(value);
write("\"");
}
write(">");
}
/** Receive notification of character data inside an element. */
public void characters(char[] ch, int start, int length)
throws SAXException
{
if(weAreInEntity)
return;
if( started )
collected.append(ch, start, length);
else
write(ch, start, length);
}
/** Receive notification of the end of an element. */
public void endElement(String uri, String localName, String qName)
throws SAXException
{
if(weAreInEntity)
return;
if( started && element.equals(qName) )
{
started = false;
write(filter.privateProcessEntry(collected.toString()));
}
write("</"+qName+">");
}
/** Resolve an external entity to work offline or behind proxy. */
public InputSource resolveEntity(String publicId, String systemId)
throws IOException, SAXException
{
String orig = systemId;
int lastslash = systemId.lastIndexOf('/');
if( lastslash>=0 )
{
String name = orig.substring(lastslash+1);
String res = "/org/omegat/filters2/javahelp/resources/"+name;
InputStream stream = getClass().getResourceAsStream(res);
return new InputSource(stream);
}
return null;
}
/** The older {@link #resolveEntity} method is overridden to call this one. */
public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId)
throws SAXException, IOException
{
return resolveEntity(publicId, systemId);
}
/** Receive notification of ignorable whitespace in element content.*/
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
{
if(!weAreInEntity)
write(ch, start, length);
}
/** Receive notification of the beginning of the document. */
public void startDocument() throws SAXException
{
write("<?xml version='1.0' encoding='UTF-8'?>\n");
}
/** Receive notification of the comments in XML file. */
public void comment(char[] ch, int start, int length) throws SAXException
{
if (!weAreInEntity)
{
write("<!--");
write(ch, start, length);
write("-->");
}
}
public void startDTD(String name, String publicId, String systemId) throws SAXException
{
if(!weAreInEntity)
{
write("\n<!DOCTYPE ");
write(name);
write("\n");
write("PUBLIC \""+publicId+"\"\n");
write("\""+systemId+"\">\n");
}
}
boolean weAreInEntity = false;
String entityName;
public void startEntity(String name) throws SAXException
{
weAreInEntity = true;
entityName = name;
}
public void endEntity(String name) throws SAXException
{
if (entityName.equals(name))
weAreInEntity = false;
}
public void endDocument() throws SAXException
{
super.endDocument();
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project name="nbedge-filter" default="default" basedir=".">
<description>Builds, tests, and runs the project nbedge-filter.</description>
<import file="nbproject/build-impl.xml"/>
<property name="plugins.dir" location="../../dist/plugins" />
<target name="-post-jar">
<mkdir dir="${plugins.dir}/edge/" />
<copy file="${dist.jar}" todir="${plugins.dir}/edge/" />
</target>
<target name="-post-clean">
<delete dir="${plugins.dir}/edge"/>
</target>
</project>
Manifest-Version: 1.0
OmegaT-Plugin: true
Name: org.omegat.filters2.xml.edge.NBEdgeFilter
OmegaT-Filter: true
\ No newline at end of file
This diff is collapsed.