|
Eclipse JDT Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.core.CompletionRequestor
Abstract base class for a completion requestor which is passed completion proposals as they are generated in response to a code assist request.
This class is intended to be subclassed by clients.
The code assist engine normally invokes methods on completion requestors in the following sequence:
requestor.beginReporting(); requestor.acceptContext(context); requestor.accept(proposal_1); requestor.accept(proposal_2); ... requestor.endReporting();If, however, the engine is unable to offer completion proposals for whatever reason,
completionFailure
is called
with a problem object describing why completions were unavailable.
In this case, the sequence of calls is:
requestor.beginReporting(); requestor.acceptContext(context); requestor.completionFailure(problem); requestor.endReporting();In either case, the bracketing
beginReporting
endReporting
calls are always made as well as
acceptContext
call.
The class was introduced in 3.0 as a more evolvable replacement
for the ICompletionRequestor
interface.
ICodeAssist
Constructor Summary | |
---|---|
CompletionRequestor()
Creates a new completion requestor. |
Method Summary | |
---|---|
abstract void |
accept(CompletionProposal proposal)
Proposes a completion. |
void |
acceptContext(CompletionContext context)
Propose the context in which the completion occurs. |
void |
beginReporting()
Pro forma notification sent before reporting a batch of completion proposals. |
void |
completionFailure(IProblem problem)
Notification of failure to produce any completions. |
void |
endReporting()
Pro forma notification sent after reporting a batch of completion proposals. |
boolean |
isIgnored(int completionProposalKind)
Returns whether the given kind of completion proposal is ignored. |
void |
setIgnored(int completionProposalKind,
boolean ignore)
Sets whether the given kind of completion proposal is ignored. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CompletionRequestor()
Method Detail |
public final boolean isIgnored(int completionProposalKind)
completionProposalKind
- one of the kind constants declared
on CompletionProposal
true
if the given kind of completion proposal
is ignored by this requestor, and false
if it is of
interestsetIgnored(int, boolean)
,
CompletionProposal.getKind()
public final void setIgnored(int completionProposalKind, boolean ignore)
completionProposalKind
- one of the kind constants declared
on CompletionProposal
ignore
- true
if the given kind of completion proposal
is ignored by this requestor, and false
if it is of
interestisIgnored(int)
,
CompletionProposal.getKind()
public void beginReporting()
The default implementation of this method does nothing. Clients may override.
public void endReporting()
The default implementation of this method does nothing. Clients may override.
public void completionFailure(IProblem problem)
The default implementation of this method does nothing. Clients may override to receive this kind of notice.
problem
- the problem objectpublic abstract void accept(CompletionProposal proposal)
isIgnored(int)
before avoid creating proposal
objects that would only be ignored.
Similarly, implementers should check
isIgnored(proposal.getKind())
and ignore proposals that have been declared as uninteresting.
The proposal object passed is only valid for the duration of
completion operation.
proposal
- the completion proposal
IllegalArgumentException
- if the proposal is nullpublic void acceptContext(CompletionContext context)
This method is called one and only one time before any call to
accept(CompletionProposal)
.
The default implementation of this method does nothing.
Clients may override.
context
- the completion context
|
Eclipse JDT Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |