Code completion assistant [message #64851] |
Tue, 22 January 2008 02:33 |
Eclipse User |
|
|
|
Originally posted by: onkr.op.pl
Hi
Is there a way to tell eclipse that certain variable is actually an
object of class xyz so code completion assistant can suggest methods.
I guess the best way to explain what I'm referring to is an example:
//Class A and B are implementing the same interface or abstract class.
class A extends AbstractClass{
function method1(){...}
function method2(){...}
function method3(){...}
}
class A extends AbstractClass {
function method1(){...}
function method2(){...}
function method3(){...}
}
//Factory class
class FAC{
public static function Create($something){
if($something){
return new A();
}else{
return new B();
}
}
}
$example = FAC::Create(1);
Now when I use $example eclipse code completion assistant is not
suggesting anything to me. Is there a way to tell Eclipse that the
$example is object of class A or B?
Ralph
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03275 seconds