Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Wednesday 25 September 2013

How to run JSF2.0 on Eclipse IDE

// siddhu vydyabhushana // Leave a Comment
In Eclipse Ganymede (v3.4) or Galileo (v3.5), it supports until JSF 1.2 only. For JSF 2.0, upgrade your Eclipse to version Helios (v3.6) onward, it has full support of Java EE 6 support, including JSF 2.0.
Here’s a quick guide to show you how to enable JSF 2.0 features like code assist and visual JSF component editor in Eclipse IDE.
Tools Used
  1. Eclipse 3.6
  2. JSF 2.0.x

1. Eclipse Project Facets

To support JSF 2.0, you need to configure Eclipse project to support Web Tools Platform (WTP).
Steps to enable the Web Tools Platform (WTP) :
  1. Right click on the project, choose “properties” –> “Project Facets“.
  2. Check “Dynamic Web Module“, select version 2.5.
  3. Check “Java“, choose version 1.6.
  4. Check “JavaServer Faces“, choose version 2.0.
    eclipse-jsf-support
  5. Click on the “further configuration…” link below to do the JSF configuration.
  6. Create an user library and include the JSF 2.0 API and implementation libraries, jsf-api-xxx.jar and jsf-impl-xxx.jar.
    P.S You can get the JSF jars official JSF website.

    2. Demo

    Now, Eclipse IDE is supporting the JSF 2.0 capabilities. Try it, in .xhtml file, click on the “Ctrl + Space“, it will prompts all available JSF 2.0 tags (code assist) automatically.
    Furthermore, it add JSF 2.0 visual components to the web page editor as well, see figure below :
    eclipse-jsf-support
    eclipse-jsf-support
Read More

Monday 22 July 2013

Eclipse Shortcuts

// siddhu vydyabhushana // 1 comment
Editors are an integral part of a programmer’s life. If you have good proficiency in using an editor thats a great advantage. It comes very handy to debug. Traditional notepad and SOPs (System.out.println) are the way we start learning a language but that is not sufficient, so beginners start using an IDE and most importantly know the shortcuts.
For java developers there is a huge list and some popular areEclipse, Netbeans, IntelliJ Idea. I use Eclipse as my IDE and vim as a light weight editor.
This article is for those who use or intend to use Eclipse as IDE. Keyboard shortcuts are very important for comfortable and quick editing. I have abridged the following list of eclipse shortcuts from my own experience and literature.
There is a huge list of eclipse shortcuts available but I have listed only the most essential ones that you may need daily. Download this list as a pdf formatted for single page.

File Navigation – Eclipse Shortcuts

  • CTRL SHIFT R – Open a resource. You need not know the path and just part of the file name is enough.
  • CTRL E – Open a file (editor) from within the list of all open files.
  • CTRL PAGE UP or PAGE DOWN – Navigate to previous or next file from within the list of all open files.
  • ALT <- or ALT -> – Go to previous or next edit positions from editor history list.

Java Editing – Eclipse Shortcuts

  • CTRL SPACE – Type assist
  • CTRL SHIFT F – Format code.
  • CTRL O – List all methods of the class and again CTRL O lists including inherited methods.
  • CTRL SHIFT O – Organize imports.
  • CTRL SHIFT U – Find reference in file.
  • CTRL / – Comment a line.
  • F3 – Go to the declaration of the variable.
  • F4 – Show type hierarchy of on a class.
  • CTRL T – Show inheritance tree of current token.
  • SHIFT F2 – Show Javadoc for current element.
  • ALT SHIFT Z – Enclose block in try-catch.

    General Editing – Eclipse Shortcuts

    • F12 – Focus on current editor.
    • CTRL L – Go to line number.
    • CTRL D – Delete a line.
    • CTRL <- or -> – Move one element left or right.
    • CTRL M – Maximize editor.
    • CTRL SHIFT P – Go to the matching parenthesis.

    Debug, Run – Eclipse Shortcuts

    • CTRL . or , – Navigate to next or previous error.
    • F5 – Step into.
    • F6 – Step over.
    • F8 – Resume
    • CTRL Q – Inspect.
    • CTRL F11 – Run last run program.
    • CTRL 1 – Quick fix code.

    Search – Eclipse Shortcuts

    • CTRL SHIFT G – Search for current cursor positioned word reference in workspace
    • CTRL H – Java search in workspace.
    Download eclipse shortcuts list as a single page pdf. You can stick it for quick reference in your workstation.
Read More