Eclipse Platform
Release 3.1

org.eclipse.jface.contentassist
Class ContentAssistInvocationContext

java.lang.Object
  extended byorg.eclipse.jface.contentassist.ContentAssistInvocationContext
Direct Known Subclasses:
TextContentAssistInvocationContext

public abstract class ContentAssistInvocationContext
extends Object

Describes the context of an invocation of content assist. For a text editor, the context would typically include the document (or the viewer) and the selection range, while source code editors may provide specific context information such as an AST.

An invocation context may also compute additional context information on demand and cache it to make it available to all ICompletionProposalComputers contributing proposals to one content assist invocation.

Clients may subclass but must be careful to adhere to the described equality contract.

XXX this API is provisional and may change anytime during the course of 3.2

Since:
3.2

Constructor Summary
ContentAssistInvocationContext()
           
 
Method Summary
 boolean equals(Object obj)
          Invocation contexts are equal if they describe the same context and are of the same type.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentAssistInvocationContext

public ContentAssistInvocationContext()
Method Detail

equals

public boolean equals(Object obj)
Invocation contexts are equal if they describe the same context and are of the same type. This implementation checks for null values and class equality. Subclasses should extend this method by adding checks for their context relevant fields (but not necessarily cached values).

Example:

 class MyContext extends ContentAssistInvocationContext {
 	private final Object fState;
 	private Object fCachedInfo;
 
 	...
 
 	public boolean equals(Object obb) {
 		if (!super.equals(obj))
 			return false;
 		MyContext other= (MyContext) obj;
 		return fState.equals(other.fState);
 	}
 }
 

Subclasses should also extend Object.hashCode().

Parameters:
obj -
Returns:

hashCode

public int hashCode()

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.