com.borland.primetime.insight
Interface InsightFactory


public interface InsightFactory

One of two interfaces that must be implemented to create a CodeInsight implementation. The Insight class provides the actual handler for CodeInsight functionality. The InsightFactory class returns information about the implementation, and manages loading of the Insight class, which does the actual work when CodeInsight is invoked. Implementations should keep InsightFactory as small and fast loading as possible, so as not to slow down IDE startup time. Expensive operations should be deferred until the implementation is actually invoked, and code should be in a separate class that does not get loaded during OpenTools initialization.

The responsibilities of an InsightFactory implementation are:

  1. Include itself in OpenTools initialization.
  2. Registering with InsightManager during OpenTools initialization, by calling the registerInsight method of com.borland.primetime.insight.InsightManager.
  3. Report whether a given node-type is supported by the implementation.
  4. Return a list of features provided by this implementation.
  5. Create instances of the implementation.
  6. Perform other implementation-dependent tasks, such as initialization, caching, etc.
  7. Provide OpenTools addins that register the keystrokes necessary to invoke the implementation.

See Also:
Insight, InsightManager

Inner Class Summary
static class InsightFactory.InsightFeature
          Represents a CodeInsight feature.
 
Method Summary
 InsightFactory.InsightFeature[] getFeatures()
          Returns the list of features in this implementation of CodeInsight.
 Insight getInsight(FileNode node)
          Returns a new instance of the associated Insight class for this implementation.
 boolean isSupported(FileNode node)
          Determines whether the given content is supported by this implementation.
 

Method Detail

getInsight

public Insight getInsight(FileNode node)
Returns a new instance of the associated Insight class for this implementation.
Parameters:
node - The node that this Insight instance will handle.
Returns:
The newly created instance of this implementation.

getFeatures

public InsightFactory.InsightFeature[] getFeatures()
Returns the list of features in this implementation of CodeInsight. E.g. the Java implementation will have ParameterInsight, MemberInsight and ClassInsight.
Returns:
Array containing the list of features.
See Also:
InsightFactory.InsightFeature

isSupported

public boolean isSupported(FileNode node)
Determines whether the given content is supported by this implementation.
Parameters:
contentType - The content type, in mime format, e.g. "text/java"