Changes:
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / template / DeclarationProposal.java
index 83b3253..238423d 100644 (file)
@@ -77,7 +77,9 @@ public class DeclarationProposal extends AbstractProposal { //implements IPHPCom
         case PHPIdentifierLocation.FUNCTION :
           document.replace(start, end - start, fIdentifierName + "()");
           break;
-
+        case PHPIdentifierLocation.CONSTRUCTOR :
+          document.replace(start, end - start, fIdentifierName + "()");
+          break;
         case PHPIdentifierLocation.METHOD :
           document.replace(start, end - start, fIdentifierName + "()");
           break;
@@ -107,7 +109,9 @@ public class DeclarationProposal extends AbstractProposal { //implements IPHPCom
         case PHPIdentifierLocation.FUNCTION :
           editor.setFinalCaretOffset(fIdentifierName.length() + start + 1);
           break;
-
+        case PHPIdentifierLocation.CONSTRUCTOR :
+          editor.setFinalCaretOffset(fIdentifierName.length() + start + 1);
+          break;
         case PHPIdentifierLocation.METHOD :
           editor.setFinalCaretOffset(fIdentifierName.length() + start + 1);
           break;
@@ -151,8 +155,9 @@ public class DeclarationProposal extends AbstractProposal { //implements IPHPCom
    * @see ICompletionProposal#getDisplayString()
    */
   public String getDisplayString() {
-    return fIdentifierName + TemplateMessages.getString("TemplateProposal.delimiter") + fIdentifierName; // $NON-NLS-1$ //$NON-NLS-1$
-    //         return fTemplate.getName() + ObfuscatorMessages.getString("TemplateProposal.delimiter") + fTemplate.getDescription(); // $NON-NLS-1$ //$NON-NLS-1$
+    String workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot().getLocation().toString();
+    String filename = workspaceLocation + fLocation.getFilename();
+    return fIdentifierName + TemplateMessages.getString("TemplateProposal.delimiter") + PHPDocUtil.getUsage(filename, fLocation) + TemplateMessages.getString("TemplateProposal.delimiter") + filename; // $NON-NLS-1$ //$NON-NLS-1$
   }
 
   /*
@@ -164,6 +169,8 @@ public class DeclarationProposal extends AbstractProposal { //implements IPHPCom
         return PHPUiImages.get(PHPUiImages.IMG_FUN);
       case PHPIdentifierLocation.CLASS :
         return PHPUiImages.get(PHPUiImages.IMG_CLASS);
+      case PHPIdentifierLocation.CONSTRUCTOR :
+        return PHPUiImages.get(PHPUiImages.IMG_CLASS);
       case PHPIdentifierLocation.METHOD :
         return PHPUiImages.get(PHPUiImages.IMG_FUN);
       case PHPIdentifierLocation.DEFINE :
@@ -188,7 +195,9 @@ public class DeclarationProposal extends AbstractProposal { //implements IPHPCom
         case '\n' :
         case '\t' :
           return 90;
-
+        case '>' : // ->
+        case ':' : // ::
+          return 95;
         default :
           return 0;
       }