## org.eclipse.datatools.sqltools.sqleditor.internal.sql
Class SQLCompletionProposal

    java.lang.Object
      org.eclipse.datatools.sqltools.sqleditor.internal.sql.SQLCompletionProposal

All Implemented Interfaces:
  ISQLCompletionProposal, org.eclipse.jface.text.contentassist.ICompletionProposal

    public class SQLCompletionProposal

extends java.lang.Object
implements ISQLCompletionProposal

Author:
  Li Huang

Field Summary
`static int` `COLUMN`
`static int` `DATABASE`
`static int` `EVENT`
`static int` `FUNCTION`
`static int` `KEYWORD`
`static int` `OPERATOR`
`static int` `OTHER`
`static int` `STORED_PROCEDURE`
`static int` `TABLE`
`static int` `TEMPLATE`
`static int` `TEMPTABLE_TEMPLATE`
`static int` `TRIGGER`
`static int` `UNRESERVEDKEYWORD`
`static int` `VARIABLE`

Constructor Summary
`SQLCompletionProposal(java.lang.String replacementString, int replacementOffset, int replacementLength, int cursorPosition, org.eclipse.swt.graphics.Image image, java.lang.String displayString, org.eclipse.jface.text.contentassist.IContextInformation contextInformation, java.lang.String additionalProposalInfo, int relevance)` Creates a new completion proposal.

`SQLCompletionProposal(java.lang.String replacementString, int replacementOffset, int replacementLength, int cursorPosition, org.eclipse.swt.graphics.Image image, java.lang.String displayString, org.eclipse.jface.text.contentassist.IContextInformation contextInformation, java.lang.String additionalProposalInfo, int relevance, org.eclipse.jface.action.IAction postAction)`
Creates a new completion proposal.

`SQLCompletionProposal(java.lang.String replacementString, int replacementOffset, int replacementLength, int cursorPosition, int relevance)` Creates a new completion proposal based on the provided information.

Method Summary
`void` `apply(org.eclipse.jface.text.IDocument document)`
`java.lang.String` `getAdditionalProposalInfo()`
`org.eclipse.jface.text.contentassist.IContextInformation` `getContextInformation()`
`java.lang.String` `getDisplayString()`
`org.eclipse.swt.graphics.Image` `getImage()`
`int` `getRelevance()` Returns the relevance of this completion proposal.
`org.eclipse.swt.graphics.Point` `getSelection(org.eclipse.jface.text.IDocument document)`
`void` `setRelevance(int relevance)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TEMPLATE

    public static final int TEMPLATE

See Also:
  Constant Field Values

### OPERATOR

    public static final int OPERATOR

See Also:
  Constant Field Values

### OTHER

    public static final int OTHER

See Also:
  Constant Field Values

### KEYWORD

    public static final int KEYWORD

See Also:
  Constant Field Values

### UNRESERVEDKEYWORD

    public static final int UNRESERVEDKEYWORD

See Also:
  Constant Field Values

### DATABASE

    public static final int DATABASE

See Also:
  Constant Field Values

### TABLE

    public static final int TABLE

See Also:
  Constant Field Values

### STORED_PROCEDURE

    public static final int STORED_PROCEDURE

See Also:
  Constant Field Values

### FUNCTION

    public static final int FUNCTION

See Also:
  Constant Field Values

### TRIGGER

    public static final int TRIGGER

See Also:
  Constant Field Values

### EVENT

    public static final int EVENT

See Also:
  Constant Field Values

### COLUMN

    public static final int COLUMN

See Also:
  Constant Field Values

### VARIABLE

    public static final int VARIABLE

See Also:
  Constant Field Values

### TEMPTABLE_TEMPLATE

    public static final int TEMPTABLE_TEMPLATE

See Also:
  Constant Field Values

Constructor Detail

### SQLCompletionProposal

    public SQLCompletionProposal(java.lang.String replacementString,
                                 int replacementOffset,
                                 int replacementLength,
                                 int cursorPosition,
                                 int relevance)

  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
    `replacementOffset` - the offset of the text to be replaced
    `replacementLength` - the length of the text to be replaced
    `cursorPosition` - the position of the cursor following the insert relative to replacementOffset
    `relevance` - the relevance for the proposal

### SQLCompletionProposal

    public SQLCompletionProposal(java.lang.String replacementString,
                                 int replacementOffset,
                                 int replacementLength,
                                 int cursorPosition,
                                 org.eclipse.swt.graphics.Image image,
                                 java.lang.String displayString,
                                 org.eclipse.jface.text.contentassist.IContextInformation contextInformation,
                                 java.lang.String additionalProposalInfo,
                                 int relevance)

  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
    `replacementOffset` - the offset of the text to be replaced
    `replacementLength` - the length 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
    `relevance` - the relevance for the proposal

### SQLCompletionProposal

    public SQLCompletionProposal(java.lang.String replacementString,
                                 int replacementOffset,
                                 int replacementLength,
                                 int cursorPosition,
                                 org.eclipse.swt.graphics.Image image,
                                 java.lang.String displayString,
                                 org.eclipse.jface.text.contentassist.IContextInformation contextInformation,
                                 java.lang.String additionalProposalInfo,
                                 int relevance,
                                 org.eclipse.jface.action.IAction postAction)

  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
    `replacementOffset` - the offset of the text to be replaced
    `replacementLength` - the length 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
    `relevance` - the relevance for the proposal
    `postAction` - the action to be performed after the completion proposal is applied

Method Detail

### apply

    public void apply(org.eclipse.jface.text.IDocument document)

  Specified by:
    `apply` in interface `org.eclipse.jface.text.contentassist.ICompletionProposal`

### getSelection

    public org.eclipse.swt.graphics.Point getSelection(org.eclipse.jface.text.IDocument document)

  Specified by:
    `getSelection` in interface `org.eclipse.jface.text.contentassist.ICompletionProposal`

### getContextInformation

    public org.eclipse.jface.text.contentassist.IContextInformation getContextInformation()

  Specified by:
    `getContextInformation` in interface `org.eclipse.jface.text.contentassist.ICompletionProposal`

### getImage

    public org.eclipse.swt.graphics.Image getImage()

  Specified by:
    `getImage` in interface `org.eclipse.jface.text.contentassist.ICompletionProposal`

### getDisplayString

    public java.lang.String getDisplayString()

  Specified by:
    `getDisplayString` in interface `org.eclipse.jface.text.contentassist.ICompletionProposal`

### getAdditionalProposalInfo

    public java.lang.String getAdditionalProposalInfo()

  Specified by:
    `getAdditionalProposalInfo` in interface `org.eclipse.jface.text.contentassist.ICompletionProposal`

### getRelevance

    public int getRelevance()

  Description copied from interface: `ISQLCompletionProposal`
  Returns the relevance of this completion proposal.

  The relevance is used to determine if this proposal is more relevant than another proposal.

  Specified by:
    `getRelevance` in interface `ISQLCompletionProposal`
  Returns:
    Returns the _relevance.

### setRelevance

    public void setRelevance(int relevance)

  Parameters:
    `_relevance` - The Relevance to set.