@API(type=INTERNAL, src=PUBLIC) public class DefaultUniqueAttributesRecognizer extends java.lang.Object implements UniqueAttributesRecognizer, ClipboardFragmentProcessor
Modifier and Type | Field and Description |
---|---|
protected AuthorAccess |
authorAccess
The author access
|
protected java.lang.String |
idAttrQname
The ID attribute qname
|
Constructor and Description |
---|
DefaultUniqueAttributesRecognizer()
Default constructor.
|
DefaultUniqueAttributesRecognizer(java.lang.String idAttrQname)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
activated(AuthorAccess authorAccess)
Method called when the Author extension was activated.
|
void |
assignUniqueIDs(int startOffset,
int endOffset,
boolean forceGeneration)
Assigns unique IDs between a start and an end offset in the document.
|
boolean |
copyAttributeOnSplit(java.lang.String attrQName,
AuthorElement element)
Checks if the attribute specified by QName can be considered as a valid attribute to copy when
the element is split.
|
void |
deactivated(AuthorAccess authorAccess)
Method called when the Author extension was deactivated.
|
protected java.lang.String |
generateUniqueIDFor(java.lang.String idGenerationPattern,
AuthorElement element)
Generate an unique ID for an element
|
protected GenerateIDElementsInfo |
getDefaultOptions() |
protected java.lang.String |
getDefaultOptionsXMLResourceName()
Get the name of the XML resource from which to load the default options.
|
java.lang.String |
getDescription() |
protected java.lang.String |
getGenerateIDAttributeQName(AuthorElement element,
java.lang.String[] elemsWithAutoGeneration,
boolean forceGeneration) |
GenerateIDElementsInfo |
getGenerateIDElementsInfo() |
boolean |
isAutoIDGenerationActive() |
protected boolean |
preserveIDsWhenPastingBetweenResources(int fragmentPurpose)
Check if we should preserve IDs when pasting between resources.
|
void |
process(ClipboardFragmentInformation fragmentInformation)
Process a fragment in the clipboard before inserting it in the document.
|
protected java.lang.String idAttrQname
protected AuthorAccess authorAccess
public DefaultUniqueAttributesRecognizer()
public DefaultUniqueAttributesRecognizer(java.lang.String idAttrQname)
idAttrQname
- The ID attribute qnamepublic boolean copyAttributeOnSplit(java.lang.String attrQName, AuthorElement element)
UniqueAttributesProcessor
copyAttributeOnSplit
in interface UniqueAttributesProcessor
attrQName
- The attribute qualified name.element
- The element.true
if the attribute should be copied when Split is performed.UniqueAttributesProcessor.copyAttributeOnSplit(java.lang.String, ro.sync.ecss.extensions.api.node.AuthorElement)
public void activated(AuthorAccess authorAccess)
AuthorExtensionStateListener
AuthorMouseListener
or AuthorListener
can be added at this point.activated
in interface AuthorExtensionStateListener
authorAccess
- The AuthorAccess
of the Author page where the
listener was activated.AuthorExtensionStateListener.activated(ro.sync.ecss.extensions.api.AuthorAccess)
public void deactivated(AuthorAccess authorAccess)
AuthorExtensionStateListener
deactivated
in interface AuthorExtensionStateListener
authorAccess
- The AuthorAccess
of the Author page where the
listener was deactivated.AuthorExtensionStateListener.deactivated(ro.sync.ecss.extensions.api.AuthorAccess)
protected GenerateIDElementsInfo getDefaultOptions()
protected java.lang.String getDefaultOptionsXMLResourceName()
public boolean isAutoIDGenerationActive()
isAutoIDGenerationActive
in interface UniqueAttributesRecognizer
protected java.lang.String getGenerateIDAttributeQName(AuthorElement element, java.lang.String[] elemsWithAutoGeneration, boolean forceGeneration)
element
- The current element.elemsWithAutoGeneration
- The array of elements for which generation is activatedforceGeneration
- Force ID generation if there is no selection.protected java.lang.String generateUniqueIDFor(java.lang.String idGenerationPattern, AuthorElement element)
idGenerationPattern
- The pattern for id generation.element
- The elementpublic void assignUniqueIDs(int startOffset, int endOffset, boolean forceGeneration)
UniqueAttributesProcessor
assignUniqueIDs
in interface UniqueAttributesProcessor
startOffset
- Start offset.endOffset
- End offset.forceGeneration
- true
to generate ID even if the ID generation pattern list
does not match.UniqueAttributesProcessor.assignUniqueIDs(int, int, boolean)
public GenerateIDElementsInfo getGenerateIDElementsInfo()
public void process(ClipboardFragmentInformation fragmentInformation)
ClipboardFragmentProcessor
process
in interface ClipboardFragmentProcessor
fragmentInformation
- Information about a fragment in the clipboard.ClipboardFragmentProcessor.process(ro.sync.ecss.extensions.api.content.ClipboardFragmentInformation)
protected boolean preserveIDsWhenPastingBetweenResources(int fragmentPurpose)
fragmentPurpose
- The fragment purpose. On of the AuthorSchemaAwareEditingHandler
purposes.true
if we should preserve IDs when pasting between resources.
By default the base method returns true
.public java.lang.String getDescription()
getDescription
in interface Extension
Extension.getDescription()
© Copyright Syncro Soft SRL 2002 - 2022. All rights reserved.