26
Using Eclipse for Java Using Eclipse for Java 1/1

Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Using Eclipse for Java

Using Eclipse for Java 1 / 1

Page 2: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Using Eclipse IDE for Java Development

I Download the latest version of Eclipse (Eclipse for JavaDevelopers or the Standard version) from the website:http://www.eclipse.org.

I Available for MS Windows, Linux and Mac OS X. We mustfirst install Java Development Kit (JDK). See the following linkon how to install and setup the Java JDK on your computer.Installing JDK on Windows/Mac

I Eclipse is already installed in the onyx lab. There should be aneclipse icon on your desktop. Or just type eclipse on theconsole prompt.

I Eclipse comes with built-in tutorials and extensive help. Manygood tutorials can also be found on the web.

Using Eclipse for Java 2 / 1

Page 3: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Using Eclipse IDE for Java Development

I Download the latest version of Eclipse (Eclipse for JavaDevelopers or the Standard version) from the website:http://www.eclipse.org.

I Available for MS Windows, Linux and Mac OS X. We mustfirst install Java Development Kit (JDK). See the following linkon how to install and setup the Java JDK on your computer.Installing JDK on Windows/Mac

I Eclipse is already installed in the onyx lab. There should be aneclipse icon on your desktop. Or just type eclipse on theconsole prompt.

I Eclipse comes with built-in tutorials and extensive help. Manygood tutorials can also be found on the web.

Using Eclipse for Java 2 / 1

Page 4: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Using Eclipse IDE for Java Development

I Download the latest version of Eclipse (Eclipse for JavaDevelopers or the Standard version) from the website:http://www.eclipse.org.

I Available for MS Windows, Linux and Mac OS X. We mustfirst install Java Development Kit (JDK). See the following linkon how to install and setup the Java JDK on your computer.Installing JDK on Windows/Mac

I Eclipse is already installed in the onyx lab. There should be aneclipse icon on your desktop. Or just type eclipse on theconsole prompt.

I Eclipse comes with built-in tutorials and extensive help. Manygood tutorials can also be found on the web.

Using Eclipse for Java 2 / 1

Page 5: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Using Eclipse IDE for Java Development

I Download the latest version of Eclipse (Eclipse for JavaDevelopers or the Standard version) from the website:http://www.eclipse.org.

I Available for MS Windows, Linux and Mac OS X. We mustfirst install Java Development Kit (JDK). See the following linkon how to install and setup the Java JDK on your computer.Installing JDK on Windows/Mac

I Eclipse is already installed in the onyx lab. There should be aneclipse icon on your desktop. Or just type eclipse on theconsole prompt.

I Eclipse comes with built-in tutorials and extensive help. Manygood tutorials can also be found on the web.

Using Eclipse for Java 2 / 1

Page 6: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Creating a new Java Project

I Click on File → New → Java project.

I Choose the name of the project. Check the box labeled Usedefault location if it isn’t already checked. Eclipse creates afolder under your default workspace folder with the same nameas the project.

I Next choose the option Use project folder as root for sourceand class files. We recommend that you configure that asdefault for this semester by clicking on the Configure defaultlink. Select Next to go to the next window. Then select Finishat the bottom to finish creating the project.

I To create a new class file, right click on the Package Explorerpane (on the left) and choose New → Class. Make sure thefield labeled Package is blank. Add a name for the class. Clickon the box for adding a main method if you want one in thatclass.

Using Eclipse for Java 3 / 1

Page 7: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Creating a new Java Project

I Click on File → New → Java project.I Choose the name of the project. Check the box labeled Use

default location if it isn’t already checked. Eclipse creates afolder under your default workspace folder with the same nameas the project.

I Next choose the option Use project folder as root for sourceand class files. We recommend that you configure that asdefault for this semester by clicking on the Configure defaultlink. Select Next to go to the next window. Then select Finishat the bottom to finish creating the project.

I To create a new class file, right click on the Package Explorerpane (on the left) and choose New → Class. Make sure thefield labeled Package is blank. Add a name for the class. Clickon the box for adding a main method if you want one in thatclass.

Using Eclipse for Java 3 / 1

Page 8: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Creating a new Java Project

I Click on File → New → Java project.I Choose the name of the project. Check the box labeled Use

default location if it isn’t already checked. Eclipse creates afolder under your default workspace folder with the same nameas the project.

I Next choose the option Use project folder as root for sourceand class files. We recommend that you configure that asdefault for this semester by clicking on the Configure defaultlink. Select Next to go to the next window. Then select Finishat the bottom to finish creating the project.

I To create a new class file, right click on the Package Explorerpane (on the left) and choose New → Class. Make sure thefield labeled Package is blank. Add a name for the class. Clickon the box for adding a main method if you want one in thatclass.

Using Eclipse for Java 3 / 1

Page 9: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Creating a new Java Project

I Click on File → New → Java project.I Choose the name of the project. Check the box labeled Use

default location if it isn’t already checked. Eclipse creates afolder under your default workspace folder with the same nameas the project.

I Next choose the option Use project folder as root for sourceand class files. We recommend that you configure that asdefault for this semester by clicking on the Configure defaultlink. Select Next to go to the next window. Then select Finishat the bottom to finish creating the project.

I To create a new class file, right click on the Package Explorerpane (on the left) and choose New → Class. Make sure thefield labeled Package is blank. Add a name for the class. Clickon the box for adding a main method if you want one in thatclass.

Using Eclipse for Java 3 / 1

Page 10: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Importing Existing Java Classes into Eclipse

Suppose you have an exisiting Java program in a folder. Then youcan bring it into Eclipse two different ways.

I Import existing files into Eclipse project. Create a newJava project in Eclipse. Click inside the project on the leftpane. Then select Import... and then General and then FileSystem. Then browse to the folder that contains your Javafiles and select the ones you want to import into your project.This will make a copy of those files into your eclipse workspacefolder for the new project.

I Create Eclipse project in existing folder. Create a newJava project in Eclipse. Uncheck the option Use defaultlocation and browse to the folder that contains your Java files.Then select Finish and now an Eclipse project has beencreated into your pre-existing folder!

Using Eclipse for Java 4 / 1

Page 11: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Importing Existing Java Classes into Eclipse

Suppose you have an exisiting Java program in a folder. Then youcan bring it into Eclipse two different ways.

I Import existing files into Eclipse project. Create a newJava project in Eclipse. Click inside the project on the leftpane. Then select Import... and then General and then FileSystem. Then browse to the folder that contains your Javafiles and select the ones you want to import into your project.This will make a copy of those files into your eclipse workspacefolder for the new project.

I Create Eclipse project in existing folder. Create a newJava project in Eclipse. Uncheck the option Use defaultlocation and browse to the folder that contains your Java files.Then select Finish and now an Eclipse project has beencreated into your pre-existing folder!

Using Eclipse for Java 4 / 1

Page 12: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Building, Running and Debugging a New Project

I Every time you save your Java class file, Eclipse automaticallycompiles it for you.

I To run your Java program inside Eclipse, click on the play buttonicon or click on the Run menu and then choose Run (keyboardshortcut: Ctrl-F11 on Windows and Linux, Shift-Cmd-F11 onMac OS X)

I To customize how a program runs, click on Run → RunConfigurations. Then a new window pops up that allows youcreate and manage run/debug configurations. For example,command line arguments can be set in the Arguments tab.

I You can also run your Java program from the console directly bygoing to the folder in the workspace that contains your projectand using the java command. You would also submit yourassignment from the project folder.

I Note that if you change your Eclipse project files from outsideEclipse, you will have to refresh your files from inside the eclipsefor it to see the changes. Use F5 key to refresh your Eclipseproject.

Using Eclipse for Java 5 / 1

Page 13: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Building, Running and Debugging a New Project

I Every time you save your Java class file, Eclipse automaticallycompiles it for you.

I To run your Java program inside Eclipse, click on the play buttonicon or click on the Run menu and then choose Run (keyboardshortcut: Ctrl-F11 on Windows and Linux, Shift-Cmd-F11 onMac OS X)

I To customize how a program runs, click on Run → RunConfigurations. Then a new window pops up that allows youcreate and manage run/debug configurations. For example,command line arguments can be set in the Arguments tab.

