Methods


matchesForPrefixString:newPrefixString:basePath:
The basic method for returning possible completions.
fullStringForPrefixString:completionString:isInitialPrefixMatch:basePath:
Method for composing a prefix and a completion.

fullStringForPrefixString:completionString:isInitialPrefixMatch:basePath:

Method for composing a prefix and a completion.
- ( NSString *) fullStringForPrefixString:
        (NSString *) prefixStr completionString:
        (NSString *) completionStr isInitialPrefixMatch:
        (BOOL ) initialPrefixMatch basePath:
        (NSString *) basePath;

This method is responsible for creating the full string given a prefix string and a completion. The default implementation simply appends the completion string to the prefix string. Subclasses can override to do trickier kinds of combining.

Parameter Descriptions
prefixStr
The prefix string.
completionStr
The completion string (this is always one of the strings returned from a previous call to -matchesForPrefixString:newPrefixString:basePath:).
initialPrefixMatch
This is YES if the composition is being done on the prefix and the longest common prefix of all the possible completions. It is NO otherwise. Some subclasses may alter their behavior based on this information.
basePath
In general user-defined info passed in to MOCompletionManager and passed along to the MOCompletionStrategy. In practice this is often a path that is used for path-based completion as a base for evaluating relative paths.
method result
The composed completion which will be inserted into the NSTextView in place of the prefix.

matchesForPrefixString:newPrefixString:basePath:

The basic method for returning possible completions.
- ( NSArray *) matchesForPrefixString:
        (NSString *) str newPrefixString:
        (NSString **) newStr basePath:
        (NSString *) basePath;

This is the primary method that a MOCompletionStrategy must override. Given a prefix string and a base path (which is basically user-defined info passed in from the client of the MOCompletionManager), this method is responsible for figuring out possible completions and returning them in an array. The completion strings returned should not include the prefix. Composing the prefix with a possible completion is done separately.

Parameter Descriptions
str
The prefix string that completions should be done against.
newStr
A pointer to an NSString pointer. If the MOCompletionStrategy wants to modify the prefix string, it can do so by passing a new prefix string back through this pointer. If a MOCompletionStrategy does not assign into this pointer, the prefix string is left unchanged.
basePath
In general user-defined info passed in to MOCompletionManager and passed along to the MOCompletionStrategy. In practice this is often a path that is used for path-based completion as a base for evaluating relative paths.
method result
An array of NSStrings which are the possible completions for the given prefix string. Or nil if there are no completions.

(Last Updated 3/20/2005)