Difference between revisions of "Eclipse Tips"

From CSE231 Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
Eclipse is a very powerful IDE for Java development. You can download it from [https://eclipse.org/downloads/ eclipse.org/downloads]. This page will contain tips for using Eclipse more efficiently in this class.
 
Eclipse is a very powerful IDE for Java development. You can download it from [https://eclipse.org/downloads/ eclipse.org/downloads]. This page will contain tips for using Eclipse more efficiently in this class.
  
==Refresh==
+
=Refresh=
 
Sometimes after you pull from git you will find that your project needs to be refreshed.  The following steps are a bit heavy handed, but often will get your project back up and working again.
 
Sometimes after you pull from git you will find that your project needs to be refreshed.  The following steps are a bit heavy handed, but often will get your project back up and working again.
  
Line 12: Line 12:
 
Note in order to invoke the function keys on some laptops you need to press the Function modifier key.
 
Note in order to invoke the function keys on some laptops you need to press the Function modifier key.
  
==Maven==
+
=Maven=
 
Sometimes refreshing Maven isn't enough.
 
Sometimes refreshing Maven isn't enough.
  
 
[[Maven_Force_Update]]
 
[[Maven_Force_Update]]
  
==Content Assist==
+
=Content Assist=
 
Content assist is amazing.  You should use it.   
 
Content assist is amazing.  You should use it.   
  
===Windows===
+
==Windows==
 
On Windows it is pretty easy.  Just type Ctrl+SPACE.
 
On Windows it is pretty easy.  Just type Ctrl+SPACE.
  
===Mac===
+
==Mac==
 
On the Mac, the Spotlight often masks content assist.  Follow [http://stefaanlippens.net/code_completion_shortcut_eclipse_osx/ this guide] to set up a new keyboard shortcut of your choosing.
 
On the Mac, the Spotlight often masks content assist.  Follow [http://stefaanlippens.net/code_completion_shortcut_eclipse_osx/ this guide] to set up a new keyboard shortcut of your choosing.
  
==Content Assist lambda ()->{}===
+
=Content Assist lambda ()->{}=
 
set up "body" template to produce an empty lambda (see images below)
 
set up "body" template to produce an empty lambda (see images below)
  
Line 45: Line 45:
 
[[File:LambdaTemplate.png]]
 
[[File:LambdaTemplate.png]]
  
==Content Assist async,finish imports===
+
=Content Assist async,finish imports=
 
[[File:V5ImportStaticPreferences.png]]
 
[[File:V5ImportStaticPreferences.png]]
  
Line 52: Line 52:
 
[[File:V5ImportStaticTypeSelection.png]]
 
[[File:V5ImportStaticTypeSelection.png]]
  
==Git==
+
=Git=
  
 
*[http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/tips/eclipse_git/git_menu.html Using the git menu]
 
*[http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/tips/eclipse_git/git_menu.html Using the git menu]
 
**[http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/tips/eclipse_git/enable_git_action_set.html Enable git action set]
 
**[http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/tips/eclipse_git/enable_git_action_set.html Enable git action set]
  
==JDK Setup==
+
=JDK Setup=
  
 
[http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/tips/jdk/ JDK Setup]
 
[http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/tips/jdk/ JDK Setup]
  
==JavaFX Setup==
+
=JavaFX Setup=
 
[http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/setup/JavaFX.html e(fx)clipse Setup]
 
[http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/setup/JavaFX.html e(fx)clipse Setup]
  
==Presentation==
+
=Presentation=
 
[[Hierarchical Package Presentation]]
 
[[Hierarchical Package Presentation]]

Revision as of 02:39, 19 January 2018

Eclipse is a very powerful IDE for Java development. You can download it from eclipse.org/downloads. This page will contain tips for using Eclipse more efficiently in this class.

Refresh

Sometimes after you pull from git you will find that your project needs to be refreshed. The following steps are a bit heavy handed, but often will get your project back up and working again.

Select your project in the package explorer:

  1. "F5" to refresh
  2. "Alt-F5" to refresh Maven
  3. "Project" -> "Clean..." from the menu bar.

Note in order to invoke the function keys on some laptops you need to press the Function modifier key.

Maven

Sometimes refreshing Maven isn't enough.

Maven_Force_Update

Content Assist

Content assist is amazing. You should use it.

Windows

On Windows it is pretty easy. Just type Ctrl+SPACE.

Mac

On the Mac, the Spotlight often masks content assist. Follow this guide to set up a new keyboard shortcut of your choosing.

Content Assist lambda ()->{}

set up "body" template to produce an empty lambda (see images below)

Text for the copy buffer:

() -> {
    ${cursor}
}

example usage:

type async
type ctrl+SPACE (or whatever you have mapped content assist to)
type RIGHT_ARROW
type ctrl+SPACE (or whatever you have mapped content assist to)
type ENTER

TemplatePreferences.png

LambdaTemplate.png

Content Assist async,finish imports

V5ImportStaticPreferences.png

V5ImportStaticNewFavoriteType.png

V5ImportStaticTypeSelection.png

Git

JDK Setup

JDK Setup

JavaFX Setup

e(fx)clipse Setup

Presentation

Hierarchical Package Presentation