X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/CompletionRequestor.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/CompletionRequestor.java index 2195c82..735d867 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/CompletionRequestor.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/CompletionRequestor.java @@ -19,30 +19,35 @@ import net.sourceforge.phpdt.core.compiler.IProblem; * This class is intended to be subclassed by clients. *
*- * The code assist engine normally invokes methods on completion - * requestors in the following sequence: + * The code assist engine normally invokes methods on completion requestors in + * the following sequence: + * *
- * requestor.beginReporting(); - * requestor.accept(proposal_1); - * requestor.accept(proposal_2); - * ... - * requestor.endReporting(); + * requestor.beginReporting(); + * 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:
+ *
+ * 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.completionFailure(problem); * requestor.endReporting(); *+ * * In either case, the bracketing
beginReporting
- * endReporting
calls are always made.
+ * endReporting
+ * calls are always made.
*
*
- * The class was introduced in 3.0 as a more evolvable replacement
- * for the ICompletionRequestor
interface.
+ * The class was introduced in 3.0 as a more evolvable replacement for the
+ * ICompletionRequestor
interface.
*
0
means the set is empty.
- * 1 << completionProposalKind
+ * The set of CompletionProposal kinds that this requestor ignores;
+ * 0
means the set is empty. 1 << completionProposalKind
*/
private int ignoreSet = 0;
/**
- * Creates a new completion requestor.
- * The requestor is interested in all kinds of completion
- * proposals; none will be ignored.
+ * Creates a new completion requestor. The requestor is interested in all
+ * kinds of completion proposals; none will be ignored.
*/
public CompletionRequestor() {
// do nothing
@@ -69,37 +72,40 @@ public abstract class CompletionRequestor {
/**
* Returns whether the given kind of completion proposal is ignored.
*
- * @param completionProposalKind one of the kind constants declared
- * on CompletionProposal
- * @return true
if the given kind of completion proposal
- * is ignored by this requestor, and false
if it is of
- * interest
+ * @param completionProposalKind
+ * one of the kind constants declared on
+ * CompletionProposal
+ * @return true
if the given kind of completion proposal is
+ * ignored by this requestor, and false
if it is of
+ * interest
* @see #setIgnored(int, boolean)
* @see CompletionProposal#getKind()
*/
public final boolean isIgnored(int completionProposalKind) {
if (completionProposalKind < CompletionProposal.ANONYMOUS_CLASS_DECLARATION
- || completionProposalKind > CompletionProposal.VARIABLE_DECLARATION) {
- throw new IllegalArgumentException();
+ || completionProposalKind > CompletionProposal.VARIABLE_DECLARATION) {
+ throw new IllegalArgumentException();
}
return 0 != (this.ignoreSet & (1 << completionProposalKind));
}
-
+
/**
* Sets whether the given kind of completion proposal is ignored.
*
- * @param completionProposalKind one of the kind constants declared
- * on CompletionProposal
- * @param ignore true
if the given kind of completion proposal
- * is ignored by this requestor, and false
if it is of
- * interest
+ * @param completionProposalKind
+ * one of the kind constants declared on
+ * CompletionProposal
+ * @param ignore
+ * true
if the given kind of completion proposal
+ * is ignored by this requestor, and false
if it
+ * is of interest
* @see #isIgnored(int)
* @see CompletionProposal#getKind()
*/
public final void setIgnored(int completionProposalKind, boolean ignore) {
if (completionProposalKind < CompletionProposal.ANONYMOUS_CLASS_DECLARATION
- || completionProposalKind > CompletionProposal.VARIABLE_DECLARATION) {
- throw new IllegalArgumentException();
+ || completionProposalKind > CompletionProposal.VARIABLE_DECLARATION) {
+ throw new IllegalArgumentException();
}
if (ignore) {
this.ignoreSet |= (1 << completionProposalKind);
@@ -107,13 +113,13 @@ public abstract class CompletionRequestor {
this.ignoreSet &= ~(1 << completionProposalKind);
}
}
-
+
/**
- * Pro forma notification sent before reporting a batch of
- * completion proposals.
+ * Pro forma notification sent before reporting a batch of completion
+ * proposals.
* - * The default implementation of this method does nothing. - * Clients may override. + * The default implementation of this method does nothing. Clients may + * override. *
*/ public void beginReporting() { @@ -121,11 +127,11 @@ public abstract class CompletionRequestor { } /** - * Pro forma notification sent after reporting a batch of - * completion proposals. + * Pro forma notification sent after reporting a batch of completion + * proposals. *- * The default implementation of this method does nothing. - * Clients may override. + * The default implementation of this method does nothing. Clients may + * override. *
*/ public void endReporting() { @@ -133,33 +139,36 @@ public abstract class CompletionRequestor { } /** - * Notification of failure to produce any completions. - * The problem object explains what prevented completing. + * Notification of failure to produce any completions. The problem object + * explains what prevented completing. *- * The default implementation of this method does nothing. - * Clients may override to receive this kind of notice. + * The default implementation of this method does nothing. Clients may + * override to receive this kind of notice. *
* - * @param problem the problem object + * @param problem + * the problem object */ public void completionFailure(IProblem problem) { // default behavior is to ignore } /** - * Proposes a completion. Has no effect if the kind of proposal - * is being ignored by this requestor. Callers should consider - * checking {@link #isIgnored(int)} before avoid creating proposal - * objects that would only be ignored. + * Proposes a completion. Has no effect if the kind of proposal is being + * ignored by this requestor. Callers should consider checking + * {@link #isIgnored(int)} before avoid creating proposal objects that would + * only be ignored. *- * Similarly, implementers should check - * {@link #isIgnored(int) isIgnored(proposal.getKind())} - * and ignore proposals that have been declared as uninteresting. - * The proposal object passed in only valid for the duration of - * this call; implementors must not hang on to these objects. + * Similarly, implementers should check + * {@link #isIgnored(int) isIgnored(proposal.getKind())} and ignore + * proposals that have been declared as uninteresting. The proposal object + * passed in only valid for the duration of this call; implementors must not + * hang on to these objects. * - * @param proposal the completion proposal - * @exception IllegalArgumentException if the proposal is null + * @param proposal + * the completion proposal + * @exception IllegalArgumentException + * if the proposal is null */ public abstract void accept(CompletionProposal proposal); }