1 /******************************************************************************* 2 * Copyright (c) 2000, 2003 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Common Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/cpl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package net.sourceforge.phpdt.core; 12 13 import net.sourceforge.phpdt.core.compiler.IProblem; 14 15 /** 16 * A completion requestor accepts results as they are computed and is aware of 17 * source positions to complete the various different results. 18 * <p> 19 * This interface may be implemented by clients. 20 * </p> 21 * 22 * @see ICodeAssist 23 * @since 2.0 24 */ 25 public interface ICompletionRequestor { 26 /** 27 * Code assist notification of an anonymous type declaration completion. 28 * 29 * @param superTypePackageName 30 * Name of the package that contains the super type of this new 31 * anonymous type declaration . 32 * 33 * @param superTypeName 34 * Name of the super type of this new anonymous type declaration. 35 * 36 * @param parameterPackageNames 37 * Names of the packages in which the parameter types are 38 * declared. Should contain as many elements as 39 * parameterTypeNames. 40 * 41 * @param parameterTypeNames 42 * Names of the parameters types. Should contain as many elements 43 * as parameterPackageNames. 44 * 45 * @param completionName 46 * The completion for the anonymous type declaration. Can include 47 * zero, one or two brackets. If the closing bracket is included, 48 * then the cursor should be placed before it. 49 * 50 * @param modifiers 51 * The modifiers of the constructor. 52 * 53 * @param completionStart 54 * The start position of insertion of the name of this new 55 * anonymous type declaration. 56 * 57 * @param completionEnd 58 * The end position of insertion of the name of this new 59 * anonymous type declaration. 60 * 61 * @param relevance 62 * The relevance of the completion proposal It is a positive 63 * integer which are used for determine if this proposal is more 64 * relevant than another proposal. This value can only be used 65 * for compare relevance. A proposal is more relevant than 66 * another if his relevance value is higher. 67 * 68 * NOTE - All package and type names are presented in their readable form: 69 * Package names are in the form "a.b.c". Base types are in the form "int" 70 * or "boolean". Array types are in the qualified form "M[]" or "int[]". 71 * Nested type names are in the qualified form "A.M". The default package is 72 * represented by an empty array. 73 * 74 * NOTE: parameter names can be retrieved from the source model after the 75 * user selects a specific method. 76 */ acceptAnonymousType(char[] superTypePackageName, char[] superTypeName, char[][] parameterPackageNames, char[][] parameterTypeNames, char[][] parameterNames, char[] completionName, int modifiers, int completionStart, int completionEnd, int relevance)77 void acceptAnonymousType(char[] superTypePackageName, char[] superTypeName, 78 char[][] parameterPackageNames, char[][] parameterTypeNames, 79 char[][] parameterNames, char[] completionName, int modifiers, 80 int completionStart, int completionEnd, int relevance); 81 82 /** 83 * Code assist notification of a class completion. 84 * 85 * @param packageName 86 * Declaring package name of the class. 87 * @param className 88 * Name of the class. 89 * @param completionName 90 * The completion for the class. Can include ';' for imported 91 * classes. 92 * @param modifiers 93 * The modifiers of the class. 94 * @param completionStart 95 * The start position of insertion of the name of the class. 96 * @param completionEnd 97 * The end position of insertion of the name of the class. 98 * @param relevance 99 * The relevance of the completion proposal It is a positive 100 * integer which are used for determine if this proposal is more 101 * relevant than another proposal. This value can only be used 102 * for compare relevance. A proposal is more relevant than 103 * another if his relevance value is higher. 104 * 105 * NOTE - All package and type names are presented in their readable form: 106 * Package names are in the form "a.b.c". Nested type names are in the 107 * qualified form "A.M". The default package is represented by an empty 108 * array. 109 */ acceptClass(char[] packageName, char[] className, char[] completionName, int modifiers, int completionStart, int completionEnd, int relevance)110 void acceptClass(char[] packageName, char[] className, 111 char[] completionName, int modifiers, int completionStart, 112 int completionEnd, int relevance); 113 114 /** 115 * Code assist notification of a compilation error detected during 116 * completion. 117 * 118 * @param error 119 * Only problems which are categorized as non-syntax errors are 120 * notified to the requestor, warnings are silently ignored. In 121 * case an error got signalled, no other completions might be 122 * available, therefore the problem message should be presented 123 * to the user. The source positions of the problem are related 124 * to the source where it was detected (might be in another 125 * compilation unit, if it was indirectly requested during the 126 * code assist process). Note: the problem knows its originating 127 * file name. 128 */ acceptError(IProblem error)129 void acceptError(IProblem error); 130 131 /** 132 * Code assist notification of a field completion. 133 * 134 * @param declaringTypePackageName 135 * Name of the package in which the type that contains this field 136 * is declared. 137 * @param declaringTypeName 138 * Name of the type declaring this new field. 139 * @param name 140 * Name of the field. 141 * @param typePackageName 142 * Name of the package in which the type of this field is 143 * declared. 144 * @param typeName 145 * Name of the type of this field. 146 * @param completionName 147 * The completion for the field. 148 * @param modifiers 149 * The modifiers of this field. 150 * @param completionStart 151 * The start position of insertion of the name of this field. 152 * @param completionEnd 153 * The end position of insertion of the name of this field. 154 * @param relevance 155 * The relevance of the completion proposal It is a positive 156 * integer which are used for determine if this proposal is more 157 * relevant than another proposal. This value can only be used 158 * for compare relevance. A proposal is more relevant than 159 * another if his relevance value is higher. 160 * 161 * NOTE - All package and type names are presented in their readable form: 162 * Package names are in the form "a.b.c". Base types are in the form "int" 163 * or "boolean". Array types are in the qualified form "M[]" or "int[]". 164 * Nested type names are in the qualified form "A.M". The default package is 165 * represented by an empty array. 166 */ acceptField(char[] declaringTypePackageName, char[] declaringTypeName, char[] name, char[] typePackageName, char[] typeName, char[] completionName, int modifiers, int completionStart, int completionEnd, int relevance)167 void acceptField(char[] declaringTypePackageName, char[] declaringTypeName, 168 char[] name, char[] typePackageName, char[] typeName, 169 char[] completionName, int modifiers, int completionStart, 170 int completionEnd, int relevance); 171 172 /** 173 * Code assist notification of an interface completion. 174 * 175 * @param packageName 176 * Declaring package name of the interface. 177 * @param className 178 * Name of the interface. 179 * @param completionName 180 * The completion for the interface. Can include ';' for imported 181 * interfaces. 182 * @param modifiers 183 * The modifiers of the interface. 184 * @param completionStart 185 * The start position of insertion of the name of the interface. 186 * @param completionEnd 187 * The end position of insertion of the name of the interface. 188 * @param relevance 189 * The relevance of the completion proposal It is a positive 190 * integer which are used for determine if this proposal is more 191 * relevant than another proposal. This value can only be used 192 * for compare relevance. A proposal is more relevant than 193 * another if his relevance value is higher. 194 * 195 * NOTE - All package and type names are presented in their readable form: 196 * Package names are in the form "a.b.c". Nested type names are in the 197 * qualified form "A.M". The default package is represented by an empty 198 * array. 199 */ acceptInterface(char[] packageName, char[] interfaceName, char[] completionName, int modifiers, int completionStart, int completionEnd, int relevance)200 void acceptInterface(char[] packageName, char[] interfaceName, 201 char[] completionName, int modifiers, int completionStart, 202 int completionEnd, int relevance); 203 204 /** 205 * Code assist notification of a keyword completion. 206 * 207 * @param keywordName 208 * The keyword source. 209 * @param completionStart 210 * The start position of insertion of the name of this keyword. 211 * @param completionEnd 212 * The end position of insertion of the name of this keyword. 213 * @param relevance 214 * The relevance of the completion proposal It is a positive 215 * integer which are used for determine if this proposal is more 216 * relevant than another proposal. This value can only be used 217 * for compare relevance. A proposal is more relevant than 218 * another if his relevance value is higher. 219 */ acceptKeyword(char[] keywordName, int completionStart, int completionEnd, int relevance)220 void acceptKeyword(char[] keywordName, int completionStart, 221 int completionEnd, int relevance); 222 223 /** 224 * Code assist notification of a label completion. 225 * 226 * @param labelName 227 * The label source. 228 * @param completionStart 229 * The start position of insertion of the name of this label. 230 * @param completionEnd 231 * The end position of insertion of the name of this label. 232 * @param relevance 233 * The relevance of the completion proposal It is a positive 234 * integer which are used for determine if this proposal is more 235 * relevant than another proposal. This value can only be used 236 * for compare relevance. A proposal is more relevant than 237 * another if his relevance value is higher. 238 */ acceptLabel(char[] labelName, int completionStart, int completionEnd, int relevance)239 void acceptLabel(char[] labelName, int completionStart, int completionEnd, 240 int relevance); 241 242 /** 243 * Code assist notification of a local variable completion. 244 * 245 * @param name 246 * Name of the new local variable. 247 * @param typePackageName 248 * Name of the package in which the type of this new local 249 * variable is declared. 250 * @param typeName 251 * Name of the type of this new local variable. 252 * @param modifiers 253 * The modifiers of this new local variable. 254 * @param completionStart 255 * The start position of insertion of the name of this new local 256 * variable. 257 * @param completionEnd 258 * The end position of insertion of the name of this new local 259 * variable. 260 * @param relevance 261 * The relevance of the completion proposal It is a positive 262 * integer which are used for determine if this proposal is more 263 * relevant than another proposal. This value can only be used 264 * for compare relevance. A proposal is more relevant than 265 * another if his relevance value is higher. 266 * 267 * NOTE - All package and type names are presented in their readable form: 268 * Package names are in the form "a.b.c". Base types are in the form "int" 269 * or "boolean". Array types are in the qualified form "M[]" or "int[]". 270 * Nested type names are in the qualified form "A.M". The default package is 271 * represented by an empty array. 272 */ acceptLocalVariable(char[] name, char[] typePackageName, char[] typeName, int modifiers, int completionStart, int completionEnd, int relevance)273 void acceptLocalVariable(char[] name, char[] typePackageName, 274 char[] typeName, int modifiers, int completionStart, 275 int completionEnd, int relevance); 276 277 /** 278 * Code assist notification of a method completion. 279 * 280 * @param declaringTypePackageName 281 * Name of the package in which the type that contains this new 282 * method is declared. 283 * @param declaringTypeName 284 * Name of the type declaring this new method. 285 * @param selector 286 * Name of the new method. 287 * @param parameterPackageNames 288 * Names of the packages in which the parameter types are 289 * declared. Should contain as many elements as 290 * parameterTypeNames. 291 * @param parameterTypeNames 292 * Names of the parameters types. Should contain as many elements 293 * as parameterPackageNames. 294 * @param returnTypePackageName 295 * Name of the package in which the return type is declared. 296 * @param returnTypeName 297 * Name of the return type of this new method, should be 298 * <code>null</code> for a constructor. 299 * @param completionName 300 * The completion for the method. Can include zero, one or two 301 * brackets. If the closing bracket is included, then the cursor 302 * should be placed before it. 303 * @param modifiers 304 * The modifiers of this new method. 305 * @param completionStart 306 * The start position of insertion of the name of this new 307 * method. 308 * @param completionEnd 309 * The end position of insertion of the name of this new method. 310 * @param relevance 311 * The relevance of the completion proposal It is a positive 312 * integer which are used for determine if this proposal is more 313 * relevant than another proposal. This value can only be used 314 * for compare relevance. A proposal is more relevant than 315 * another if his relevance value is higher. 316 * 317 * NOTE - All package and type names are presented in their readable form: 318 * Package names are in the form "a.b.c". Base types are in the form "int" 319 * or "boolean". Array types are in the qualified form "M[]" or "int[]". 320 * Nested type names are in the qualified form "A.M". The default package is 321 * represented by an empty array. 322 * 323 * NOTE: parameter names can be retrieved from the source model after the 324 * user selects a specific method. 325 */ acceptMethod(char[] declaringTypePackageName, char[] declaringTypeName, char[] selector, char[][] parameterPackageNames, char[][] parameterTypeNames, char[][] parameterNames, char[] returnTypePackageName, char[] returnTypeName, char[] completionName, int modifiers, int completionStart, int completionEnd, int relevance)326 void acceptMethod(char[] declaringTypePackageName, 327 char[] declaringTypeName, char[] selector, 328 char[][] parameterPackageNames, char[][] parameterTypeNames, 329 char[][] parameterNames, char[] returnTypePackageName, 330 char[] returnTypeName, char[] completionName, int modifiers, 331 int completionStart, int completionEnd, int relevance); 332 333 /** 334 * Code assist notification of a method completion. 335 * 336 * @param declaringTypePackageName 337 * Name of the package in which the type that contains this new 338 * method is declared. 339 * @param declaringTypeName 340 * Name of the type declaring this new method. 341 * @param selector 342 * Name of the new method. 343 * @param parameterPackageNames 344 * Names of the packages in which the parameter types are 345 * declared. Should contain as many elements as 346 * parameterTypeNames. 347 * @param parameterTypeNames 348 * Names of the parameters types. Should contain as many elements 349 * as parameterPackageNames. 350 * @param returnTypePackageName 351 * Name of the package in which the return type is declared. 352 * @param returnTypeName 353 * Name of the return type of this new method, should be 354 * <code>null</code> for a constructor. 355 * @param completionName 356 * The completion for the method. Can include zero, one or two 357 * brackets. If the closing bracket is included, then the cursor 358 * should be placed before it. 359 * @param modifiers 360 * The modifiers of this new method. 361 * @param completionStart 362 * The start position of insertion of the name of this new 363 * method. 364 * @param completionEnd 365 * The end position of insertion of the name of this new method. 366 * @param relevance 367 * The relevance of the completion proposal It is a positive 368 * integer which are used for determine if this proposal is more 369 * relevant than another proposal. This value can only be used 370 * for compare relevance. A proposal is more relevant than 371 * another if his relevance value is higher. 372 * 373 * NOTE - All package and type names are presented in their readable form: 374 * Package names are in the form "a.b.c". Base types are in the form "int" 375 * or "boolean". Array types are in the qualified form "M[]" or "int[]". 376 * Nested type names are in the qualified form "A.M". The default package is 377 * represented by an empty array. 378 * 379 * NOTE: parameter names can be retrieved from the source model after the 380 * user selects a specific method. 381 */ acceptMethodDeclaration(char[] declaringTypePackageName, char[] declaringTypeName, char[] selector, char[][] parameterPackageNames, char[][] parameterTypeNames, char[][] parameterNames, char[] returnTypePackageName, char[] returnTypeName, char[] completionName, int modifiers, int completionStart, int completionEnd, int relevance)382 void acceptMethodDeclaration(char[] declaringTypePackageName, 383 char[] declaringTypeName, char[] selector, 384 char[][] parameterPackageNames, char[][] parameterTypeNames, 385 char[][] parameterNames, char[] returnTypePackageName, 386 char[] returnTypeName, char[] completionName, int modifiers, 387 int completionStart, int completionEnd, int relevance); 388 389 /** 390 * Code assist notification of a modifier completion. 391 * 392 * @param modifierName 393 * The new modifier. 394 * @param completionStart 395 * The start position of insertion of the name of this new 396 * modifier. 397 * @param completionEnd 398 * The end position of insertion of the name of this new 399 * modifier. 400 * @param relevance 401 * The relevance of the completion proposal It is a positive 402 * integer which are used for determine if this proposal is more 403 * relevant than another proposal. This value can only be used 404 * for compare relevance. A proposal is more relevant than 405 * another if his relevance value is higher. 406 */ acceptModifier(char[] modifierName, int completionStart, int completionEnd, int relevance)407 void acceptModifier(char[] modifierName, int completionStart, 408 int completionEnd, int relevance); 409 410 /** 411 * Code assist notification of a package completion. 412 * 413 * @param packageName 414 * The package name. 415 * @param completionName 416 * The completion for the package. Can include '.*;' for imports. 417 * @param completionStart 418 * The start position of insertion of the name of this new 419 * package. 420 * @param completionEnd 421 * The end position of insertion of the name of this new package. 422 * @param relevance 423 * The relevance of the completion proposal It is a positive 424 * integer which are used for determine if this proposal is more 425 * relevant than another proposal. This value can only be used 426 * for compare relevance. A proposal is more relevant than 427 * another if his relevance value is higher. 428 * 429 * NOTE - All package names are presented in their readable form: Package 430 * names are in the form "a.b.c". The default package is represented by an 431 * empty array. 432 */ acceptPackage(char[] packageName, char[] completionName, int completionStart, int completionEnd, int relevance)433 void acceptPackage(char[] packageName, char[] completionName, 434 int completionStart, int completionEnd, int relevance); 435 436 /** 437 * Code assist notification of a type completion. 438 * 439 * @param packageName 440 * Declaring package name of the type. 441 * @param typeName 442 * Name of the type. 443 * @param completionName 444 * The completion for the type. Can include ';' for imported 445 * types. 446 * @param completionStart 447 * The start position of insertion of the name of the type. 448 * @param completionEnd 449 * The end position of insertion of the name of the type. 450 * @param relevance 451 * The relevance of the completion proposal It is a positive 452 * integer which are used for determine if this proposal is more 453 * relevant than another proposal. This value can only be used 454 * for compare relevance. A proposal is more relevant than 455 * another if his relevance value is higher. 456 * 457 * NOTE - All package and type names are presented in their readable form: 458 * Package names are in the form "a.b.c". Nested type names are in the 459 * qualified form "A.M". The default package is represented by an empty 460 * array. 461 */ acceptType(char[] packageName, char[] typeName, char[] completionName, int completionStart, int completionEnd, int relevance)462 void acceptType(char[] packageName, char[] typeName, char[] completionName, 463 int completionStart, int completionEnd, int relevance); 464 465 /** 466 * Code assist notification of a variable name completion. 467 * 468 * @param typePackageName 469 * Name of the package in which the type of this variable is 470 * declared. 471 * @param typeName 472 * Name of the type of this variable. 473 * @param name 474 * Name of the variable. 475 * @param completionName 476 * The completion for the variable. 477 * @param completionStart 478 * The start position of insertion of the name of this variable. 479 * @param completionEnd 480 * The end position of insertion of the name of this variable. 481 * @param relevance 482 * The relevance of the completion proposal It is a positive 483 * integer which are used for determine if this proposal is more 484 * relevant than another proposal. This value can only be used 485 * for compare relevance. A proposal is more relevant than 486 * another if his relevance value is higher. 487 * 488 * NOTE - All package and type names are presented in their readable form: 489 * Package names are in the form "a.b.c". Base types are in the form "int" 490 * or "boolean". Array types are in the qualified form "M[]" or "int[]". 491 * Nested type names are in the qualified form "A.M". The default package is 492 * represented by an empty array. 493 */ acceptVariableName(char[] typePackageName, char[] typeName, char[] name, char[] completionName, int completionStart, int completionEnd, int relevance)494 void acceptVariableName(char[] typePackageName, char[] typeName, 495 char[] name, char[] completionName, int completionStart, 496 int completionEnd, int relevance); 497 } 498