org.eclipse.xtext.ui.editor.contentassist
Class ProposalConflictHelper

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.contentassist.ProposalConflictHelper
All Implemented Interfaces:
IProposalConflictHelper
Direct Known Subclasses:
AntlrProposalConflictHelper

public abstract class ProposalConflictHelper
extends java.lang.Object
implements IProposalConflictHelper

Abstract base implementation of the IProposalConflictHelper that deals with the node model to extract the previous sibling of the input source.

Implementors have to provide the semantics of existsConflict(String, String, ContentAssistContext). They should consider to extend the AntlrProposalConflictHelper.

Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.xtext.ui.editor.contentassist.IProposalConflictHelper
IProposalConflictHelper.NullHelper
 
Constructor Summary
ProposalConflictHelper()
           
 
Method Summary
 boolean existsConflict(INode lastCompleteNode, int offset, java.lang.String proposal, ContentAssistContext context)
           
 boolean existsConflict(java.lang.String proposal, ContentAssistContext context)
          Returns false if the proposal would corrupt the previous input.
abstract  boolean existsConflict(java.lang.String lastCompleteText, java.lang.String proposal, ContentAssistContext context)
          Returns false if the proposal would corrupt the previous input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProposalConflictHelper

public ProposalConflictHelper()
Method Detail

existsConflict

public boolean existsConflict(java.lang.String proposal,
                              ContentAssistContext context)
Description copied from interface: IProposalConflictHelper
Returns false if the proposal would corrupt the previous input.

Specified by:
existsConflict in interface IProposalConflictHelper
Parameters:
proposal - a possible proposal string. Is never null.
context - the current content assist context. Is never null.
Returns:
false if the proposal would corrupt the current input.

existsConflict

public abstract boolean existsConflict(java.lang.String lastCompleteText,
                                       java.lang.String proposal,
                                       ContentAssistContext context)
Returns false if the proposal would corrupt the previous input.

Parameters:
lastCompleteText - the previous sibling in the input source. Is never null but may be empty. However, the implementation of existsConflict(INode, int, String, ContentAssistContext) will not pass empty strings by default but return false instead.
proposal - a possible proposal string. Is never null.
context - the current content assist context. Is never null.
Returns:
false if the proposal would corrupt the current input.

existsConflict

public boolean existsConflict(INode lastCompleteNode,
                              int offset,
                              java.lang.String proposal,
                              ContentAssistContext context)