g-Eclipse
Release 1.0.0

eu.geclipse.core.reporting
Interface IProblem


public interface IProblem

Definition of a problem that may be appended to a ProblemException. Problems are defined by a description, zero or more reasons and zero or more solutions. The description is just a text that gives a more or less detailed description of the problem. The reasons are a list of strings that may give hints about the reasons of the problem. The solutions are instances of ISolution and may assist the user by solving this problem. Problems may either be defined programmatically or via the eu.geclipse.core.reporting.problemReporting extension point.


Method Summary
 void addReason(java.lang.String reason)
          Add a new reason to this problem.
 void addSolution(ISolution solution)
          Add a new solution to this problem.
 void addSolution(java.lang.String solutionID, java.lang.String description)
          Add a new solution to this problem.
 java.lang.String getDescription()
          Get the descriptive text that gives a more or less detailed explanation about this problem.
 java.lang.Throwable getException()
          Get an exception that may be the reason for this problem.
 java.lang.String getID()
          Get the ID of this problem.
 java.lang.String getMailTo()
          Get the mailing-address as specified in the mailto-field of the problem extension point.
 java.lang.String getPluginID()
          Get the ID of the plug-in where the problem happened.
 java.lang.String[] getReasons()
          Get a list of all reasons that may give further hints about the nature of this problems.
 ISolution[] getSolutions()
          Get all solutions that are associated to this problem.
 IStatus getStatus()
          Get an IStatus-object created from this problem.
 boolean hasReasons()
          Determines if this problem has associated reasons.
 boolean hasSolutions()
          Determines if this problem has associated solutions.
 void merge(IProblem problem)
          Merge the specified problem with this problem.
 

Method Detail

addReason

void addReason(java.lang.String reason)
Add a new reason to this problem. Different implementation layers may be aware of different reasons for a specific problem. Therefore each layer may add additional reasons to a given problem.

Parameters:
reason - A short text giving a further reason for this problem.

addSolution

void addSolution(ISolution solution)
Add a new solution to this problem. Different implementation layers may be aware of different solutions for a specific problem. Therefore each layer may add additional solutions to a given problem.

Parameters:
solution - A solution that will be added to this problem.

addSolution

void addSolution(java.lang.String solutionID,
                 java.lang.String description)
Add a new solution to this problem. Different implementation layers may be aware of different solutions for a specific problem. Therefore each layer may add additional solutions to a given problem.

Parameters:
solutionID - The unique ID of the solution that will be added to this problem.
description - An optional alternative description for the solution. If this is null the solution's default description will be taken.

getDescription

java.lang.String getDescription()
Get the descriptive text that gives a more or less detailed explanation about this problem.

Returns:
The description of this problem.

getException

java.lang.Throwable getException()
Get an exception that may be the reason for this problem.

Returns:
A Throwable or null if this problem was not caused by one.

getID

java.lang.String getID()
Get the ID of this problem.

Returns:
The problem's ID.

getMailTo

java.lang.String getMailTo()
Get the mailing-address as specified in the mailto-field of the problem extension point.

Returns:
The mailing address where this problem should be reported or null if no such mailing address is specified for this problem.

getPluginID

java.lang.String getPluginID()
Get the ID of the plug-in where the problem happened.

Returns:
The plug-in's ID.

getReasons

java.lang.String[] getReasons()
Get a list of all reasons that may give further hints about the nature of this problems.

Returns:
A list of all currently available reasons for this problem or an empty array if no reasons are available.

getSolutions

ISolution[] getSolutions()
Get all solutions that are associated to this problem.

Returns:
A list of all currently available solutions for this problem or an empty array if no solutions are available.

getStatus

IStatus getStatus()
Get an IStatus-object created from this problem. This object represents the connection to the CoreException-mechanism.

Returns:
An IStatus-object that is created on the fly an represents the state of this problem at creation time. Notice that the state may change due to calls to addReason(String) and addSolution(ISolution).

hasReasons

boolean hasReasons()
Determines if this problem has associated reasons.

Returns:
True if the problem contains at least one reason.

hasSolutions

boolean hasSolutions()
Determines if this problem has associated solutions.

Returns:
True if the problem contains at least one solution.

merge

void merge(IProblem problem)
Merge the specified problem with this problem. Both the description and the reasons of the specified problem are added as reasons to this problem if they are not already existent. Additionally the solutions are added to this problem.

Parameters:
problem - The problem to incorporate into this problem.

g-Eclipse
Release 1.0.0