FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Autocomplete for Child Classes

 
Post new topic   Reply to topic    NetBeans Forums -> PHP Users
View previous topic :: View next topic  
Author Message
laurin1



Joined: 20 Nov 2008
Posts: 52

PostPosted: Wed Aug 26, 2009 9:48 pm    Post subject: Autocomplete for Child Classes Reply with quote

Is this supposed to work? Also, what is the purpose of defining variable types in comments for objects?

http://www.netbeans.org/kb/docs/php/editorguide.html#vartyp-cmnt

Mine works even without this (except for child classes, of course).

Code:

//************************************************************************************************************
function DemoInfo(){

   global $aDATA;

   $oPrint = new HTML();
   
   $oPrint->sTitle = 'Demographic Information';
   $oPrint->Row('', $oPrint->ItemMid('<div><span class="colleft"><span class="label2">Age:</span>' .
         '<span class="rlong">', 'dem_age', '</span></span>' .
         '<span class="colright"><span class="label2">Gender:</span>' .
         '<span class="rlong">',
         'dem_gender', '</span></span></div>'));
   $oPrint->Row('', $oPrint->ItemMid('<div><span class="colleft">' .
         '<span class="label2">Marital Status:</span>' .
         '<span class="rlong">', 'dem_marital_status', '</span></span>' .
         '<span class="colright"><span class="label2">City, State:</span>' .
         '<span class="rlong">',
         $aDATA['dem_city'].', '.$aDATA['dem_state'], '</span></span></div>'));
   $oPrint->Row('<strong>Cohabitants:</strong> ', $oPrint->CommaSection('dem_cohabitants'));
   $oPrint->Row('', 'dem_comments');

   $oPrint->//THIS WILL SHOW METHODS AND PROPERTIES OF HTML CLASS, EVEN WITHOUT THE COMMENT DEFINTION, BUT NOT FOR THE CHILD CLASS, EVEN WITH IT//
}


So what is the comment definition for?
Back to top
View user's profile Send private message
Tomas Mysik
Posted via mailing list.





PostPosted: Thu Aug 27, 2009 12:17 pm    Post subject: Autocomplete for Child Classes Reply with quote

Hi,

Dne středa 26 srpna 2009 23:48:58 laurin1 napsal(a):
Quote:
Also, what is the purpose of defining variable
types in comments for objects?

consider e.g. this file:

<?php
$myVar-> // invoke code completion here
?>

what should NetBeans offer? There's apparently no chance to find out the type of
$myVar variable. If you add a comment that its type is e.g. MyObject, then you
will have the full code completion. Of course, if the IDE is able to recognize
the variable type, there's no such need to use this hint.

Tomas
--
Tomas Mysik
address-removed
Back to top
laurin1



Joined: 20 Nov 2008
Posts: 52

PostPosted: Thu Aug 27, 2009 1:47 pm    Post subject: Reply with quote

Ah, well, I see now. We never have files that we declare the object in another file. It's declared above in the function or the page, if no function. So that doesn't really do us any benefit. I was just wondering.

Now, what about the child classes?
Back to top
View user's profile Send private message
Tomas Mysik
Posted via mailing list.





PostPosted: Fri Aug 28, 2009 10:46 am    Post subject: Autocomplete for Child Classes Reply with quote

Hi,

Dne čtvrtek 27 srpna 2009 15:47:56 laurin1 napsal(a):
Quote:
Now, what about the child classes?


what exactly do you mean?

Tomas
--
Tomas Mysik
address-removed
Back to top
stewbiff



Joined: 28 Aug 2009
Posts: 1

PostPosted: Fri Aug 28, 2009 1:56 pm    Post subject: Reply with quote

Hai i amvery greatful for the information given here ... Very helpful
_________________
Blues
Back to top
View user's profile Send private message
laurin1



Joined: 20 Nov 2008
Posts: 52

PostPosted: Fri Aug 28, 2009 2:17 pm    Post subject: Reply with quote

When instantiating a child class, NB will Autocomplete the methods of the parent class, but not of the child. ex.

Code:

class Book{

public function Read(){}

public function TurnPage(){}

}

class Page extends Book{


public function TurnPage(){}

}

$oMyBook = new Book();

$oMyBook-> (Shows me Read(), but not TurnPage())
Back to top
View user's profile Send private message
Tomas Mysik
Posted via mailing list.





PostPosted: Fri Aug 28, 2009 2:52 pm    Post subject: Autocomplete for Child Classes Reply with quote

Hi,

Dne pátek 28 srpna 2009 16:17:22 laurin1 napsal(a):
Quote:
[...]
class Page extends Book{
[...]
$oMyBook = new Book();
$oMyBook-> (Shows me Read(), but not TurnPage())

this is all right, in your example, Page extends Book and not vice versa (you
probably want to create a new Page?).

Tomas
--
Tomas Mysik
address-removed
Back to top
laurin1



Joined: 20 Nov 2008
Posts: 52

PostPosted: Fri Aug 28, 2009 2:59 pm    Post subject: Reply with quote

Oops, that was just a mistake in my example:

Code:

$oMyBook = new Page();
$oMyBook-> (Shows me Read(), but not TurnPage())


In my code, it's correct, and it doesn't work. I can see methods from the parent, but not the child.
Back to top
View user's profile Send private message
Tomas Mysik
Posted via mailing list.





PostPosted: Fri Aug 28, 2009 3:16 pm    Post subject: Autocomplete for Child Classes Reply with quote

Hi,

Dne pátek 28 srpna 2009 16:59:27 laurin1 napsal(a):
Quote:
In my code, it's correct, and it doesn't work. I can see methods from the
parent, but not the child.

a sample file you provided before works for me in:

Product Version: NetBeans IDE Dev (Build 090827)
Java: 1.6.0_14; Java HotSpot(TM) 64-Bit Server VM 14.0-b16
System: Linux version 2.6.28-15-generic running on amd64; UTF-8; cs_CZ (nb)

Please, double check your code and then feel free to file an issue [1] against
php/editor (attach a sample file please).

Thanks,
Tomas
[1] http://www.netbeans.org/community/issues
--
Tomas Mysik
address-removed
Back to top
laurin1



Joined: 20 Nov 2008
Posts: 52

PostPosted: Mon Aug 31, 2009 1:34 pm    Post subject: Reply with quote

The child class is in the current file, and the parent is loaded with lazy loading, does that matter? It definitely does not work.
Back to top
View user's profile Send private message
laurin1



Joined: 20 Nov 2008
Posts: 52

PostPosted: Mon Aug 31, 2009 1:36 pm    Post subject: Reply with quote

I just checked, and you are correct, this sample I created does work, but my actual file does not (again, the parent is in another file, loaded by an autoloader.)
Back to top
View user's profile Send private message
laurin1



Joined: 20 Nov 2008
Posts: 52

PostPosted: Mon Aug 31, 2009 1:54 pm    Post subject: Reply with quote

Issue filed

http://www.netbeans.org/issues/show_bug.cgi?id=171178
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> PHP Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB