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

Wednesday, 15 July 2015

Eclipse Code Template


I came across importing same stuff frequently. I thought of creating the shortcut for this.
Then I found eclipse is good in providing this kind of stuff.

The stuff  I want to import are Logger from SLF4J, for this we have to import slf4j and lo4j api in our class.Which is irritating stuff to type everytime while creating new class.

Eclipse already have code templates which some of them are shown below:










Now we will  create a code template which will show as above

Solution:

Window->Preferences->Java -> Editor -> Templates
 
 
you Will see below :






Click on "New" 



Enter template Name as "slf4j" 
Write description
Add Patteren given below in the box.

Click OK.


For SLF4J:

${:import(org.slf4j.Logger,org.slf4j.LoggerFactory,org.slf4j.Logger,org.slf4j.Logger)}
private static final Logger LOGGER = LoggerFactory.getLogger(${enclosing_type}.class);


For Log4J:

${:import(org.apache.log4j.Logger)}
private static final Logger LOG = Logger.getLogger(${enclosing_type}.class);



Now you will see the slf4j code template in your eclipse .
 Start Typing sl and CTRL+SPACE. you will...like this..:-)





























Saturday, 30 June 2012

How to add SVN-Subclipse plugin to Eclipse

Normally we have two plugins available in the market for eclipse IDE.
 1. Subclipse-Developed by SVN
 2. Subversive-Developed by Eclipse

Better you can go for Tortoise SVN latest release 1.7 which is more improved version .

I prefer Subclipse which will be more user friendly one than other.

 How it add SVN -Subclipse plugin to Eclipse:

 Changelog: http://subclipse.tigris.org/subclipse_1.8.x/changes.html
 Eclipse update site URL: http://subclipse.tigris.org/update_1.8.x
Zipped downloads: http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240

 Ref: http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA


If you want to link Eclipse SVN with Local Tortoise SVN installation then you can go for
SVN Interface Client  javaHL (JNI) (1.7.4)


Restart Eclipse after installing everything.