net.refractions.udig.issues
Interface IIssue

All Known Implementing Classes:
AbstractFixableIssue, AbstractIssue, FeatureIssue, FixableIssue

public interface IIssue

Specifies an issue that requires the user's input to be dealt with. One example is an invalid feature.

Since:
1.0.0
Author:
jones

Method Summary
 void addIssueListener(IIssueListener listener)
          Adds a IIssueListener to the issue.
 void fixIssue(IViewPart part, IEditorPart editor)
          This is called when the user wishes to fix the issue.
 ReferencedEnvelope getBounds()
          Returns the area that this issue affects.
 java.lang.String getDescription()
          Gets the description of the Issue.
 java.lang.String getEditorID()
          The id of the editor that will be opened to edit the Editor Input.
 IEditorInput getEditorInput()
          If returns not null the framework will attempt to open an editor that can edit the input object.
 java.lang.String getExtensionID()
          Returns the id of the extension definition for this type of Issue.
 java.lang.String getGroupId()
          The GroupID groups sets of Issues.
 java.lang.String getId()
          Returns the id of the issue.
 java.lang.String getPerspectiveID()
          If not null the framework will open the identified perspective.
 Priority getPriority()
          Returns the priority of the issue.
 java.lang.String getProblemObject()
          Returns A one or two word name for the object that has the issue.
 java.lang.Object getProperty(java.lang.String property)
          Gets a property of the issue.
 java.lang.String[] getPropertyNames()
          Returns an array of all the property names in the issue.
 Resolution getResolution()
          Indicates whether the issue has been resolved.
 void getViewMemento(IMemento memento)
          If the ViewPart identified by getViewPartID is a view and the IMemento returned by this method is non-null, the view will be initialized with the memento.
 java.lang.String getViewPartId()
          Returns the id of the ViewPart that the issue requires in order to be resolved.
 void init(IMemento memento, IMemento viewMemento, java.lang.String issueId, java.lang.String groupId, ReferencedEnvelope bounds)
          Called by framework to initialize the Issue.
 void removeIssueListener(IIssueListener listener)
          Removes a IIssueListener from the issue.
 void save(IMemento memento)
          Populates the memento with data specialized for the issues type.
 void setDescription(java.lang.String description)
          Sets the description of the issue.
 void setId(java.lang.String newId)
          Sets the id of the issue.
 void setPriority(Priority priority)
          Sets the priority of the issue.
 void setResolution(Resolution newResolution)
          Sets the state of resolution.
 

Method Detail

addIssueListener

void addIssueListener(IIssueListener listener)
Adds a IIssueListener to the issue. The IIssuesManager listens to the issue in order to know which issues need to be saved. If an implementation does not raise events when a property of the issue is changed and it does not call IIssuesManager.save(IProgressMonitor) then the change will not be saved.

Parameters:
listener - listener to add.

removeIssueListener

void removeIssueListener(IIssueListener listener)
Removes a IIssueListener from the issue.

Parameters:
listener - listener to remove.

getViewPartId

java.lang.String getViewPartId()
Returns the id of the ViewPart that the issue requires in order to be resolved. This is called by the issues view. If a non-null value is returned, the IssuesView will show the ViewPart identified by the id. Otherwise nothing is done.

Returns:
The id of the ViewPart the issue concerns.

getViewMemento

void getViewMemento(IMemento memento)
If the ViewPart identified by getViewPartID is a view and the IMemento returned by this method is non-null, the view will be initialized with the memento.


getEditorID

java.lang.String getEditorID()
The id of the editor that will be opened to edit the Editor Input. If the getEditorInput() does not return null and getEditorID() also does not then the editor will be opened by the framework (It does not need to be done in fixIssue() method).

Returns:
The id of the editor that will be opened to edit the Editor Input.

getEditorInput

IEditorInput getEditorInput()
If returns not null the framework will attempt to open an editor that can edit the input object.


getPerspectiveID

