A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / template / BuiltInProposal.java
index a0e1bda..900604a 100644 (file)
@@ -39,15 +39,16 @@ public class BuiltInProposal extends AbstractProposal {
 
        /**
         * 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;
@@ -68,7 +69,8 @@ public class BuiltInProposal extends AbstractProposal {
                        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
@@ -88,8 +90,10 @@ public class BuiltInProposal extends AbstractProposal {
                        // }
 
                        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();
@@ -118,12 +122,15 @@ public class BuiltInProposal extends AbstractProposal {
                                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);
                                }
                        }
                }
@@ -134,7 +141,8 @@ public class BuiltInProposal extends AbstractProposal {
         * @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$
        }