-
Notifications
You must be signed in to change notification settings - Fork 10
technologyEclipse
Guide created on 6th March 2014
with Eclipse Version 4.3.1
.
If you have trouble following the introductions, make sure your Eclipse is up to date.
Plugins can be installed in 3 Different ways:
-
Your Distributions Package Manager
This is the preferred way. To check if your distro hosts a package for the plugin do a simple search with your distros package manager (e.g. search for "eclipse maven").
-
Eclise Marketplace
The easiest way to install new plugins. Open the Marketplace (
Help -> Marketplace
), search for your plugin, and hit install.The Marketplace might not be available in your Eclipse installation. To install it:
Help -> Install new Software...
- Select
All Available Site
in theWork with
drop-down menu. - Wait for the list of software to populate; sometimes it takes a very long time.
- Expand the
General Purpose Tools
group, and tickMarketplace Client
. - Click
Next
, accept the terms and conditions and clickFinish
.
-
Update site
This way should work for all plugins and distros.
Help -> Install new Software...
- Click
Add...
in top right - Paste Plugin Update Site into
Location
, clickOk
. - Select plugins you want to install, hit
Next
, accept terms and conditions and clickFinish
.
-
m2e (Eclipse Maven Integration)
Update site: http://download.eclipse.org/technology/m2e/releases
-
EGit (Eclipse Git Integration)
Update site: http://download.eclipse.org/egit/updates
-
Freemarker IDE part of JBoss Tools (Eclipse Freemarker Integration)
Update site: http://download.jboss.org/jbosstools/updates/development/kepler/
-
Update site: http://ifedorenko.github.com/m2e-extras/
-
LESS Syntax Highlighting & Checker
Update Site http://www.normalesup.org/~simonet/soft/ow/update/
-
debugging with jetty we use this eclipse plugin https://github.com/ifedorenko/com.ifedorenko.m2e.sourcelookup which was recommended by http://stackoverflow.com/questions/9474981/java-debugging-source-not-found/11452410#11452410 Update Site http://ifedorenko.github.io/m2e-extras/
-
Vrapper - Vim like editing mode for Eclipse.
-
Papyrus - Actually good UML editor running on Eclipse.
- Checkout the source code, for example:
git clone https://github.com/renepickhardt/metalcon.git
git checkout feature/middleware
- Start a new Project:
File -> New -> Java Project
- Uncheck
Use default location
-
Browse
to source directory. - Click
Next
andFinish
until done.
- If the code is built with Maven (most likely is)
Right-click Project -> Configure -> Convert to Maven Project
- If you wish* to use Git Integration
Right-click Project -> Team -> Share Project -> Use Parent Folder
-
You can download preconfigured eclipse project settings containing our coding style. Download this archive extract it and place the folder it contains and place it into your project directory (careful its called
.settings
so its a hidden folder under linux). -
Hierarchical packages
Click downward triangle in top-left of Package Explorer -> Package Representation -> Hierarchical
Greatly helps with browsing large code bases, as packages are no longer listed flat, but the hierarchical structure can easily be understood.
-
Window -> Preferences
-
General -> Editors -> Text Editors
-
Set
Display tab width
to4
.4 characters deep indentation is standard in the Java world.
-
Check
Insert spaces for tabs
.Spaces for tabs is the only way to have consistent indentation across multiple platforms.
-
Check
Show print margin
, and setPrint margin column
to80
.Limiting line width to 80, enables side by side code comparison, and allows to work with small monitors. For a discussion on this topic see: Stackoverflow: Is there valid reason for enforcing a maximum width of 80 characters?
-
Check
Show line numbers
.
-
-
General -> Workspace
-
Check
Text file encoding
to beUTF-8
. -
Check
New text file line delimiter
to beUnix
.UTF-8 and Unix newlines are project standards. These settings are required for you to not mess up the code base.
-
-
Java -> Editor -> Folding
-
Check
Enable Folding
.Allows you to fold code sections or comments to have an easier overview over your code.
-
-
Maven
-
Check
Download Artifact JavaDoc
.Makes sure JavaDoc works for maven dependencies.
-
Maven -> User Interface
-
Check
Open XML page in the POM editor by default
.If you editor your
pom.xml
in Eclipse you might prefer this settings, as I find the standard Maven Pom-Overview to be useless.
-
-
-
XML -> XML Files -> Editor
- Set
line width
to80
. - Check
indent using spaces
.
- Set
-
-
Set up your settings according to the Metalcon-StyleGuide.
- Code completion for most languages while editing Code with
Ctrl+Space
- Multiple Editor panes
- Drag Code editors or files into different panes for side by side viewing.
- Duplicate Editor with
Window -> New Editor
.
- Hovering over an Identifier for some time gives JavaDoc-Tooltip (or
F2
) -
Ctrl+Click
over an Identifier takes you to definition (orF3
) - Rightclick on an error indicated by eclipse in your code, opens quickfix, a list of probable fixes.
-
Alt+Up/Down-Arrow
- Move selected code up/down. -
Ctrl+1
- Quickfix -
Ctrl+Shift+R
- Open Resource -
Ctrl+Shift+T
- Open Type
-
Right-click -> Source
- Indent selected lines with
Tab
, unindent withShift+Tab
. - (Un-) Comment selected lines (
Ctrl+Shift+C
orStrg+/
). - Generate Getters and Setters
- Indent selected lines with
-
Right-click -> Refactor
- Rename any identifier (
Alt+Shift+R
) - Move a class to another location (Drag & Drop in Package Explorer or
Ctrl+Alt+V
)
- Rename any identifier (
Click on right border with line numbers -> Toggle Breakpoint
- Execute Debug Run (
F11
) - Allows to see current variable values.
- Allows to do step-by-step execution.
- Allows to follow program path.
- When changing something Maven related (for example, editing pom.xml):
Right-click Project -> Maven -> Update Project
(orAlt+F5
). - Run Maven build from Eclipse:
Right-click Project -> Run As -> Maven ...
.
- Little yellow icon in bottom left of file icon tells us this file is stored in git repository.
- A ">" in front of a file name indicates a not-yet-committed file change.
- Git related stuff are best done on command line for better overview (pushing, pulling, etc.)
- Actually useful features:
Right-click on anything (project or file) -> Team -> Show In History
-
Right-click on files in history ->
Compare with Workspace
Compare with Version in Ancestor
- Show annotations (can be clicked)