Enum Constant and Description |
---|
fig |
figcapt |
h1 |
h2 |
h3 |
h4 |
h5 |
h6 |
h7 |
h8 |
h9 |
para |
tabcapt |
tabcell |
tabhead |
toc1 |
toc2 |
toc3 |
toc4 |
toc5 |
toc6 |
toc7 |
toc8 |
toc9 |
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Level |
LLEVEL
Detailed logging for Style initialisation.
|
Modifier and Type | Method and Description |
---|---|
static Style |
getHeadingStyle(int outlineLevel) |
java.lang.String |
getName()
Returns the style name to be used for this style.
|
java.util.List<java.lang.String> |
getPreferredNames()
Returns non-empty list of style names, configured by user for this style.
|
static Style |
getTOCStyle(int outlineLevel) |
java.util.Map<java.lang.String,ExistingStyle> |
getUsableStyles()
Returns all usable styles found in the open document.
|
java.util.Map<java.lang.String,ExistingStyle> |
getUsableStyles(boolean inclBuiltIn,
boolean inclCustom)
Returns map of existing styles as found in an open document, which can be used for writing
into document.
|
static void |
initPreferred(java.util.List<java.lang.String> tocStylePrefixes,
java.util.List<java.lang.String> headingStylePrefixes,
java.util.List<java.lang.String> paraStyles,
java.util.List<java.lang.String> figStyles,
java.util.List<java.lang.String> tabheadStyles,
java.util.List<java.lang.String> tabcellStyles,
java.util.List<java.lang.String> figcaptStyles,
java.util.List<java.lang.String> tabcaptStyles)
Adds style names from user configuration in order of preferrence (first is best).
|
static void |
initUsable(java.util.Map<java.lang.String,ExistingStyle> existingStyles)
Initialises styles obtained from the document.
|
boolean |
isHeading()
Returns whether this is a heading style (one out of 9).
|
boolean |
isRecognised(java.lang.String name)
Returns whether
name can be identified as a style name. |
boolean |
isTOC()
Returns whether this is a TOC style (one out of 9).
|
static boolean |
isTOC(java.lang.String styleName) |
void |
logAfter() |
static void |
reset()
Resets all dynamically set values and collections; ensure to call as a part of clean-up
process when existing the app.
|
java.lang.StringBuilder |
toShortString() |
java.lang.String |
toString() |
static Style |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Style[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Style para
public static final Style fig
public static final Style tabhead
public static final Style tabcell
public static final Style figcapt
public static final Style tabcapt
public static final Style toc1
public static final Style toc2
public static final Style toc3
public static final Style toc4
public static final Style toc5
public static final Style toc6
public static final Style toc7
public static final Style toc8
public static final Style toc9
public static final Style h1
public static final Style h2
public static final Style h3
public static final Style h4
public static final Style h5
public static final Style h6
public static final Style h7
public static final Style h8
public static final Style h9
public static org.apache.log4j.Level LLEVEL
public static Style[] values()
for (Style c : Style.values()) System.out.println(c);
public static Style valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static Style getTOCStyle(int outlineLevel)
public static Style getHeadingStyle(int outlineLevel)
public static void initPreferred(java.util.List<java.lang.String> tocStylePrefixes, java.util.List<java.lang.String> headingStylePrefixes, java.util.List<java.lang.String> paraStyles, java.util.List<java.lang.String> figStyles, java.util.List<java.lang.String> tabheadStyles, java.util.List<java.lang.String> tabcellStyles, java.util.List<java.lang.String> figcaptStyles, java.util.List<java.lang.String> tabcaptStyles)
public static void initUsable(java.util.Map<java.lang.String,ExistingStyle> existingStyles) throws ApplicationException
existingStyles
- ApplicationException
- if cannot find a matching (at least built-in) style in the open documentpublic void logAfter()
public static boolean isTOC(java.lang.String styleName)
public static void reset()
Implementation note: Because this is an enumeration, instances are static and when running tests, for example, the collections do NOT get cleaned up. If changing implementation, to not use enumeration, then this would not be needed.
public java.util.List<java.lang.String> getPreferredNames()
getUsableStyles(boolean, boolean)
.public java.util.Map<java.lang.String,ExistingStyle> getUsableStyles()
public java.util.Map<java.lang.String,ExistingStyle> getUsableStyles(boolean inclBuiltIn, boolean inclCustom)
inclBuiltIn
- if true
, collection includes built-in stylesinclCustom
- if true
, collection includes custom stylespublic java.lang.String getName()
public boolean isRecognised(java.lang.String name)
name
can be identified as a style name.public boolean isTOC()
public boolean isHeading()
public java.lang.StringBuilder toShortString()
public java.lang.String toString()
toString
in class java.lang.Enum<Style>
Copyright 2009-2016 Tatjana (Tanja) Kostic