I You can also run your Java program from the console directly bygoing to the folder in the workspace that contains your projectand using the java command. You would also submit yourassignment from the project folder.

I Note that if you change your Eclipse project files from outsideEclipse, you will have to refresh your files from inside the eclipsefor it to see the changes. Use F5 key to refresh your Eclipseproject.

Using Eclipse for Java 5 / 1

Page 14: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Building, Running and Debugging a New Project

I Every time you save your Java class file, Eclipse automaticallycompiles it for you.

I To run your Java program inside Eclipse, click on the play buttonicon or click on the Run menu and then choose Run (keyboardshortcut: Ctrl-F11 on Windows and Linux, Shift-Cmd-F11 onMac OS X)

I To customize how a program runs, click on Run → RunConfigurations. Then a new window pops up that allows youcreate and manage run/debug configurations. For example,command line arguments can be set in the Arguments tab.

I You can also run your Java program from the console directly bygoing to the folder in the workspace that contains your projectand using the java command. You would also submit yourassignment from the project folder.

I Note that if you change your Eclipse project files from outsideEclipse, you will have to refresh your files from inside the eclipsefor it to see the changes. Use F5 key to refresh your Eclipseproject.

Using Eclipse for Java 5 / 1

Page 15: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Building, Running and Debugging a New Project

I Every time you save your Java class file, Eclipse automaticallycompiles it for you.

I To run your Java program inside Eclipse, click on the play buttonicon or click on the Run menu and then choose Run (keyboardshortcut: Ctrl-F11 on Windows and Linux, Shift-Cmd-F11 onMac OS X)

I To customize how a program runs, click on Run → RunConfigurations. Then a new window pops up that allows youcreate and manage run/debug configurations. For example,command line arguments can be set in the Arguments tab.

I You can also run your Java program from the console directly bygoing to the folder in the workspace that contains your projectand using the java command. You would also submit yourassignment from the project folder.

I Note that if you change your Eclipse project files from outsideEclipse, you will have to refresh your files from inside the eclipsefor it to see the changes. Use F5 key to refresh your Eclipseproject.

Using Eclipse for Java 5 / 1

Page 16: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Building, Running and Debugging a New Project

I Every time you save your Java class file, Eclipse automaticallycompiles it for you.

I To run your Java program inside Eclipse, click on the play buttonicon or click on the Run menu and then choose Run (keyboardshortcut: Ctrl-F11 on Windows and Linux, Shift-Cmd-F11 onMac OS X)

I To customize how a program runs, click on Run → RunConfigurations. Then a new window pops up that allows youcreate and manage run/debug configurations. For example,command line arguments can be set in the Arguments tab.

I You can also run your Java program from the console directly bygoing to the folder in the workspace that contains your projectand using the java command. You would also submit yourassignment from the project folder.

I Note that if you change your Eclipse project files from outsideEclipse, you will have to refresh your files from inside the eclipsefor it to see the changes. Use F5 key to refresh your Eclipseproject.

Using Eclipse for Java 5 / 1

Page 17: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Handy Tips (1)

I Content Assist. Use the keys Ctrl-Space to ask for help with functionnames, arguments and other topical content assistance.

I Cool trick! Type syso and then type Ctrl-Space and it willauto-complete to System.out.println();

I Word Completion. Use the keys Alt-/ to complete words after youtype in the first few characters. Very useful to avoid having to typelong variable or function names. Faster than Ctrl-Space but onlymatches in the current file.

I Quick Fix menu. Hover your mouse over an error and a quick fix menudrops down. Often the first suggestion will fix your error correctly! Itwill also help you find and insert the correct import statements whenyou use classes from the Java library.

I Refactoring . Refactoring allows you to change identifiers in your codein an intelligent fashion. The Refactor menu will check and changethe identifiers in all locations and files for you! The Refactor menu hasa lot more so explore away....

I Use Shift-Alt-R on selected identifier allows you to quickly renameand refactor that identifier (variable, method or class).

Using Eclipse for Java 6 / 1

Page 18: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Handy Tips (1)

I Content Assist. Use the keys Ctrl-Space to ask for help with functionnames, arguments and other topical content assistance.

