public interface WordHelper<O>
Modifier and Type | Interface and Description |
---|---|
static interface |
WordHelper.PostProcessor
Used for testing only, to play with pure Word stuff, without the notion of the model.
|
Modifier and Type | Field and Description |
---|---|
static int |
PAGE_WIDTH
Page width in cm.
|
static double |
POINTS_FOR_1CM
Number of points for 1cm (from vba doc).
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
appendHtmlTextInNewParagraphWithStyle(Range<O> range,
java.lang.String newMarkup,
Style style) |
void |
appendNewLine(Range<O> range) |
java.lang.String |
appendRawTextInNewParagraphWithStyle(Range<O> range,
java.lang.String newText,
Style style) |
java.lang.String |
appendText(Range<O> range,
java.lang.String newText) |
java.lang.String |
appendTextInNewParagraph(Range<O> range,
java.lang.String newText) |
java.lang.String |
appendTextInNewParagraphWithStyle(Range<O> range,
TextDescription newText,
Style style) |
java.lang.String |
appendTextWithStyle(Range<O> range,
java.lang.String 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) |
void |
closeDoc()
Closes and saves the MS Word document.
|
void |
collapseRangeToEnd(Range<O> range) |
java.util.Map<Caption.CaptionKind,java.util.List<Caption<O>>> |
collectCaptions() |
Caption<O> |
createCaption(Caption.CaptionKind figure,
Range<O> range) |
Cursor<O> |
createCursor(Placeholder ph,
Range<O> limited) |
WordPatternFinder<O> |
createPatternFinder(java.lang.String pattern) |
Range<O> |
createRange(O object) |
void |
createWordApp()
Where applicable, launches (and caches) the MS Word application.
|
Range<O> |
duplicateRange(Range<O> range)
FIXME: could go to Range?
|
void |
exitAppAndSaveDocument()
Saves MS Word document (and where applicable, exits MS Word application).
|
CursorList<O> |
getCursors() |
java.util.Map<java.lang.String,java.lang.String> |
getCustomDocProperties() |
Range<O> |
getDocumentAsRange() |
java.util.Map<java.lang.String,java.lang.String> |
getExistingStyleNames()
Returns names of existing styles.
|
int |
getRangeParagraphCount(Range<O> range) |
int |
getRangeParagraphOutlineLevel(Range<O> range,
int paraIdx) |
java.lang.String |
getRangeParagraphStyleName(Range<O> range,
int paraIdx) |
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.
|
void |
insertBookmark(Range<O> range,
java.lang.String label) |
void |
insertFigure(Range<O> range,
java.io.File pic) |
void |
insertFigureCaption(Range<O> range,
java.lang.String captionText,
java.lang.String logMsg) |
void |
insertFigureRef(Range<O> insertPointRange,
int figNumber) |
void |
insertHyperlink(Range<O> range,
java.lang.String textToDisplay,
java.lang.String url) |
int |
insertTable(Range<O> range,
PropertiesDoc doc,
Style tabhead,
boolean addBookmarks) |
void |
insertTableCaption(Range<O> range,
java.lang.String captionText,
java.lang.String logMsg) |
void |
insertTableRef(Range<O> insertPointRange,
int tabNumber) |
boolean |
isInTOC(Range<O> range) |
boolean |
isRangeWithTable(O range) |
void |
openDoc()
Creates (and caches) the MS Word document.
|
void |
prependNewLine(Range<O> range) |
void |
prependText(Range<O> range,
java.lang.String newText)
Prepends text; prepended paragraph will have the same style as the one in range.
|
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 |
setCustomDocProperties(java.util.Map<java.lang.String,java.lang.String> newCustomProps) |
void |
setDocgenOptimisationOptions()
Where applicable, sets MS Word application options to speed performance of doc generation.
|
void |
unsetDocgenOptimisationOptions()
Where applicable, brings back the original MS Word application options to values stored with
the call to
initDocgenOptimisationOptions() . |
void |
updateFields() |
void |
updateTablesOf(java.lang.String what) |
static final int PAGE_WIDTH
static final double POINTS_FOR_1CM
void scanAndPostprocess(WordHelper.PostProcessor pp)
void createWordApp()
java.lang.String getWordAppName()
java.lang.String getWordAppVersion()
void openDoc() throws java.io.IOException
java.io.IOException
void closeDoc() throws java.io.IOException
java.io.IOException
void exitAppAndSaveDocument() throws java.io.IOException
java.io.IOException
void initDocgenOptimisationOptions()
void setDocgenOptimisationOptions()
void unsetDocgenOptimisationOptions()
initDocgenOptimisationOptions()
.void insertHyperlink(Range<O> range, java.lang.String textToDisplay, java.lang.String url)
java.util.Map<java.lang.String,java.lang.String> getExistingStyleNames()
void updateFields()
void updateTablesOf(java.lang.String what)
java.util.Map<java.lang.String,java.lang.String> getCustomDocProperties()
void setCustomDocProperties(java.util.Map<java.lang.String,java.lang.String> newCustomProps)
CursorList<O> getCursors()
java.util.Map<Caption.CaptionKind,java.util.List<Caption<O>>> collectCaptions()
Cursor<O> createCursor(Placeholder ph, Range<O> limited)
Caption<O> createCaption(Caption.CaptionKind figure, Range<O> range)
CursorList<O> scanPlaceholderRanges(java.lang.String pattern, java.util.List<Range<O>> figCaptionRanges, java.util.List<Range<O>> tabCaptionRanges)
CursorList<O> scanHyperlinkPlaceholderRanges(java.lang.String pattern)
WordPatternFinder<O> createPatternFinder(java.lang.String pattern)
void clearUndoCache()
void prependText(Range<O> range, java.lang.String newText)
java.lang.String appendTextInNewParagraphWithStyle(Range<O> range, TextDescription newText, Style style)
java.lang.String appendRawTextInNewParagraphWithStyle(Range<O> range, java.lang.String newText, Style style)
java.lang.String appendHtmlTextInNewParagraphWithStyle(Range<O> range, java.lang.String newMarkup, Style style)
java.lang.String appendTextWithStyle(Range<O> range, java.lang.String newText, Style style)
void insertFigureCaption(Range<O> range, java.lang.String captionText, java.lang.String logMsg)
void insertTableCaption(Range<O> range, java.lang.String captionText, java.lang.String logMsg)
int insertTable(Range<O> range, PropertiesDoc doc, Style tabhead, boolean addBookmarks)
java.lang.String appendTextInNewParagraph(Range<O> range, java.lang.String newText)
boolean isRangeWithTable(O range)
Copyright 2009-2016 Tatjana (Tanja) Kostic