com.bbn.swede.editor.contentassist
Class DefaultOWLContentAssistProcessor

java.lang.Object
  extended bycom.bbn.swede.editor.contentassist.DefaultOWLContentAssistProcessor
All Implemented Interfaces:
ILibraryChangeListener, IOASTChangeListener

public class DefaultOWLContentAssistProcessor
extends Object
implements IOASTChangeListener, ILibraryChangeListener

A revision of the content assist processor for the SWeDE editor.

Author:
aperezlo, jlerner, damoore

Field Summary
protected  Map _mapURIToSuggester
          _mapUriToSuggester represents a mapping from URIs to INamespaceSuggester objects monitoring those namespaces.
protected  NamespaceManager _namespaceToURI
          _namespaceToURI represents a set of mappings between namespace abbreviations and fully qualified URIs.
protected  IOWLProject _parentProject
          The containing project of the document being content assisted.
protected  IOWLAbstractSyntaxTree _tree
          The OAST for the currently edited document.
protected static int ATTRIBUTE_PROPOSAL
          Proposal type constant indicating an attribute proposal.
protected static int INVALID_PROPOSAL
          Proposal type constant indicating an invalid proposal.
protected static int NAMESPACE_PROPOSAL
          Proposal type constant indicating a namespace proposal.
protected static int POUND_PROPOSAL
          Proposal type constant indicating a fragment proposal.
protected static int SINGLETON_TAG_PROPOSAL
          Proposal type constant indicating a singleton tag proposal.
protected static int TAG_PROPOSAL
          Proposal type constant indicating a tag proposal.
protected static int URI_PROPOSAL
          Proposal type constant indicating a URI proposal.
 
Constructor Summary
DefaultOWLContentAssistProcessor()
          Default constructor.
 
Method Summary
 ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset)
           
 IContextInformation[] computeContextInformation(ITextViewer viewer, int offset)
          As per IContentAssistProcessor.
 char[] getCompletionProposalAutoActivationCharacters()
          As per IContentAssistProcessor.
 char[] getContextInformationAutoActivationCharacters()
          As per IContentAssistProcessor.
 IContextInformationValidator getContextInformationValidator()
          As per IContentAssistProcessor.
 String getErrorMessage()
          As per IContentAssistProcessor.
 void libraryChanged(LibraryChangeEvent lce)
          Called when by the library when changes are made.
 void oastChanged(OASTEvent event)
          This method responds to changes in the underlying OAST of the current document to ensure that changes made to the namespace declarations are current.
 void resourceChanged(IResourceChangeEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_PROPOSAL

protected static final int TAG_PROPOSAL
Proposal type constant indicating a tag proposal. Tag proposals are triggered when "<foo:" is typed, where "foo" is a known namespace abbreviation, or when < is typed and there are classes or properties defined in the default namespace.

See Also:
Constant Field Values

ATTRIBUTE_PROPOSAL

protected static final int ATTRIBUTE_PROPOSAL
Proposal type constant indicating an attribute proposal. Attribute proposals are triggered when "foo:" is typed, where "foo" is a known namespace abbreviation.

See Also:
Constant Field Values

NAMESPACE_PROPOSAL

protected static final int NAMESPACE_PROPOSAL
Proposal type constant indicating a namespace proposal. Namespace proposals are triggered when "<" is typed.

See Also:
Constant Field Values

POUND_PROPOSAL

protected static final int POUND_PROPOSAL
Proposal type constant indicating a fragment proposal. Fragment proposals are triggered when "#" is typed within an attribute value after a URI known to the project, or immediately after the " for fragment suggestions within the default namespace.

See Also:
Constant Field Values

URI_PROPOSAL

protected static final int URI_PROPOSAL
Proposal type constant indicating a URI proposal. URI proposals are triggered when '="' is typed.

See Also:
Constant Field Values

SINGLETON_TAG_PROPOSAL

protected static final int SINGLETON_TAG_PROPOSAL
Proposal type constant indicating a singleton tag proposal. Singleton tag proposals are triggered at the same time as regular tag proposals.

See Also:
Constant Field Values

INVALID_PROPOSAL

protected static final int INVALID_PROPOSAL
Proposal type constant indicating an invalid proposal.

See Also:
Constant Field Values

_parentProject

protected IOWLProject _parentProject
The containing project of the document being content assisted.


_mapURIToSuggester

protected Map _mapURIToSuggester
_mapUriToSuggester represents a mapping from URIs to INamespaceSuggester objects monitoring those namespaces.


_namespaceToURI

protected NamespaceManager _namespaceToURI
_namespaceToURI represents a set of mappings between namespace abbreviations and fully qualified URIs. In general, a namespace is mapped to a URI in _namespaceToURI, and that same URI has a mapping to a suggester in _mapURIToSuggester


_tree

protected IOWLAbstractSyntaxTree _tree
The OAST for the currently edited document.

Constructor Detail

DefaultOWLContentAssistProcessor

public DefaultOWLContentAssistProcessor()
Default constructor.

Method Detail

resourceChanged

public void resourceChanged(IResourceChangeEvent event)

oastChanged

public void oastChanged(OASTEvent event)
This method responds to changes in the underlying OAST of the current document to ensure that changes made to the namespace declarations are current. This allows users to add, remove, or alter namespace declarations and still have up-to-date content assist support.

Specified by:
oastChanged in interface IOASTChangeListener
Parameters:
event - Describes the change that was just made to the OAST.
See Also:
IOASTChangeListener.oastChanged(com.bbn.swede.core.dom.OASTEvent)

computeCompletionProposals

public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
                                                        int offset)

libraryChanged

public void libraryChanged(LibraryChangeEvent lce)
Description copied from interface: ILibraryChangeListener
Called when by the library when changes are made.

Specified by:
libraryChanged in interface ILibraryChangeListener
Parameters:
lce -
See Also:
LibraryChangeEvent

computeContextInformation

public IContextInformation[] computeContextInformation(ITextViewer viewer,
                                                       int offset)
As per IContentAssistProcessor. In this implementation, this method does nothing and returns null.

See Also:
IContentAssistProcessor

getCompletionProposalAutoActivationCharacters

public char[] getCompletionProposalAutoActivationCharacters()
As per IContentAssistProcessor. In this implementation, returns ['#', '>', ':', '"']

See Also:
IContentAssistProcessor

getContextInformationAutoActivationCharacters

public char[] getContextInformationAutoActivationCharacters()
As per IContentAssistProcessor. In this implementation, this method does nothing and returns null.

See Also:
IContentAssistProcessor

getContextInformationValidator

public IContextInformationValidator getContextInformationValidator()
As per IContentAssistProcessor. In this implementation, this method does nothing and returns null.

See Also:
IContentAssistProcessor

getErrorMessage

public String getErrorMessage()
As per IContentAssistProcessor. In this implementation, this method does nothing and returns null.

See Also:
IContentAssistProcessor


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.