I Cool trick! Type syso and then type Ctrl-Space and it willauto-complete to System.out.println();

I Word Completion. Use the keys Alt-/ to complete words after youtype in the first few characters. Very useful to avoid having to typelong variable or function names. Faster than Ctrl-Space but onlymatches in the current file.

I Quick Fix menu. Hover your mouse over an error and a quick fix menudrops down. Often the first suggestion will fix your error correctly! Itwill also help you find and insert the correct import statements whenyou use classes from the Java library.

I Refactoring . Refactoring allows you to change identifiers in your codein an intelligent fashion. The Refactor menu will check and changethe identifiers in all locations and files for you! The Refactor menu hasa lot more so explore away....

I Use Shift-Alt-R on selected identifier allows you to quickly renameand refactor that identifier (variable, method or class).

Using Eclipse for Java 6 / 1

Page 19: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Handy Tips (1)

I Content Assist. Use the keys Ctrl-Space to ask for help with functionnames, arguments and other topical content assistance.

I Cool trick! Type syso and then type Ctrl-Space and it willauto-complete to System.out.println();

I Word Completion. Use the keys Alt-/ to complete words after youtype in the first few characters. Very useful to avoid having to typelong variable or function names. Faster than Ctrl-Space but onlymatches in the current file.

I Quick Fix menu. Hover your mouse over an error and a quick fix menudrops down. Often the first suggestion will fix your error correctly! Itwill also help you find and insert the correct import statements whenyou use classes from the Java library.

I Refactoring . Refactoring allows you to change identifiers in your codein an intelligent fashion. The Refactor menu will check and changethe identifiers in all locations and files for you! The Refactor menu hasa lot more so explore away....

I Use Shift-Alt-R on selected identifier allows you to quickly renameand refactor that identifier (variable, method or class).

Using Eclipse for Java 6 / 1

Page 20: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Handy Tips (1)

I Content Assist. Use the keys Ctrl-Space to ask for help with functionnames, arguments and other topical content assistance.

I Cool trick! Type syso and then type Ctrl-Space and it willauto-complete to System.out.println();

I Word Completion. Use the keys Alt-/ to complete words after youtype in the first few characters. Very useful to avoid having to typelong variable or function names. Faster than Ctrl-Space but onlymatches in the current file.

I Quick Fix menu. Hover your mouse over an error and a quick fix menudrops down. Often the first suggestion will fix your error correctly! Itwill also help you find and insert the correct import statements whenyou use classes from the Java library.

I Refactoring . Refactoring allows you to change identifiers in your codein an intelligent fashion. The Refactor menu will check and changethe identifiers in all locations and files for you! The Refactor menu hasa lot more so explore away....

I Use Shift-Alt-R on selected identifier allows you to quickly renameand refactor that identifier (variable, method or class).

Using Eclipse for Java 6 / 1

Page 21: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Handy Tips (1)

I Content Assist. Use the keys Ctrl-Space to ask for help with functionnames, arguments and other topical content assistance.

I Cool trick! Type syso and then type Ctrl-Space and it willauto-complete to System.out.println();

I Word Completion. Use the keys Alt-/ to complete words after youtype in the first few characters. Very useful to avoid having to typelong variable or function names. Faster than Ctrl-Space but onlymatches in the current file.

I Quick Fix menu. Hover your mouse over an error and a quick fix menudrops down. Often the first suggestion will fix your error correctly! Itwill also help you find and insert the correct import statements whenyou use classes from the Java library.

I Refactoring . Refactoring allows you to change identifiers in your codein an intelligent fashion. The Refactor menu will check and changethe identifiers in all locations and files for you! The Refactor menu hasa lot more so explore away....

I Use Shift-Alt-R on selected identifier allows you to quickly renameand refactor that identifier (variable, method or class).

Using Eclipse for Java 6 / 1

Page 22: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Handy Tips (1)

I Content Assist. Use the keys Ctrl-Space to ask for help with functionnames, arguments and other topical content assistance.

I Cool trick! Type syso and then type Ctrl-Space and it willauto-complete to System.out.println();

