O
- technology-specific type to access range object.public abstract class AbstractWordWriter<O> extends AbstractWriter implements WordWriter<O>, WordHelper<O>
WordHelper.PostProcessor
TOOL_CUSTOM_DOC_PROP, UML_CUSTOM_DOC_PROP
PAGE_WIDTH, POINTS_FOR_1CM
Modifier | Constructor and Description |
---|---|
protected |
AbstractWordWriter(WordWriterInput input)
Constructor; copies input template into output file that will be filled with this writer.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
appendTextInNewParagraphWithStyle(Range<O> range,
TextDescription newText,
Style style) |
void |
clearUndoCache()
When you have large documents and you use a binary (COM) API, you will want to call this one
regularly (e.g., for each class doc), so you don't get Word pop-up windows
"memory insufficient.
|
Cursor<O> |
closeAndReopenDoc(CursorList<O> cursors,
Cursor<O> currentCursor) |
Caption<O> |
createCaption(Caption.CaptionKind figure,
Range<O> range) |
Cursor<O> |
createCursor(Placeholder ph,
Range<O> limited) |
void |
createWordApp()
Where applicable, launches (and caches) the MS Word application.
|
void |
exitAppAndSaveDocument()
Saves MS Word document (and where applicable, exits MS Word application).
|
CursorList<O> |
getCursors() |
WordWriterInput |
getInput()
Returns input used for writing.
|
java.lang.String |
getInputFileNames()
Return names of one or more input files used by this writer.
|
java.lang.String |
getOutputFileNames()
Return names of one or more output files created by this writer.
|
java.lang.String |
getWordAppName()
Returns the MS Word application name.
|
java.lang.String |
getWordAppVersion()
Returns the MS Word application version.
|
void |
initDocgenOptimisationOptions()
Where applicable, initialises and stores MS Word application options (speed of doc
generation) to original values.
|
boolean |
isInTOC(Range<O> range) |
protected static double |
pointForPerc(int perc) |
void |
scanAndPostprocess(WordHelper.PostProcessor pp) |
CursorList<O> |
scanHyperlinkPlaceholderRanges(java.lang.String pattern)
This one scans for the 3rd time the document, for hyperlinks, after all the writing has
completed after the 2nd scan.
|
CursorList<O> |
scanPlaceholderRanges(java.lang.String pattern,
java.util.List<Range<O>> figCaptionRanges,
java.util.List<Range<O>> tabCaptionRanges)
This one scans the whole initial document and initialises placeholders, with text, ranges and
counts of existing tables and figures (captions) before each of them.
|
void |
setDocgenOptimisationOptions()
Where applicable, sets MS Word application options to speed performance of doc generation.
|
java.lang.String |
toString() |
void |
unsetDocgenOptimisationOptions()
Where applicable, brings back the original MS Word application options to values stored with
the call to
WordHelper.initDocgenOptimisationOptions() . |
void |
write()
Writes the content from input.
|
Cursor<O> |
writeAbbrTable(Cursor<O> initCursor,
PackageDoc packageDoc) |
Cursor<O> |
writeClassFromPackage(Cursor<O> cursor,
ClassDoc doc,
Style headStyle)
Writes all related to a class at the end of range in
initCursor . |
Cursor<O> |
writeDataIndex(Cursor<O> initCursor,
PackageDoc packageDoc) |
Cursor<O> |
writeDiagram(Cursor<O> cursor,
FigureDoc doc)
Writes all related to a diagram at the end of range in
cursor . |
Cursor<O> |
writeExplicitClass(Cursor<O> cursor,
ClassDoc doc)
Writes all related to a class, including the title, at the start of range in
cursor . |
Cursor<O> |
writeFcTable(Cursor<O> initCursor,
PackageDoc packageDoc) |
Cursor<O> |
writeLnMapPackage(Cursor<O> initCursor,
PackageDoc packageDoc) |
Cursor<O> |
writePackage(Cursor<O> initCursor,
PackageDoc doc,
boolean isRoot)
Writes all related to a package.
|
Cursor<O> |
writePresCondTable(Cursor<O> initCursor,
PackageDoc packageDoc) |
Cursor<O> |
writeProperties(Cursor<O> initCursor,
PropertiesDoc doc)
Writes a set of properties as a table at the end of range in
cursor . |
Cursor<O> |
writeSclEnum(Cursor<O> cursor,
PackageDoc packageDoc) |
Cursor<O> |
writeTrgOpTable(Cursor<O> initCursor,
PackageDoc packageDoc) |
getDocumentMetadata
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
applyCloseReopen
getDocumentMetadata, getSupportedFormats
appendHtmlTextInNewParagraphWithStyle, appendNewLine, appendRawTextInNewParagraphWithStyle, appendText, appendTextInNewParagraph, appendTextWithStyle, closeDoc, collapseRangeToEnd, collectCaptions, createPatternFinder, createRange, duplicateRange, getCustomDocProperties, getDocumentAsRange, getExistingStyleNames, getRangeParagraphCount, getRangeParagraphOutlineLevel, getRangeParagraphStyleName, insertBookmark, insertFigure, insertFigureCaption, insertFigureRef, insertHyperlink, insertTable, insertTableCaption, insertTableRef, isRangeWithTable, openDoc, prependNewLine, prependText, setCustomDocProperties, updateFields, updateTablesOf
protected AbstractWordWriter(WordWriterInput input) throws UnsupportedInputFormatException, UnsupportedOutputFormatException, java.io.IOException
input
- UnsupportedInputFormatException
UnsupportedOutputFormatException
java.io.IOException
public void createWordApp()
This default implementation does nothing.
createWordApp
in interface WordHelper<O>
public java.lang.String getWordAppName()
This default implementation returns empty string.
getWordAppName
in interface WordHelper<O>
public java.lang.String getWordAppVersion()
This default implementation returns empty string.
getWordAppVersion
in interface WordHelper<O>
public void exitAppAndSaveDocument()
This default implementation does nothing.
exitAppAndSaveDocument
in interface WordHelper<O>
public void initDocgenOptimisationOptions()
This default implementation does nothing.
initDocgenOptimisationOptions
in interface WordHelper<O>
public void setDocgenOptimisationOptions()
This default implementation does nothing.
setDocgenOptimisationOptions
in interface WordHelper<O>
public void unsetDocgenOptimisationOptions()
WordHelper.initDocgenOptimisationOptions()
.
This default implementation does nothing.
unsetDocgenOptimisationOptions
in interface WordHelper<O>
public CursorList<O> scanPlaceholderRanges(java.lang.String pattern, java.util.List<Range<O>> figCaptionRanges, java.util.List<Range<O>> tabCaptionRanges)
WordHelper
scanPlaceholderRanges
in interface WordHelper<O>
public CursorList<O> scanHyperlinkPlaceholderRanges(java.lang.String pattern)
WordHelper
scanHyperlinkPlaceholderRanges
in interface WordHelper<O>
protected static double pointForPerc(int perc)
public void clearUndoCache()
This default implementation does nothing.
clearUndoCache
in interface WordHelper<O>
public final void scanAndPostprocess(WordHelper.PostProcessor pp)
scanAndPostprocess
in interface WordHelper<O>
public final CursorList<O> getCursors()
getCursors
in interface WordHelper<O>
public final boolean isInTOC(Range<O> range)
isInTOC
in interface WordHelper<O>
public final Cursor<O> createCursor(Placeholder ph, Range<O> limited)
createCursor
in interface WordHelper<O>
public final Caption<O> createCaption(Caption.CaptionKind figure, Range<O> range)
createCaption
in interface WordHelper<O>
public Cursor<O> closeAndReopenDoc(CursorList<O> cursors, Cursor<O> currentCursor)
This default implementation just returns currentCursor
, without any
closing/reopening. If you need to actually close/reopen the document (as a means of
optimising performance), override this method.
closeAndReopenDoc
in interface WordHelper<O>
public java.lang.String appendTextInNewParagraphWithStyle(Range<O> range, TextDescription newText, Style style)
You'll always use this one for regular text and tables.
appendTextInNewParagraphWithStyle
in interface WordHelper<O>
public Cursor<O> writePackage(Cursor<O> initCursor, PackageDoc doc, boolean isRoot)
WordWriter
initCursor
.writePackage
in interface WordWriter<O>
public Cursor<O> writeDataIndex(Cursor<O> initCursor, PackageDoc packageDoc)
writeDataIndex
in interface WordWriter<O>
public Cursor<O> writeLnMapPackage(Cursor<O> initCursor, PackageDoc packageDoc)
writeLnMapPackage
in interface WordWriter<O>
public Cursor<O> writePresCondTable(Cursor<O> initCursor, PackageDoc packageDoc)
writePresCondTable
in interface WordWriter<O>
public Cursor<O> writeFcTable(Cursor<O> initCursor, PackageDoc packageDoc)
writeFcTable
in interface WordWriter<O>
public Cursor<O> writeTrgOpTable(Cursor<O> initCursor, PackageDoc packageDoc)
writeTrgOpTable
in interface WordWriter<O>
public Cursor<O> writeAbbrTable(Cursor<O> initCursor, PackageDoc packageDoc)
writeAbbrTable
in interface WordWriter<O>
public Cursor<O> writeSclEnum(Cursor<O> cursor, PackageDoc packageDoc)
writeSclEnum
in interface WordWriter<O>
public Cursor<O> writeExplicitClass(Cursor<O> cursor, ClassDoc doc)
WordWriter
cursor
.writeExplicitClass
in interface WordWriter<O>
public Cursor<O> writeClassFromPackage(Cursor<O> cursor, ClassDoc doc, Style headStyle)
WordWriter
initCursor
.writeClassFromPackage
in interface WordWriter<O>
public Cursor<O> writeProperties(Cursor<O> initCursor, PropertiesDoc doc)
WordWriter
cursor
. Used to
write all related to a set of class properties (attributes/literals, or association ends, or
operations), or for a collection of one type of properties from one or more packages or
classes that need to be put in a table format.writeProperties
in interface WordWriter<O>
public Cursor<O> writeDiagram(Cursor<O> cursor, FigureDoc doc)
WordWriter
cursor
.writeDiagram
in interface WordWriter<O>
public final WordWriterInput getInput()
Writer
public final java.lang.String getInputFileNames()
Writer
getInputFileNames
in interface Writer
public final java.lang.String getOutputFileNames()
Writer
getOutputFileNames
in interface Writer
public final void write()
Writer
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2009-2016 Tatjana (Tanja) Kostic