org.eclipse.datatools.sqltools.sqleditor.internal.templates
Class PositionBasedCompletionProposal
java.lang.Object
   org.eclipse.datatools.sqltools.sqleditor.internal.templates.PositionBasedCompletionProposal
org.eclipse.datatools.sqltools.sqleditor.internal.templates.PositionBasedCompletionProposal
- All Implemented Interfaces: 
- org.eclipse.jface.text.contentassist.ICompletionProposal, org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
- public class PositionBasedCompletionProposal 
- extends java.lang.Object- implements org.eclipse.jface.text.contentassist.ICompletionProposal, org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
An enhanced implementation of the ICompletionProposal interface implementing all the extension interfaces.
- Since:
- 3.0
| Constructor Summary | 
| PositionBasedCompletionProposal(java.lang.String replacementString,
                                org.eclipse.jface.text.Position replacementPosition,
                                int cursorPosition)Creates a new completion proposal based on the provided information.
 | 
| PositionBasedCompletionProposal(java.lang.String replacementString,
                                org.eclipse.jface.text.Position replacementPosition,
                                int cursorPosition,
                                org.eclipse.swt.graphics.Image image,
                                java.lang.String displayString,
                                org.eclipse.jface.text.contentassist.IContextInformation contextInformation,
                                java.lang.String additionalProposalInfo)Creates a new completion proposal.
 | 
 
| Method Summary | 
|  void | apply(org.eclipse.jface.text.IDocument document)
 | 
|  void | apply(org.eclipse.jface.text.ITextViewer viewer,
      char trigger,
      int stateMask,
      int offset)
 | 
|  java.lang.String | getAdditionalProposalInfo()
 | 
|  org.eclipse.jface.text.contentassist.IContextInformation | getContextInformation()
 | 
|  java.lang.String | getDisplayString()
 | 
|  org.eclipse.swt.graphics.Image | getImage()
 | 
|  org.eclipse.swt.graphics.Point | getSelection(org.eclipse.jface.text.IDocument document)
 | 
|  void | selected(org.eclipse.jface.text.ITextViewer viewer,
         boolean smartToggle)
 | 
|  void | unselected(org.eclipse.jface.text.ITextViewer viewer)
 | 
|  boolean | validate(org.eclipse.jface.text.IDocument document,
         int offset,
         org.eclipse.jface.text.DocumentEvent event)
 | 
 
| Methods inherited from class java.lang.Object | 
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
PositionBasedCompletionProposal
public PositionBasedCompletionProposal(java.lang.String replacementString,
                                       org.eclipse.jface.text.Position replacementPosition,
                                       int cursorPosition)
- Creates a new completion proposal based on the provided information.  The replacement string is
 considered being the display string too. All remaining fields are set to null.
 
- Parameters:
- replacementString- the actual string to be inserted into the document
- replacementPosition- the position of the text to be replaced
- cursorPosition- the position of the cursor following the insert relative to replacementOffset
 
PositionBasedCompletionProposal
public PositionBasedCompletionProposal(java.lang.String replacementString,
                                       org.eclipse.jface.text.Position replacementPosition,
                                       int cursorPosition,
                                       org.eclipse.swt.graphics.Image image,
                                       java.lang.String displayString,
                                       org.eclipse.jface.text.contentassist.IContextInformation contextInformation,
                                       java.lang.String additionalProposalInfo)
- Creates a new completion proposal. All fields are initialized based on the provided information.
 
- Parameters:
- replacementString- the actual string to be inserted into the document
- replacementPosition- the position of the text to be replaced
- cursorPosition- the position of the cursor following the insert relative to replacementOffset
- image- the image to display for this proposal
- displayString- the string to be displayed for the proposal
- contextInformation- the context information associated with this proposal
- additionalProposalInfo- the additional information associated with this proposal
 
apply
public void apply(org.eclipse.jface.text.IDocument document)
- 
- Specified by:
- applyin interface- org.eclipse.jface.text.contentassist.ICompletionProposal
 
- 
 
getSelection
public org.eclipse.swt.graphics.Point getSelection(org.eclipse.jface.text.IDocument document)
- 
- Specified by:
- getSelectionin interface- org.eclipse.jface.text.contentassist.ICompletionProposal
 
- 
 
getContextInformation
public org.eclipse.jface.text.contentassist.IContextInformation getContextInformation()
- 
- Specified by:
- getContextInformationin interface- org.eclipse.jface.text.contentassist.ICompletionProposal
 
- 
 
getImage
public org.eclipse.swt.graphics.Image getImage()
- 
- Specified by:
- getImagein interface- org.eclipse.jface.text.contentassist.ICompletionProposal
 
- 
 
getDisplayString
public java.lang.String getDisplayString()
- 
- Specified by:
- getDisplayStringin interface- org.eclipse.jface.text.contentassist.ICompletionProposal
 
- 
 
getAdditionalProposalInfo
public java.lang.String getAdditionalProposalInfo()
- 
- Specified by:
- getAdditionalProposalInfoin interface- org.eclipse.jface.text.contentassist.ICompletionProposal
 
- 
 
apply
public void apply(org.eclipse.jface.text.ITextViewer viewer,
                  char trigger,
                  int stateMask,
                  int offset)
- 
- Specified by:
- applyin interface- org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
 
- 
 
selected
public void selected(org.eclipse.jface.text.ITextViewer viewer,
                     boolean smartToggle)
- 
- Specified by:
- selectedin interface- org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
 
- 
 
unselected
public void unselected(org.eclipse.jface.text.ITextViewer viewer)
- 
- Specified by:
- unselectedin interface- org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
 
- 
 
validate
public boolean validate(org.eclipse.jface.text.IDocument document,
                        int offset,
                        org.eclipse.jface.text.DocumentEvent event)
- 
- Specified by:
- validatein interface- org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
 
-