Welcome to this Blog. I am Software Engineer and work for Zühlke Engineering AG in Bern. This is my private blog, in which I will post mainly about technical stuff like Software Engineering or IT related topics. The views expressed herein do not necessarily represent those of my employer.
If you want to learn some shortcuts for a program, the best way is to do this step by step. Also in Eclipse. Today I will show you two important shortcuts, which are useful in very large projects:
use CTRL + SHIFT + T (T like Type) to search a class, interface, and so on. This search supports CamelCase. If a class is called ThisIsMyTestClass, typing of the capital letters also finds this class (just type TIMTC). 
use CTRL + SHIFT + R (R like Resource) to search a ANT build file, text files, ore something like that: 
I got into a situation, in which I had the content of a large XML file in my clipboard. Unfortunately, the whole file didn’t had any breaks, they were all printed as \r\n.
But with Programmer’s Notepad 2 there is a simple solution. In the replace dialog, just enable the option “Allow backslash expression” in the Replace dialog and replace all \r\n in the text with “real” \r\n, which appear as breaks in the text.
In some cases, ANT has it’s limitations. For example, it is not really easy to create an if-else structure or a for-loop. For this reason, a few people started long time ago the Ant-Contrib project. Just download it and put the jar file in the lib folder of the project. Then, just at following line to the build file:
<taskdef resource="net/sf/antcontrib/antcontrib.properties"></taskdef>Now, you can start using constructs like if, foreach and combine these tasks with usual ANT tasks. Here a little example:
with antcontrib:
<target name="theultimateconditionmachine"> <if> <equals arg1="${foo}" arg2="bar" /> <then> <echo message="property foo is bar" /> </then> <else> <echo message="property foo is not bar" /> </else> </if> </target>
without antcontrib:
if you want to perform the same task with ant, you need to create 4 (!) ant targets:
<target name="noway"> <antcall target="conditionIf"/> <antcall target="conditionElse"/> </target> <target name="conditionDef"> <condition property="conditionIsTrue"> <equals arg1="${foo}" arg2="bar"/> </condition> </target> <target name="conditionIf" depends="conditionDef" if="conditionIsTrue"> <echo message="property foo is bar"/> </target> <target name="conditionElse" depends="conditionDef" unless="conditionIsTrue"> <echo message="property foo is not bar"/> </target>
« Newer Posts

