Skip to main content

Posts

Showing posts with the label Eclipse

Working Set feature in Eclipse and other IDEs

The "Working Set" is a very old feature in Eclipse or other IDEs but there are many folks who don't use it and prefer to hide non-working project(s) by either closing the project(s) itself or deleting those from workspace especially when they have to demo something to someone. It is a super useful feature that lets you group your related projects to ease search and organize views within the IDE. Read here about what it is and how to use it: http://www.avajava.com/tutorials/lessons/what-is-a-working-set-and-how-do-i-use-it.html

Copy paste java code from clipboard to your Eclipse

Small but a cool and an old trick for copy-pasting Java code in Eclipse. I have seen so many folks are still doing this when they want to copy-paste the Java code from the net via clipboard in their Eclipse. >Right click on the target folder where you want clipboard Java code >New >Create Class >Give a name and then finally remove the default code in this class and paste the Java code from their clipboard. You don't need to do all this. Just Right-click on the target folder where you want this Java code and paste from the clipboard or directly CTRL+V. Nice- isn’t it? Sample code: package com.test.apiAutomation.test; import java.util.HashMap; import java.util.Map; import org.testng.annotations.Test; public class TestCopyPaste { @Test public static void testCopyPaste() { Map<String, String> formParams = new HashMap<String, String>(); formParams.put("grant_type", "hey"); System.out.println("It's working, TADA...

Missing javaDoc

What is Javadoc? Javadoc comment explains: - what the class does, its author, and version. - what the method does, its parameter, return value, and thrown exception. Many times, instead of our source code, we share our JAR with the other team members and once they import our JAR into their project and start using it, they either: - Don't see any Javadoc comments for the provided methods and they see this message on hover over- "Note: The Javadoc for this element could neither be found in the attached source nor the attached Javadoc." - OR, they see partial comments as they do see the method params numbers but not the type, etc. How to Fix this error? 1) Make sure that you have JavaDoc in place. To generate Java Doc in Eclipse: – Select the “Generate JavaDoc” option from the Project menu Specify the location for the JavaDoc file on your system Select the project and then the packages/class for which you want to create the JavaDoc file. Then click Next and th...

Eclipse: Refresh workspace automatically

When we run a test case or execute the entire script directly within Eclipse - we would like to see the fresh execution Report or log file or any other refreshed resource but by default, projects don't automatically refresh. I find it very useful to turn on the "Refresh" option so that Eclipse can automatically perform the refresh. This option is shown below: Windows-->Preferences->General-->Workspace-->Select "Refresh using native hooks or polling" I wonder why this preference isn't selected by default when it's very friendly. Check this out to find the difference between "Refresh using native hooks or polling" and "Refresh on access": https://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Freference%2Fref-9.htm Note* Have heard that at times it does require force refresh on Mac especially with Mars and lesser versions.