java.lang.String getPerspectiveID()
If not null the framework will open the identified perspective.

Returns:
id of a perspective to open. Or null.

getProblemObject

java.lang.String getProblemObject()
Returns A one or two word name for the object that has the issue. This should be translateable and understandable by a human.


getDescription

java.lang.String getDescription()
Gets the description of the Issue. Should be a single line and around one line. Should be translateable.

Returns:
the description of the Issue.

setDescription

void setDescription(java.lang.String description)
Sets the description of the issue.

Parameters:
description -

getPriority

Priority getPriority()
Returns the priority of the issue.

Returns:
the priority of the issue.

setPriority

void setPriority(Priority priority)
Sets the priority of the issue.


fixIssue

void fixIssue(IViewPart part,
              IEditorPart editor)
This is called when the user wishes to fix the issue. It will be called after the WorkbenchPath has been shown and set with the memento if it is a view.

This method can do other initializations and return or it can run the user through a workflow and only return when the problem is fixed or the user cancels the operation.

This method does NOT have to fix the issue

This method IS run in the display thread.

Parameters:
part - The workbenchpart identified by getViewPartId() or null.
editor - The editor that was identified by getEditorID() or null.
See Also:
FeatureIssue

getResolution

Resolution getResolution()
Indicates whether the issue has been resolved. This method MUST return quickly. If the resolution state cannot be determined quickly then either Resolution#UNKNOWN or Resolution#UNRESOLVED should be returned.

Returns:
true if the issue no longer exists.

setResolution

void setResolution(Resolution newResolution)
Sets the state of resolution.

Parameters:
newResolution - the new state.

getId

java.lang.String getId()
Returns the id of the issue.

Returns:
id of the issue.

setId

void setId(java.lang.String newId)
Sets the id of the issue. This should only be called by the Issues list never by client code.

Parameters:
newId -

getGroupId

java.lang.String getGroupId()
The GroupID groups sets of Issues. A potential use is to group Issues by analysis operation so that groups of Issues can be deleted/resolved/replaced as a group.


getProperty

java.lang.Object getProperty(java.lang.String property)
Gets a property of the issue. This allows the interface to be more flexible.

Parameters:
property - the name/key of the property

getPropertyNames

java.lang.String[] getPropertyNames()
Returns an array of all the property names in the issue. For correctness all the names should be able to passed to getProperty() without throwing an exception.

Returns:
an array of all the property names in the issue

init

void init(IMemento memento,
          IMemento viewMemento,
          java.lang.String issueId,
          java.lang.String groupId,
          ReferencedEnvelope bounds)
Called by framework to initialize the Issue.

Parameters:
memento - The saved state of a Issue. May be null.
viewMemento - the memento for initializing the view, may be null
issueId - the id the issue is assigned. getId() must return the same id.
groupId - the group id of the issue.
bounds - the bounds of the issue.

save

void save(IMemento memento)
Populates the memento with data specialized for the issues type. Most data (see below) is saved by the framework. Only data, such as properties, or other data required for executing fixIssue(IViewPart, IEditorPart) needs to be saved in the memento.

State that is saved by the framework and is not required to be saved in this memento include:

Parameters:
memento - the memento to populate with state data.

getExtensionID

java.lang.String getExtensionID()
Returns the id of the extension definition for this type of Issue. This is required so the framework can load the correct issue class during issue loading. If the class is can not be loaded then a Placeholder issue will be created instead which will notify the user that a plugin is required to manage the issue.

The extension id is formed by the namespace of the plugin combined with the name of the extension element.

For example: The FeatureIssue's extension id would be: net.refractions.udig.issues.featureIssue because the issue implementation is in the Issues plugin (which the id net.refractions.udig.issues) and the extension name is featureIssue. The two are combined to form the id of the extension


getBounds

ReferencedEnvelope getBounds()
Returns the area that this issue affects. May return null.

Returns:
Returns the area that this issue affects. May return null.