Eclipse keyboard shortcuts
Posted on February 24, 2011
|
When I first started working at Intelliware I was amazed at how efficient the
developers were while working in Eclipse. Most of this efficiency and speed
came from a deep knowledge of Eclipse’s keyboard shortcuts.
Here is my list of Eclipse keyboard shortcuts that every developer should
know.
- Ctrl-Shift-L: Show list of shortcuts
- Ctrl-K: Find next
- Ctrl-Shift-R: Open a file in your workspace. It supports CamelCase shorthand too, so “SBFil” will find “SomeBigFile.java” and “SBFile.java”
- Ctrl-Shift-G: Find references for a class or method. Want to find who calls MyClass.getName()? Put your cursor on the getName() definition and hit Ctrl-Shift-G
- F3: Drill into a method. This will jump from the code that calls the method into the method definition. Similar to holding Ctrl and clicking on the method call.
- Ctrl-T: Open implementors of an interface. Very useful when using F3 to follow the flow of method calls.
- Ctrl-O: Open a list of method declarations in the current class. Allows you to jump directly to the method using the arrow keys and enter. Bonus points: typing Ctrl-O again while the list is showing will also list method declarations from all superclasses
- Ctrl-E: Shows a list that allows you to switch between open files
- Alt-Shift-W: Locates the current file in the Navigation or Package Explorer tree.
- Ctrl-L: Go to line number. You might want to show line numbers by default by changing the preference General>Editors>Text Editors
- Ctrl-H: Find a string in all files. You can customize this to only show the File search by clicking the Customize button and unchecking the other options
- Ctrl-Shift-O: Organize import statements. This also removes any unused imports.
- Ctrl-Shift-F: Reformat the file
You should also familiarize yourself with the following debugging shortcuts
[Read More]
Tapestry and JMeter
Posted on November 16, 2010
|
I was recently tasked with setting up some load tests for our Tapestry (4.1.6)
web application. I chose to use Apache JMeter because it is open-source and is
flexible enough to do what we needed, and doesn’t cost $12,000/month like some
load testing tools.
I set up an HTTP Proxy Manager to record a simple navigation through the site
and reconfigured my browser to use the proxy. The proxy recorded the requests
without a hitch.
[Read More]
Life after Java?
Posted on November 13, 2010
|
There has been a lot of talk lately that Java is on its way out, mostly fueled
by Apple deprecatingJava, and by
Apache threateningto quit Java.
I’m not crying Chicken Little just yet, but perhaps it’s time to start looking
for the Next Big Thing. There are certainly a lot of contenders out there:
Ruby (and Rails), Scala, Groovy (and Grails). My guess is there’ll be a
couple of false starts before a clear winner is declared.
[Read More]
Telus fail
Posted on November 6, 2010
|
A few months ago I bought an HTC Desire from Telus. While I loved the phone,
it had problems from the beginning. The keyboard would regularly freeze mid-
email/sms and the only way to revive the device was to pull out the battery
and restart the phone.
It would often reboot when an incoming call was ringing. This is a major
failure for a phone - at the very least it should be able to accept phone
calls.
[Read More]
Personal projects
Posted on October 20, 2010
|
I recently started working on a personal project - a web application - and
faced a difficult decision. What technology stack do I use?
I like my personal projects to both fulfil a requirement and to teach me
something in the process. Java is my native language, so I initially thought
I’d build it in wicket-spring-hibernate.
The problem is that I can only work on the project for a few hours a week, and
I find that developing in Java just takes too long. It’s a big hammer.
[Read More]
Android or iPhone
Posted on August 3, 2010
|
I wanted to learn how to build mobile apps, so last weekend I bought Building
iPhone Apps with HTML, CSS, and JavaScript: Making App Store Apps Without
Objective-C or Cocoa. I
don’t have any problem learning a new language, in fact I really enjoy it, but
I was reluctant to to pay serious dollars for a Mac just to learn the skill.
The book covers how to build a website that is tailored for the iPhone. It
looks and behaves like an iPhone app, but is actually a website. After a few
chapters I started to feel dirty. It documented hack after workaround after
hack.
[Read More]
Tapestry: UpdateComponents, Eventlistener and Script files
Posted on April 10, 2010
|
This week I encountered an interesting issue in Tapestry when I tried to
dynamically load a component using Tapestry’s built-in EventListener
functionality. The component in question had a .script file associated with
it, which Tapestry loaded dynamically, but the JavaScript functions in the
.script file were “not found” when I tried to execute them.
After a bit of digging around, a colleague of mine noticed that Tapestry was
loading the .script file using an eval() statement instead of inserting
the script into the DOM.
[Read More]
Eclipse can't find source when remote debugging
Posted on March 25, 2010
|
I had a problem recently where Eclipse couldn’t find my source files when
remote debugging a particular application. It would stop and the breakpoint
and show the class file with a “attach source” button, but pointing it to the
source directory didn’t do anything.
It turns out that the solution was to add the project to the remote debug
configuration.
This is done by “Run -> Debug configurations…”
Choose the remote config from the tree on the left
Click on the “Source” tab
Click on the “Add…” button
Follow the wizard.
[Read More]
Mercurial changes how you work
Posted on March 9, 2010
|
I’ve recently started using Mercurial, which
is a distributed version control
system.
DVCSs initially struck me as a solution looking for a problem. SubVersion
seemed good enough for our purposes at work, but we decided to try out
Mercurial for one iteration to see what all the fuss was about.
Perhaps the most significant difference between SubVersion and Mercurial is
that Mercurial uses a local repository. This subtle distinction significantly
changes how you work because you can commit your changes without having to
publish them. A ‘commit’ in Mercurial is like a savepoint in database-speak -
it gives you a safe place to roll back to if things go awry. Once you’re happy
with your changes you can use the patch queue to fold all your commits into a
single changeset and ‘push’ (i.e. publish) your changes to the central
repository.
[Read More]
JRebel and Tapestry working together
Posted on February 26, 2010
|
I’ve recently started trialling
JRebel at work. JRebel is a piece of
software that hot-swaps your code so that changes made in your IDE are
reflected in your application server without requiring a restart.
The benefits of this idea are fairly obvious. I no longer have to wait 1 - 2
minutes for JBoss to restart each time I correct a spelling mistake etc. The
time saved by not restarting probably make the product worth the $US149
licensing fee.
[Read More]