@API(type=EXTENDABLE,
src=PUBLIC)
public class DocumentPositionedInfo
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MESSAGE_CSS_STYLE
The message CSS style.
|
static int |
NOT_KNOWN
If one of the components is not known, use this constant for it.
|
static int |
SEVERITY_ERROR
Error message.
|
static int |
SEVERITY_FATAL
Fatal error message.
|
static int |
SEVERITY_INFO
Information message.
|
static int |
SEVERITY_WARN
Warning message.
|
Constructor and Description |
---|
DocumentPositionedInfo(int offset)
Constructor for a DPI used only to hold the current position in the editor.
|
DocumentPositionedInfo(int severity,
ro.sync.document.MessageProvider messageProvider,
java.lang.String systemID,
int line,
int column,
int endLine,
int endColumn,
int length,
int offset,
java.net.URL additionalInfo,
boolean highlightToColumn)
Constructor.
|
DocumentPositionedInfo(int severity,
java.lang.String message)
Constructor.
|
DocumentPositionedInfo(int severity,
java.lang.String message,
java.lang.String systemID)
Constructor.
|
DocumentPositionedInfo(int severity,
java.lang.String message,
java.lang.String systemID,
int line,
int column)
Constructor.
|
DocumentPositionedInfo(int severity,
java.lang.String message,
java.lang.String systemID,
int line,
int column,
int length)
Constructor.
|
DocumentPositionedInfo(int severity,
java.lang.String message,
java.lang.String systemID,
int line,
int column,
int length,
int offset,
java.net.URL additionalInfo,
boolean highlightToColumn)
Constructor.
|
DocumentPositionedInfo(java.net.URL url)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asHTML()
Build the HTML representation of this DPI.
|
java.lang.String |
asHTML(boolean includeSeverity,
boolean includeAdditionalInfo,
boolean includeDescription,
boolean includeSystemID,
boolean includeLocation,
boolean includeOperationDescription)
Build the HTML representation of this DPI.
|
java.lang.String |
asText()
Build the text representation of this DPI.
|
java.lang.String |
asText(boolean includeSeverity,
boolean includeAdditionalInfo,
boolean includeDescription,
boolean includeSystemID,
boolean includeLocation,
boolean includeOperationDescription)
Build the text representation of this DPI.
|
java.lang.String |
asXML()
Build the XML representation of this DPI.
|
java.lang.String |
asXML(boolean includeSeverity,
boolean includeAdditionalInfo,
boolean includeDescription,
boolean includeSystemID,
boolean includeLocation,
boolean includeOperationDescription)
Build the XML representation of this DPI.
|
boolean |
equals(java.lang.Object obj)
Indicates whether some other document positioned information is "equal to" this one.
|
static int |
flipSeverity(int severityToFlip)
Used to obtain the severity level to be used when sorting the DPIs by severity.
|
protected java.lang.String |
getAdditionalHtmlContent()
Return the additional HTML content, if any.
|
java.net.URL |
getAdditionalInfo()
The URL for additional information if available.
|
ro.sync.exml.editor.Anchor |
getAnchor()
Get the error anchor if any.
|
int |
getColumn()
Gets the column of the event.
|
ro.sync.document.DPIData |
getData()
Getter for the user managed data.
|
ro.sync.document.DITAAdditionalInfo |
getDITAAdditionalInfo()
Additional info about DITA completeness check.
|
ro.sync.document.ECAdditionalInfo |
getECAdditionalInfo()
Additional info for Eclipse inner usage.
|
int |
getEndColumn()
Get the highlight end column, or NOT_KNOWN if not available.
|
int |
getEndLine()
Get the highlight end line, or NOT_KNOWN if not available.
|
java.lang.String |
getEngineName()
Get the name of the engine who provided the error.
|
java.lang.String |
getErrorKey()
Get the error key.
|
java.lang.String |
getHTMLMessage()
Gets the HTML fragment to be presented when the message is displayed as HTML.
|
java.lang.String |
getImposedInitialPage()
Get the imposed initial page if a new editor will be opened.
|
int |
getLength()
Gets the length of the text that will be selected in the editor.
|
int |
getLine()
Gets the line attribute of the event
|
int[] |
getMatchRange()
Get the match range if any.
|
java.lang.String |
getMessage()
Gets the message
|
int |
getMessageHighlightOffset()
Return the offset used to highlight the match inside the message in the results panel.
|
ro.sync.document.MessageProvider |
getMessageProvider()
The provider of messages from the current document position info.
|
java.lang.String |
getMessageWithEngine()
Gets the message prepended with the engine name if available.
|
java.lang.String |
getMessageWithSeverity()
Get the message with severity info as a char in the front of the message (W, E, F).
|
java.lang.String |
getMessageWithSeverity(boolean includeEngineInformation)
Get the message with severity info as a char in the front of the message (W, E, F).
|
int |
getOffset()
Get the event's offset.
|
ro.sync.document.OperationDescription |
getOperationDescription()
The description of an operation (that is an operation which is applied over multiple resources)
that generated this DPI.
|
java.lang.String |
getPreferredEngineName()
Get the preferred engine name who provided the error.
|
int |
getSeverity()
Gets the severity level.
|
java.lang.String |
getSeverityAsString()
Gets the severity level as string
|
javax.swing.text.Position[] |
getStartEndPositions(java.lang.String pageId)
Get the temporary start and end positions for the current page.
|
java.lang.String |
getSystemID()
Gets the systemID attribute of the DocumentPositionedInfo object
|
int |
hashCode()
Compute unique hash code for this object.
|
boolean |
isElementTarget()
Return
true if this DPI targets an XML element. |
boolean |
isHighlightToColumn()
Check if the highlight must be made from column 0 to the specified column.
|
void |
setAdditionalInfo(java.net.URL url)
Set the additional information URL if available.
|
void |
setAnchor(ro.sync.exml.editor.Anchor anchor)
Set the error anchor.
|
void |
setColumn(int column)
Sets the column of the event, or
NOT_KNOWN if the column is not available. |
void |
setData(ro.sync.document.DPIData data)
Setter for the user managed data.
|
void |
setDITAAdditionalInfo(ro.sync.document.DITAAdditionalInfo additionalInfo)
Additional info about DITA completeness check.
|
void |
setECAdditionalInfo(ro.sync.document.ECAdditionalInfo additionalInfo)
Additional info for Eclipse inner usage.
|
void |
setElementTarget(boolean isElementTarget)
Set
true if this DPI targets an XML element. |
void |
setEndColumn(int endColumn)
Sets the end column of the highlight.
|
void |
setEndLine(int endLine)
Sets the end line of the highlight.
|
void |
setEngineName(java.lang.String engineName)
Set the name of the engine who provided the error.
|
void |
setErrorKey(java.lang.String errorKey)
The error validation key.
|
void |
setHighlightToColumn(boolean how)
Set highlight strategy for the document positioned information visual presentation.
|
void |
setHtmlMessageFragment(java.lang.String htmlMessageFragment)
Set a special HTML fragment which needs to be presented instead of the message when the DPI is serialized to HTML.
|
void |
setImposedInitialPage(java.lang.String imposedInitialPage)
Set the imposed initial page in which to open the DPI for a new editor.
|
void |
setLength(int length)
Sets the length of the selected text.
|
void |
setLine(int line)
Sets the line of the event, or
NOT_KNOWN if the line is not available. |
void |
setMaskPasswordsInURLs(boolean maskPasswordsInURLs)
Set mask passwords in URLs,
true by default. |
void |
setMatchRange(int[] matchRange)
Set the match range.
|
void |
setMessage(java.lang.String message)
Sets the message.
|
void |
setMessageHighlightOffset(int messageHighlightOffset)
Set the offset used to highlight the match inside the message in the results panel.
|
void |
setOffset(int offset)
Sets the event's offset.
|
void |
setOperationDescription(ro.sync.document.OperationDescription operationDescription)
Sets the description of an operation (that is an operation which is applied over multiple resources)
that generated this DPI.
|
void |
setSeverity(int severity)
Sets the error severity.
|
void |
setSystemID(java.lang.String systemID)
Sets the systemID of the event.
|
void |
setTemporaryPositions(javax.swing.text.Position startPosition,
javax.swing.text.Position endPosition,
java.lang.String pageId)
Set the temporary start and end positions used for keeping the DPI synchronized with the
highlight range from the page.
|
java.lang.String |
toString()
Gets the string representation.
|
public static final int SEVERITY_INFO
public static final int SEVERITY_WARN
public static final int SEVERITY_ERROR
public static final int SEVERITY_FATAL
public static final int NOT_KNOWN
public static java.lang.String MESSAGE_CSS_STYLE
public DocumentPositionedInfo(int offset)
offset
- Start of selection.public DocumentPositionedInfo(int severity, java.lang.String message, java.lang.String systemID, int line, int column, int length)
severity
- the severity level of the message.message
- the error message.systemID
- the system ID.line
- the line on which the error occurred in the document.column
- the column on which the error occurred.length
- the length of the text to be selected.public DocumentPositionedInfo(int severity, java.lang.String message, java.lang.String systemID, int line, int column, int length, int offset, java.net.URL additionalInfo, boolean highlightToColumn)
severity
- the severity level of the message.message
- the error message.systemID
- the system ID.line
- the line on which the error occurred in the document.column
- the column on which the error occurred.length
- the length of the text to be selected.offset
- the offset in the documentadditionalInfo
- the URL from which the user can retrieve additional info about the error.highlightToColumn
- true if the opener must highlight the entire text from the 1 column to
the column number. This is useful in case of error checks, like validations or well-formed.public DocumentPositionedInfo(int severity, ro.sync.document.MessageProvider messageProvider, java.lang.String systemID, int line, int column, int endLine, int endColumn, int length, int offset, java.net.URL additionalInfo, boolean highlightToColumn)
severity
- the severity level of the message.messageProvider
- the error message provider.systemID
- the system ID.line
- the line on which the error occurred in the document.column
- the column on which the error occurred.endLine
- the highlighted text must end in this line.endColumn
- the highlighted text must end in this column.length
- the length of the text to be selected.offset
- the offset in the documentadditionalInfo
- the URL from which the user can retrieve additional info about the error.highlightToColumn
- true if the opener must highlight the entire text from the 1 column to
the column number. This is useful in case of error checks, like validations or well-formed.public DocumentPositionedInfo(int severity, java.lang.String message, java.lang.String systemID, int line, int column)
severity
- the severity level of the message.message
- the error message.systemID
- the system ID.line
- the line on which the error occurred in the document.column
- the column on which the error occurred.public DocumentPositionedInfo(int severity, java.lang.String message, java.lang.String systemID)
severity
- the severity level of the message.message
- the error message.systemID
- the system ID.public DocumentPositionedInfo(int severity, java.lang.String message)
severity
- the severity level of the message.message
- the error message.public DocumentPositionedInfo(java.net.URL url)
line
and column
parameters in the URL fragment.url
- The URL to open in the editor.public static int flipSeverity(int severityToFlip)
SEVERITY_FATAL
to be
the small value and the SEVERITY_INFO
the big value.severityToFlip
- The severity of a DPI to be translated into natural ordering.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public void setSeverity(int severity)
severity
- The new severity value. One of: SEVERITY_INFO, SEVERITY_WARN, SEVERITY_ERROR
or SEVERITY_FATALpublic void setColumn(int column)
NOT_KNOWN
if the column is not available.column
- The columnpublic void setLine(int line)
NOT_KNOWN
if the line is not available.line
- The new line value, 1 based.public void setMessage(java.lang.String message)
message
- The new messagepublic void setMaskPasswordsInURLs(boolean maskPasswordsInURLs)
true
by default.maskPasswordsInURLs
- true
to mask passwords in URLs which are part of the message.public void setLength(int length)
length
- The length of the selected text.public void setSystemID(java.lang.String systemID)
systemID
- The new systemID valuepublic int getLength()
public int getColumn()
public int getSeverity()
public java.lang.String getSeverityAsString()
public int getLine()
public java.lang.String getMessage()
public java.lang.String getHTMLMessage()
null
if there is no HTML flavor.public ro.sync.document.MessageProvider getMessageProvider()
public java.lang.String getMessageWithEngine()
public java.lang.String getMessageWithSeverity()
public java.lang.String getMessageWithSeverity(boolean includeEngineInformation)
includeEngineInformation
- true
to include engine name.public java.lang.String getSystemID()
public void setOffset(int offset)
offset
- the new offset.public int getOffset()
public java.lang.String toString()
toString
in class java.lang.Object
public java.net.URL getAdditionalInfo()
null
.public void setAdditionalInfo(java.net.URL url)
url
- The URL at which the user can find additional information.public boolean isHighlightToColumn()
public void setHighlightToColumn(boolean how)
how
- true
if the visual part should highlight from column 0 to specified column
false
otherwise.public int getEndColumn()
public int getEndLine()
public void setEndLine(int endLine)
endLine
- The end line of the highlight.public void setEndColumn(int endColumn)
endColumn
- The end column of the highlight.public void setData(ro.sync.document.DPIData data)
data
- The user managed data.public ro.sync.document.DPIData getData()
public void setEngineName(java.lang.String engineName)
engineName
- The source engine name who provided the error.public java.lang.String getEngineName()
null
if no was engine set.public java.lang.String getPreferredEngineName()
public java.lang.String asXML()
public java.lang.String asXML(boolean includeSeverity, boolean includeAdditionalInfo, boolean includeDescription, boolean includeSystemID, boolean includeLocation, boolean includeOperationDescription)
includeSeverity
- true
if severity details should be included.includeAdditionalInfo
- true
if additional info details should be included.includeDescription
- true
if description details should be included.includeSystemID
- true
if system ID details should be included.includeLocation
- true
if location details should be included.includeOperationDescription
- true
if operation description details should be included.public java.lang.String asText()
public java.lang.String asText(boolean includeSeverity, boolean includeAdditionalInfo, boolean includeDescription, boolean includeSystemID, boolean includeLocation, boolean includeOperationDescription)
includeSeverity
- true
if severity details should be included.includeAdditionalInfo
- true
if additional info details should be included.includeDescription
- true
if description details should be included.includeSystemID
- true
if system ID details should be included.includeLocation
- true
if location details should be included.includeOperationDescription
- true
if operation description details should be included.public java.lang.String getImposedInitialPage()
public void setImposedInitialPage(java.lang.String imposedInitialPage)
imposedInitialPage
- The imposed initial page.public ro.sync.exml.editor.Anchor getAnchor()
public void setAnchor(ro.sync.exml.editor.Anchor anchor)
anchor
- The anchor to set.public int[] getMatchRange()
public void setMatchRange(int[] matchRange)
matchRange
- The match range.public int getMessageHighlightOffset()
public void setMessageHighlightOffset(int messageHighlightOffset)
messageHighlightOffset
- The offset to be set.public void setOperationDescription(ro.sync.document.OperationDescription operationDescription)
null
.operationDescription
- the description of an operation
(that is an operation which is applied over multiple resources)
that generated this DPI. Can be null
.public ro.sync.document.OperationDescription getOperationDescription()
null
.null
.public ro.sync.document.DITAAdditionalInfo getDITAAdditionalInfo()
public void setDITAAdditionalInfo(ro.sync.document.DITAAdditionalInfo additionalInfo)
additionalInfo
- Additional info about DITA completeness check.public ro.sync.document.ECAdditionalInfo getECAdditionalInfo()
public void setECAdditionalInfo(ro.sync.document.ECAdditionalInfo additionalInfo)
additionalInfo
- Additional info for Elipse inner usage.public void setTemporaryPositions(javax.swing.text.Position startPosition, javax.swing.text.Position endPosition, java.lang.String pageId)
startPosition
- The start position.endPosition
- The end position.pageId
- The id of the page for which the positions were created,
one of EditorPageConstants
constants.public javax.swing.text.Position[] getStartEndPositions(java.lang.String pageId)
pageId
- The id of the page for which we want the positions,
one of EditorPageConstants
constants.null
if the page is closed, or the DPI is not synchronized with
the modifications from editor.public java.lang.String asHTML()
public java.lang.String asHTML(boolean includeSeverity, boolean includeAdditionalInfo, boolean includeDescription, boolean includeSystemID, boolean includeLocation, boolean includeOperationDescription)
includeSeverity
- true
if severity details should be included.includeAdditionalInfo
- true
if additional info details should be included.includeDescription
- true
if description details should be included.includeSystemID
- true
if system ID details should be included.includeLocation
- true
if location details should be included.includeOperationDescription
- true
if operation description details should be included.protected java.lang.String getAdditionalHtmlContent()
public void setHtmlMessageFragment(java.lang.String htmlMessageFragment)
htmlMessageFragment
- The fragment to set.public void setErrorKey(java.lang.String errorKey)
errorKey
- The error key.public java.lang.String getErrorKey()
public boolean isElementTarget()
true
if this DPI targets an XML element.true
if this DPI targets an XML element.public void setElementTarget(boolean isElementTarget)
true
if this DPI targets an XML element.isElementTarget
- true
if this DPI targets an XML element.© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.