You are viewing our Forum Archives. To view or take place in current topics click here.
[Java] Comment/Notification for class creation
Posted:

[Java] Comment/Notification for class creationPosted:

-Deano
  • Spooky Poster
Status: Offline
Joined: Aug 19, 201013Year Member
Posts: 5,238
Reputation Power: 532
Status: Offline
Joined: Aug 19, 201013Year Member
Posts: 5,238
Reputation Power: 532
Hi.

I'm currently wanting to add a auto-displaying comment type thing for my classes in Java (using eclipse)

An example of what I mean is when you go to use a function and it auto-generates what you need to fill in.
e.g

Customer customer = new Customer();

will instead show

Customer customer = new Customer( arg1, arg2, arg3);

which the user has to fill in.

Anyone that knows how I can do this/what to do to achieve this, letting me know will be greatly appreciated!

#2. Posted:
ObscureCoder
  • Resident Elite
Status: Offline
Joined: Jun 29, 201310Year Member
Posts: 211
Reputation Power: 13
Status: Offline
Joined: Jun 29, 201310Year Member
Posts: 211
Reputation Power: 13
Ctrl + SPACE shows suggestions in Eclipse.
#3. Posted:
-iMod
  • Resident Elite
Status: Offline
Joined: Jan 09, 201113Year Member
Posts: 238
Reputation Power: 9
Status: Offline
Joined: Jan 09, 201113Year Member
Posts: 238
Reputation Power: 9
It sounds likes what you're talking about is a constructor with parameters?

All you need to do is in the Customer class create a constructor

So:

Public Customer(arg1, arg2, arg3)
{

}


Then fill in what you want to do in the brackets.
#4. Posted:
MrDice
  • 2 Million
Status: Offline
Joined: Apr 24, 201113Year Member
Posts: 522
Reputation Power: 22
Status: Offline
Joined: Apr 24, 201113Year Member
Posts: 522
Reputation Power: 22
Still need help on this, im a java programmer trying to solve some problems online for experience, let me know! thanks!
#5. Posted:
-Deano
  • Spooky Poster
Status: Offline
Joined: Aug 19, 201013Year Member
Posts: 5,238
Reputation Power: 532
Status: Offline
Joined: Aug 19, 201013Year Member
Posts: 5,238
Reputation Power: 532
cerebus19 at 12:59 PM on September 25, 2006 wrote
Have you tried hitting Ctrl-Space? That's the auto-complete invoker for Eclipse, in case it doesn't happen by itself.

You can also go to Window->Preferences->Java->Editor->Content Assist, and ensure the checkboxes for both "Fill argument names on completion" and "Guess filled method arguments" are checked. I'm particularly fond of the method argument guessing, whereby it will try to figure out what you were planning to pass for each parameter. It's not always right, of course, but it's usually at least helpful.


This is more useful information I found online.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.