Class TemplateProposal
- java.lang.Object
-
- com.e1c.g5.v8.dt.lcore.ui.templates.contentassist.TemplateProposal
-
- All Implemented Interfaces:
ICompletionProposalPriorityExtension
,org.eclipse.jface.text.contentassist.ICompletionProposal
,org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
,org.eclipse.jface.text.contentassist.ICompletionProposalExtension4
,org.eclipse.jface.text.contentassist.ICompletionProposalExtension5
,org.eclipse.jface.text.contentassist.ICompletionProposalExtension6
public class TemplateProposal extends Object implements org.eclipse.jface.text.contentassist.ICompletionProposal, org.eclipse.jface.text.contentassist.ICompletionProposalExtension2, org.eclipse.jface.text.contentassist.ICompletionProposalExtension4, org.eclipse.jface.text.contentassist.ICompletionProposalExtension5, org.eclipse.jface.text.contentassist.ICompletionProposalExtension6, ICompletionProposalPriorityExtension
Default template proposal
-
-
Constructor Summary
Constructors Constructor Description TemplateProposal(List<IVariable> variables, ITemplate template, int replaceOffset, int replaceLength, org.eclipse.jface.text.ITextViewer viewer, String prefix, org.eclipse.swt.graphics.Image image)
Creates new instance of this with given parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(org.eclipse.jface.text.IDocument document)
void
apply(org.eclipse.jface.text.ITextViewer viewer, char trigger, int stateMask, int offset)
String
getAdditionalProposalInfo()
Object
getAdditionalProposalInfo(org.eclipse.core.runtime.IProgressMonitor monitor)
org.eclipse.jface.text.contentassist.IContextInformation
getContextInformation()
String
getDisplayString()
org.eclipse.swt.graphics.Image
getImage()
int
getPriority()
Returns the priority of proposalorg.eclipse.swt.graphics.Point
getSelection(org.eclipse.jface.text.IDocument document)
StyledString
getStyledDisplayString()
boolean
isAutoInsertable()
void
selected(org.eclipse.jface.text.ITextViewer viewer, boolean smartToggle)
void
setPriority(int priority)
Sets priority to the given onevoid
setPriorityHelper(ITemplatePriorityHelper priorityHelper)
Sets the priority helper that helps to adjust proposal's priorityvoid
unselected(org.eclipse.jface.text.ITextViewer viewer)
boolean
validate(org.eclipse.jface.text.IDocument document, int offset, org.eclipse.jface.text.DocumentEvent event)
-
-
-
Constructor Detail
-
TemplateProposal
public TemplateProposal(List<IVariable> variables, ITemplate template, int replaceOffset, int replaceLength, org.eclipse.jface.text.ITextViewer viewer, String prefix, org.eclipse.swt.graphics.Image image)
Creates new instance of this with given parameters- Parameters:
variables
- The variables of the template, cannot benull
template
- The template from which the proposal is created, cannot benull
replaceOffset
- The offset of the region that has to be replaced with proposal content, cannot benull
replaceLength
- The length of the region that has to be replaced with proposal content, cannot benull
viewer
- The viewer for which this proposal is created, cannot benull
prefix
- The prefix text, when this proposal was called, cannot benull
image
- The image of the proposal to display to user, can benull
-
-
Method Detail
-
apply
public void apply(org.eclipse.jface.text.IDocument document)
- Specified by:
apply
in interfaceorg.eclipse.jface.text.contentassist.ICompletionProposal
-
getSelection
public org.eclipse.swt.graphics.Point getSelection(org.eclipse.jface.text.IDocument document)
- Specified by:
getSelection
in interfaceorg.eclipse.jface.text.contentassist.ICompletionProposal
-
getAdditionalProposalInfo
public String getAdditionalProposalInfo()
- Specified by:
getAdditionalProposalInfo
in interfaceorg.eclipse.jface.text.contentassist.ICompletionProposal
-
getDisplayString
public String getDisplayString()
- Specified by:
getDisplayString
in interfaceorg.eclipse.jface.text.contentassist.ICompletionProposal
-
getImage
public org.eclipse.swt.graphics.Image getImage()
- Specified by:
getImage
in interfaceorg.eclipse.jface.text.contentassist.ICompletionProposal
-
getContextInformation
public org.eclipse.jface.text.contentassist.IContextInformation getContextInformation()
- Specified by:
getContextInformation
in interfaceorg.eclipse.jface.text.contentassist.ICompletionProposal
-
getStyledDisplayString
public StyledString getStyledDisplayString()
- Specified by:
getStyledDisplayString
in interfaceorg.eclipse.jface.text.contentassist.ICompletionProposalExtension6
-
getAdditionalProposalInfo
public Object getAdditionalProposalInfo(org.eclipse.core.runtime.IProgressMonitor monitor)
- Specified by:
getAdditionalProposalInfo
in interfaceorg.eclipse.jface.text.contentassist.ICompletionProposalExtension5
-
isAutoInsertable
public boolean isAutoInsertable()
- Specified by:
isAutoInsertable
in interfaceorg.eclipse.jface.text.contentassist.ICompletionProposalExtension4
-
apply
public void apply(org.eclipse.jface.text.ITextViewer viewer, char trigger, int stateMask, int offset)
- Specified by:
apply
in interfaceorg.eclipse.jface.text.contentassist.ICompletionProposalExtension2
-
selected
public void selected(org.eclipse.jface.text.ITextViewer viewer, boolean smartToggle)
- Specified by:
selected
in interfaceorg.eclipse.jface.text.contentassist.ICompletionProposalExtension2
-
unselected
public void unselected(org.eclipse.jface.text.ITextViewer viewer)
- Specified by:
unselected
in interfaceorg.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:
validate
in interfaceorg.eclipse.jface.text.contentassist.ICompletionProposalExtension2
-
getPriority
public int getPriority()
Description copied from interface:ICompletionProposalPriorityExtension
Returns the priority of proposal- Specified by:
getPriority
in interfaceICompletionProposalPriorityExtension
- Returns:
- The priority of proposal
-
setPriority
public void setPriority(int priority)
Description copied from interface:ICompletionProposalPriorityExtension
Sets priority to the given one- Specified by:
setPriority
in interfaceICompletionProposalPriorityExtension
- Parameters:
priority
- The priority to set
-
setPriorityHelper
public void setPriorityHelper(ITemplatePriorityHelper priorityHelper)
Sets the priority helper that helps to adjust proposal's priority- Parameters:
priorityHelper
- The priority helper to help to adjust priority, can benull
-
-