/**
* Creates a template proposal with a template and its context.
- *
+ *
* @param template
- * the template
+ * the template
* @param context
- * the context in which the template was requested.
+ * the context in which the template was requested.
* @param image
- * the icon of the proposal.
+ * the icon of the proposal.
*/
- public BuiltInProposal(String functionName, PHPFunction function, TemplateContext context, IRegion region, ITextViewer viewer) {
+ public BuiltInProposal(String functionName, PHPFunction function,
+ TemplateContext context, IRegion region, ITextViewer viewer) {
super(viewer);
fBuiltinFunctionName = functionName;
fFunction = function;
int end = fRegion.getOffset() + fRegion.getLength();
// insert template string
- // String templateString = fTemplate; // fTemplateBuffer.getString();
+ // String templateString = fTemplate; //
+ // fTemplateBuffer.getString();
document.replace(start, end - start, fBuiltinFunctionName + "()");
// translate positions
// }
LinkedPositionUI editor = new LinkedPositionUI(fViewer, manager);
- editor.setFinalCaretOffset(fBuiltinFunctionName.length() + start + 1);
- // editor.setFinalCaretOffset(getCaretOffset(fTemplateBuffer) + start);
+ editor.setFinalCaretOffset(fBuiltinFunctionName.length() + start
+ + 1);
+ // editor.setFinalCaretOffset(getCaretOffset(fTemplateBuffer) +
+ // start);
editor.enter();
fSelectedRegion = editor.getSelectedRegion();
if (i0 >= 0 && (i0 < newline || newline < 0)) {
int i1 = contextInfoString.indexOf(')', i0 + 1);
if (i1 > 0) {
- fContextInfo = new ContextInformation(null, contextInfoString.substring(i0+1, i1));
+ fContextInfo = new ContextInformation(null,
+ contextInfoString.substring(i0 + 1, i1));
} else {
- fContextInfo = new ContextInformation(null, contextInfoString);
+ fContextInfo = new ContextInformation(null,
+ contextInfoString);
}
} else {
- fContextInfo = new ContextInformation(null, contextInfoString);
+ fContextInfo = new ContextInformation(null,
+ contextInfoString);
}
}
}
* @see ICompletionProposal#getDisplayString()
*/
public String getDisplayString() {
- return fBuiltinFunctionName + TemplateMessages.getString("TemplateProposal.delimiter") + fFunction.getUsage(); // $NON-NLS-1$
+ return fBuiltinFunctionName
+ + TemplateMessages.getString("TemplateProposal.delimiter") + fFunction.getUsage(); // $NON-NLS-1$
// //$NON-NLS-1$
}