R
- the implementation specific repository typeI
- the implementation specific issue typepublic interface IssueStatusProvider<R,I>
An implementation of this interface is not mandatory for a
NetBeans bugtracking plugin. The IssueStatusProvider.Status.SEEN
status is default for
all issues in such a case. Implement only in cases you want to reflect incoming or outgoing changes.
Also note that it is not to mandatory to honor all status values in a particular implementation - e.g. it is ok for a plugin to handle only the INCOMING_NEW, INCOMING_MODIFIED and SEEN values. In case that also outgoing changes are reflected then also CONFLICT should be taken in count.
Incoming changes:
Represented by the status values INCOMING_NEW or INCOMING_MODIFIED. In case
the implementation keeps track of changes the user haven't seen yet
(e.g. by opening the Issue UI) then it is also expected to provide the
relevant incoming status values.
Outgoing changes:
Represented by the status values OUTGOING_NEW or OUTGOING_MODIFIED. Typically each
particular issue editor UI is expected to provide a way to change an issue
and to submit those changes. In case the implementation keeps track of changes
made locally between more editing sessions, then it is also expected to provide the
relevant outgoing status values and implement the relevant methods in this interface
- e.g. getUnsubmittedIssue(I i)
, discardOutgoing(I i)
, submit(i I)
.
Even though the status value is entirely given by the particular implementation, the precedence of Status values is expected to be the following:
Issue state | Expected Status |
---|---|
no changes | SEEN |
only incoming changes | INCOMING_NEW or INCOMING_MODIFIED |
only outgoing changes | OUTGOING_NEW or OUTGOING_MODIFIED |
incoming and outgoing changes | CONFLICT |
Modifier and Type | Interface and Description |
---|---|
static class |
IssueStatusProvider.Status
Determines an Issue status.
|
Modifier and Type | Field and Description |
---|---|
static String |
EVENT_STATUS_CHANGED
Issue status has changed.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(I i,
PropertyChangeListener listener)
Unregisters a PropertyChangeListener.
|
void |
discardOutgoing(I i)
Discard outgoing local changes from the given issue.
|
IssueStatusProvider.Status |
getStatus(I i)
Get the Issue Status.
|
Collection<I> |
getUnsubmittedIssues(R r)
Returns unsubmitted issues from the given repository.
|
void |
removePropertyChangeListener(I i,
PropertyChangeListener listener)
Registers a PropertyChangeListener to notify about status changes for an issue.
|
void |
setSeenIncoming(I i,
boolean seen)
Sets the information if the user has seen the incoming changes or
wishes to mark them as seen (so that they aren't annotated anymore).
Called e.g. |
boolean |
submit(I i)
Submits outgoing local changes.
|
static final String EVENT_STATUS_CHANGED
Old value should be the status before the change, new value the Status after the change.
IssueStatusProvider.Status getStatus(I i)
i
- an implementation specific Issue instancevoid setSeenIncoming(I i, boolean seen)
The expected result of setting seen to true
:
Status before | Status after |
---|---|
SEEN | SEEN |
INCOMING_NEW or INCOMING_MODIFIED | SEEN |
OUTGOING_NEW or OUTGOING_MODIFIED | no effect |
CONFLICT | OUTGOING_NEW or OUTGOING_MODIFIED |
It is up the particular implementation if and for how long the information
about incoming changes will be preserved so that it can be restored after setting seen
back to false
. E.g. resulting to a status change from
SEEN to INCOMMING_XXX or from OUTGOING_XXX to CONFLICT. Please note that doing so
at least for a running IDE session would be considered as polite to the user.
Note that in case the implementation provides either IssueStatusProvider.Status.INCOMING_NEW
or
IssueStatusProvider.Status.INCOMING_MODIFIED
status values, this method may be called to either reset those
values to IssueStatusProvider.Status.SEEN
or set to set back the previous INCOMING_XXX status value.
i
- an implementation specific Issue instanceseen
- true
if the Issue was seen or set as seen by the userCollection<I> getUnsubmittedIssues(R r)
Note that this method is going to be called only for issue with IssueStatusProvider.Status
being either IssueStatusProvider.Status.OUTGOING_NEW
or
IssueStatusProvider.Status.OUTGOING_MODIFIED
.
r
- an implementation specific Repository instancevoid discardOutgoing(I i)
Note that this method is going to be called only for issue with IssueStatusProvider.Status
being either IssueStatusProvider.Status.OUTGOING_NEW
or
IssueStatusProvider.Status.OUTGOING_MODIFIED
.
i
- an implementation specific Issue instanceboolean submit(I i)
In case an error appears during execution, the implementation should take care of the error handling, user notification etc.
Note that this method is going to be called only for issue with IssueStatusProvider.Status
being either IssueStatusProvider.Status.OUTGOING_NEW
or
IssueStatusProvider.Status.OUTGOING_MODIFIED
.
i
- an implementation specific Issue instancetrue
if the task was successfully
submitted,false
if the task was not submitted for any
reason.void removePropertyChangeListener(I i, PropertyChangeListener listener)
i
- an implementation specific Issue instancelistener
- a PropertyChangeListenervoid addPropertyChangeListener(I i, PropertyChangeListener listener)
i
- an implementation specific Issue instancelistener
- a PropertyChangeListener