Package org.eclipse.ltk.core.refactoring
Class RefactoringStatusEntry
java.lang.Object
org.eclipse.ltk.core.refactoring.RefactoringStatusEntry
An immutable object representing an entry in the list in
RefactoringStatus
.
A refactoring status entry consists of a severity, a message, a problem code
(represented by a tuple(plug-in identifier and code number)), a context object and a
generic data pointer. The context object is used to provide context information for
the problem itself. An example context is a tuple consisting of the resource that contains
the problem and a corresponding line number.
Note: this class is not intended to be extended by clients.
- Since:
- 3.0
- Restriction:
- This class is not intended to be subclassed by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
A special problem code indicating that no problem code is provided. -
Constructor Summary
ConstructorDescriptionRefactoringStatusEntry
(int severity, String msg) Creates a new refactoring status entry.RefactoringStatusEntry
(int severity, String msg, RefactoringStatusContext context) Creates a new refactoring status entry.RefactoringStatusEntry
(int severity, String msg, RefactoringStatusContext context, String pluginId, int code) Creates a new refactoring status entry.RefactoringStatusEntry
(int severity, String msg, RefactoringStatusContext context, String pluginId, int code, Object data) Creates a new refactoring status entry. -
Method Summary
Modifier and TypeMethodDescriptionint
getCode()
Returns the problem code.Returns the context which can be used to show more detailed information regarding this status entry in the UI.getData()
Returns the application defined entry data associated with the receiver, ornull
if it has not been set.Returns the message of the status entry.Returns the plug-in identifier associated with the problem code.int
Returns the severity level.boolean
isError()
Returns whether the entry represents an error or not.boolean
Returns whether the entry represents a fatal error or not.boolean
isInfo()
Returns whether the entry represents an information or not.boolean
Returns whether the entry represents a warning or not.toStatus()
Returns this refactoring status entry as anIStatus
.toString()
-
Field Details
-
NO_CODE
public static final int NO_CODEA special problem code indicating that no problem code is provided. IfNO_CODE
is used then the plug-in identifier can benull
- See Also:
-
-
Constructor Details
-
RefactoringStatusEntry
Creates a new refactoring status entry. The context is set tonull
the problem code is set toNO_CODE
, the plug-in identifier is set tonull
and the data pointer is set tonull
as well.- Parameters:
severity
- the severitymsg
- the message
-
RefactoringStatusEntry
Creates a new refactoring status entry. The problem code is set toNO_CODE
, the plug-in identifier is set tonull
and the data pointer is set tonull
as well.- Parameters:
severity
- the severitymsg
- the messagecontext
- the context. Can benull
-
RefactoringStatusEntry
public RefactoringStatusEntry(int severity, String msg, RefactoringStatusContext context, String pluginId, int code) Creates a new refactoring status entry.- Parameters:
severity
- the severitymsg
- the messagecontext
- the context. Can benull
pluginId
- the plug-in identifier. Can benull
if argumentcode
equalsNO_CODE
code
- the problem code. Must be eitherNO_CODE
or equals or greater than zero
-
RefactoringStatusEntry
public RefactoringStatusEntry(int severity, String msg, RefactoringStatusContext context, String pluginId, int code, Object data) Creates a new refactoring status entry.- Parameters:
severity
- the severitymsg
- the messagecontext
- the context. Can benull
pluginId
- the plug-in identifier. Can benull
if argumentcode
equalsNO_CODE
code
- the problem code. Must be eitherNO_CODE
or a positive integerdata
- application specific data
-
-
Method Details
-
getMessage
Returns the message of the status entry.- Returns:
- the message
-
getSeverity
public int getSeverity()Returns the severity level.- Returns:
- the severity level
- See Also:
-
getContext
Returns the context which can be used to show more detailed information regarding this status entry in the UI. The method may returnnull
indicating that no context is available.- Returns:
- the status entry's context
-
getPluginId
Returns the plug-in identifier associated with the problem code. Might returnnull
if the problem code equalsNO_CODE
.- Returns:
- the plug-in identifier
-
getCode
public int getCode()Returns the problem code.- Returns:
- the problem code
-
getData
Returns the application defined entry data associated with the receiver, ornull
if it has not been set.- Returns:
- the entry data
-
isFatalError
public boolean isFatalError()Returns whether the entry represents a fatal error or not.- Returns:
true
if (severity ==RefactoringStatus.FATAL
)
-
isError
public boolean isError()Returns whether the entry represents an error or not.- Returns:
true
if (severity ==RefactoringStatus.ERROR
).
-
isWarning
public boolean isWarning()Returns whether the entry represents a warning or not.- Returns:
true
if (severity ==RefactoringStatus.WARNING
).
-
isInfo
public boolean isInfo()Returns whether the entry represents an information or not.- Returns:
true
if (severity ==RefactoringStatus.INFO
).
-
toStatus
Returns this refactoring status entry as anIStatus
.If this refactoring status entry has a severity of
RefactoringStatus.FATAL
, the returned status will have a severity ofIStatus.ERROR
, otherwise a status with severity corresponding to the refactoring status entry is returned. If the plugin id of this refactoring status entry is not defined, the plugin idorg.eclipse.ltk.core.refactoring
will be used in the returned status.- Returns:
- the corresponding status
- Since:
- 3.2
-
toString
-