Package ro.sync.ecss.docbook
Class DocbookAccess
- java.lang.Object
-
- ro.sync.ecss.docbook.DocbookAccess
-
@API(type=NOT_EXTENDABLE, src=PRIVATE) public final class DocbookAccess extends java.lang.Object
Docbook access.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DOCBOOK_NS
Docbook namespace.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<CIAttribute>
annotateAttributes(java.util.List<CIAttribute> attributes)
Annotate a list of attributes.static ro.sync.ecss.docbook.DocBookImageInfo
chooseImageReference(AuthorAccess authorAccess)
Allows the user to choose an image reference, which will be inserted inside the document.static java.lang.String
chooseLocalLink(AuthorAccess authorAccess, boolean isXref, boolean isDocbook5)
Show a dialog to choose an id.static OLinkInfo
chooseOLink(AuthorAccess authorAccess)
Choose OLink.static java.lang.String
chooseURLForLink(AuthorAccess authorAccess, java.lang.String title)
Choose url for link.static void
editOLink(AuthorAccess authorAccess, java.lang.String namespace)
Edit OLink.static java.util.List<CIValue>
filterAttributeValues(java.util.List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, java.lang.String documentTypeName)
Propose additional attribute valuesstatic void
insertLocalLink(AuthorAccess authorAccess, boolean schemaAware)
Create and insert a local link element.static void
insertOLink(AuthorAccess authorAccess, java.lang.String namespace)
Insert OLink.static void
insertXInclude(AuthorAccess authorAccess)
Insert an XInclude fragment.static void
insertXRef(AuthorAccess authorAccess, boolean schemaAware)
Insert a xref element.static void
pasteContentAsLink(AuthorAccess authorAccess)
Paste clipboard content as <link> with @linkend attribute.static void
pasteContentAsXref(AuthorAccess authorAccess)
Paste clipboard content as <xref> with @linkend attribute.static java.net.URL
resolveCustomHrefToMasterFile(java.net.URL currentEditorURL, java.lang.String linkHref, AuthorAccess authorAccess)
Resolve an IDREF to a main file if possible.static void
setDocbookAccessCustomizer(ro.sync.ecss.docbook.DocbookAccessCustomizer accessCustomizer)
-
-
-
Field Detail
-
DOCBOOK_NS
public static final java.lang.String DOCBOOK_NS
Docbook namespace.- See Also:
- Constant Field Values
-
-
Method Detail
-
setDocbookAccessCustomizer
public static void setDocbookAccessCustomizer(ro.sync.ecss.docbook.DocbookAccessCustomizer accessCustomizer)
- Parameters:
accessCustomizer
- The accessCustomizer to set.
-
chooseOLink
public static OLinkInfo chooseOLink(AuthorAccess authorAccess)
Choose OLink. Public, maybe users want to customize what tag name to insert.- Parameters:
authorAccess
- The Author access.- Returns:
- The OLink information, or
null
if the user canceled the operation.
-
insertOLink
public static void insertOLink(AuthorAccess authorAccess, java.lang.String namespace) throws AuthorOperationException
Insert OLink.- Parameters:
authorAccess
- Author accessnamespace
- Namespace- Throws:
AuthorOperationException
-
editOLink
public static void editOLink(AuthorAccess authorAccess, java.lang.String namespace) throws AuthorOperationException, javax.swing.text.BadLocationException
Edit OLink.- Parameters:
authorAccess
- Author accessnamespace
- Namespace- Throws:
AuthorOperationException
javax.swing.text.BadLocationException
-
filterAttributeValues
public static java.util.List<CIValue> filterAttributeValues(java.util.List<CIValue> attributeValues, WhatPossibleValuesHasAttributeContext context, java.lang.String documentTypeName)
Propose additional attribute values- Parameters:
attributeValues
- The attribute valuescontext
- The contextdocumentTypeName
-- Returns:
- The enriched list
-
annotateAttributes
public static java.util.List<CIAttribute> annotateAttributes(java.util.List<CIAttribute> attributes)
Annotate a list of attributes.- Parameters:
attributes
- The attributes list.- Returns:
- The list of attributes with annotations.
-
insertXInclude
public static void insertXInclude(AuthorAccess authorAccess) throws AuthorOperationException
Insert an XInclude fragment.- Parameters:
authorAccess
- The author access.- Throws:
AuthorOperationException
-
insertLocalLink
public static void insertLocalLink(AuthorAccess authorAccess, boolean schemaAware) throws AuthorOperationException
Create and insert a local link element.- Parameters:
authorAccess
- The Author access.schemaAware
-true
to insert with schema aware,false
otherwise.- Throws:
AuthorOperationException
-
chooseLocalLink
public static java.lang.String chooseLocalLink(AuthorAccess authorAccess, boolean isXref, boolean isDocbook5)
Show a dialog to choose an id.- Parameters:
authorAccess
- The author access.isXref
- Iftrue
it will be inserted an xref element.isDocbook5
- Iftrue
the current file is Docbook 5.- Returns:
- The chosen id or
null
if the user canceled the dialog. - Since:
- 18
-
chooseURLForLink
public static java.lang.String chooseURLForLink(AuthorAccess authorAccess, java.lang.String title)
Choose url for link.- Parameters:
authorAccess
- The author access.title
- The dialog title.- Returns:
- The chosen url.
- Since:
- 18
-
insertXRef
public static void insertXRef(AuthorAccess authorAccess, boolean schemaAware) throws AuthorOperationException
Insert a xref element.- Parameters:
authorAccess
- The Author access.schemaAware
-true
to insert with schema aware,false
otherwise.- Throws:
AuthorOperationException
-
resolveCustomHrefToMasterFile
public static java.net.URL resolveCustomHrefToMasterFile(java.net.URL currentEditorURL, java.lang.String linkHref, AuthorAccess authorAccess)
Resolve an IDREF to a main file if possible.- Parameters:
currentEditorURL
- The current editor URLlinkHref
- The link hrefauthorAccess
- The author access- Returns:
- The resolved URL if any.
-
pasteContentAsLink
public static void pasteContentAsLink(AuthorAccess authorAccess)
Paste clipboard content as <link> with @linkend attribute.- Parameters:
authorAccess
- The author access.
-
pasteContentAsXref
public static void pasteContentAsXref(AuthorAccess authorAccess)
Paste clipboard content as <xref> with @linkend attribute.- Parameters:
authorAccess
- The author access.
-
chooseImageReference
public static ro.sync.ecss.docbook.DocBookImageInfo chooseImageReference(AuthorAccess authorAccess) throws AuthorOperationException
Allows the user to choose an image reference, which will be inserted inside the document.- Parameters:
authorAccess
- Access to the Author-specific functions.- Returns:
- An object containing all the properties for the image that will be inserted.
- Throws:
AuthorOperationException
- When the operation cannot be performed.
-
-