I Word Completion. Use the keys Alt-/ to complete words after youtype in the first few characters. Very useful to avoid having to typelong variable or function names. Faster than Ctrl-Space but onlymatches in the current file.

I Quick Fix menu. Hover your mouse over an error and a quick fix menudrops down. Often the first suggestion will fix your error correctly! Itwill also help you find and insert the correct import statements whenyou use classes from the Java library.

I Refactoring . Refactoring allows you to change identifiers in your codein an intelligent fashion. The Refactor menu will check and changethe identifiers in all locations and files for you! The Refactor menu hasa lot more so explore away....

I Use Shift-Alt-R on selected identifier allows you to quickly renameand refactor that identifier (variable, method or class).

Using Eclipse for Java 6 / 1

Page 23: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Handy Tips (1)

I Content Assist. Use the keys Ctrl-Space to ask for help with functionnames, arguments and other topical content assistance.

I Cool trick! Type syso and then type Ctrl-Space and it willauto-complete to System.out.println();

I Word Completion. Use the keys Alt-/ to complete words after youtype in the first few characters. Very useful to avoid having to typelong variable or function names. Faster than Ctrl-Space but onlymatches in the current file.

I Quick Fix menu. Hover your mouse over an error and a quick fix menudrops down. Often the first suggestion will fix your error correctly! Itwill also help you find and insert the correct import statements whenyou use classes from the Java library.

I Refactoring . Refactoring allows you to change identifiers in your codein an intelligent fashion. The Refactor menu will check and changethe identifiers in all locations and files for you! The Refactor menu hasa lot more so explore away....

I Use Shift-Alt-R on selected identifier allows you to quickly renameand refactor that identifier (variable, method or class).

Using Eclipse for Java 6 / 1

Page 24: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Handy Tips (2)

I Automatic Javadoc comment templates. Check options underthe Source menu for options to automatically generate javadoccomments for classes and methods. The keyboard shortcut isShift-Alt-J. Type that after selecting the method or theclass.

I Commenting your code. Check the Toggle Comment optionunder the Source menu to automatically comment selectedparts of your program! The keyboard shortcut isShift-Ctrl-C. Type that after selecting the code you want tocomment.

I Formatting your program. Check the Format option under theSource menu to automatically nicely format selected parts ofyour program! The keyboard shortcut is Shift-Ctrl-F. Typethat after selecting the code you want to format. Or select thewhole program with Ctrl-a and then format it.

Using Eclipse for Java 7 / 1

Page 25: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Handy Tips (2)

I Automatic Javadoc comment templates. Check options underthe Source menu for options to automatically generate javadoccomments for classes and methods. The keyboard shortcut isShift-Alt-J. Type that after selecting the method or theclass.

I Commenting your code. Check the Toggle Comment optionunder the Source menu to automatically comment selectedparts of your program! The keyboard shortcut isShift-Ctrl-C. Type that after selecting the code you want tocomment.

I Formatting your program. Check the Format option under theSource menu to automatically nicely format selected parts ofyour program! The keyboard shortcut is Shift-Ctrl-F. Typethat after selecting the code you want to format. Or select thewhole program with Ctrl-a and then format it.

Using Eclipse for Java 7 / 1

Page 26: Using Eclipse for Javacs.boisestate.edu/~mvail/121/slides/eclipse.pdf · Handy Tips (1) I ContentAssist. UsethekeysCtrl-Spacetoaskforhelpwithfunction names,argumentsandothertopicalcontentassistance

Handy Tips (2)

I Automatic Javadoc comment templates. Check options underthe Source menu for options to automatically generate javadoccomments for classes and methods. The keyboard shortcut isShift-Alt-J. Type that after selecting the method or theclass.

I Commenting your code. Check the Toggle Comment optionunder the Source menu to automatically comment selectedparts of your program! The keyboard shortcut isShift-Ctrl-C. Type that after selecting the code you want tocomment.

I Formatting your program. Check the Format option under theSource menu to automatically nicely format selected parts ofyour program! The keyboard shortcut is Shift-Ctrl-F. Typethat after selecting the code you want to format. Or select thewhole program with Ctrl-a and then format it.

Using Eclipse for Java 7 / 1