04.17.08
Posted in Eclipse, robobait at 1:43 pm by ducky
Eclipse has incremental find!
Control-J will let you start typing to find the next occurrence of what you’re looking for; Shift-Control-J will do incremental find backwards. See Erik’s nice writeup on incremental find…
Permalink
03.17.08
Posted in Eclipse, robobait at 2:34 pm by ducky
I’ve got two cool tricks for you today. Control-O opens up a “quick” view of the Outline View. Instead of looking in a separate pane, you can do it right inline. Furthermore, it has incremental search built in, so you can type a few letters to find methods that start with those letters. If you type in the normal Outline View, it will find the first method that starts with those letters but will continue to show you all the methods.
In the Quick Outline View, it will show only the methods that start with what you typed, so if you type “set”, the quick outline view will only show you setFoo(), setBar(), etc.
But wait, it gets cooler: you can use wildcards in the Quick Outline View and you can’t in the Outline View. For example, in the Quick Outline View, you can type “*Foo” to find getFoo(), setFoo(), etc.
But wait! It gets even cooler! If you have the Quick Outline View up and type control-O again, then it will show you the inherited methods as well as the ones in this class. Totally sweet.
Permalink
03.14.08
Posted in Eclipse, robobait at 9:35 pm by ducky
Several of the users in my study have complained about “tab spam” in Eclipse — having so many files open (at one tab per file) that they can’t keep track of them all.
If you want to limit the number of tabs in Eclipse that you have open at any one time, you can do this:
- go to Window->Preferences->General->Editors,
- put a check in the Close Editors automatically
- and select the number of editors (tabs) that you want open at once.
If you don’t want a tab to be reused, you can “pin” it. (On my toolbar, the “pin this” icon is at the far right, just to the right of the forward arrow, and has a little white-window-with-blue-taskbar underneath a green pushpin.)
This still cycles through editors, eliminating the least-recently-used, but at least you won’t get tab spam.
If you reuse editors, it is handy to use the Auto-Pin Editor Tabs Tweaklet. With that tweaklet installed, Eclipse will not reuse an editor (i.e. a tab) if the file within is dirty. (This will save you a bunch of annoying messages about needing to save files.) If all of the tabs are pinned, it will open a new one.
Permalink
03.13.08
Posted in Eclipse, robobait at 4:27 pm by ducky
One of my user study subjects pulled out a keyboard shortcut that I had never seen before: control-shift-u.
I didn’t get to talk to him about it much, but it pops up a menu with Identifier, Implementing Methods, and Throwing Exception options.
The Identifier seems to find occurrences of that Java element in this file. I guess you could do almost the same thing if you do a FileSearch for a element’s name in one particular file, but that would be a lot more work.
For the Implementing Methods selection, it appears to tell you which methods in this file override/implement methods in the type you had selected. (Note that the type needs to be something right after the keywords “extends” or “implements”. If not, you will get an error message “Cannot search for current selection. Please select a type behind ‘implements’ or ‘extends’.”
You can select an exception (e.g. IOException), press control-shift-u, and select Throwing Exception in order to see which lines of source cause that exception to be thrown. Maybe you knew that read() threw an IOException, but if you didn’t realize that skip() also throws an IOException; this would show you not just that skip() was what was throwing the exception, but the exact line where it was doing so.
Permalink
03.12.08
Posted in Eclipse, programmer productivity, robobait at 10:38 pm by ducky
Cool!
I am doing a observational study of people using Eclipse, and I saw one of the users doing something that looked really useful.
If you hover over a Java element (type, method, or field), then you see the Javadocs for that element. Yeah, old news. You do that seventy times per day already.
If you shift-hover over a Java element, then it shows you the method’s source intead of the Javadocs!
This is a great way to get a peek down a navigation path before commiting to it.
Permalink
03.11.08
Posted in Hacking, robobait at 9:24 am by ducky
To turn off the sound on a ThinkPad running Windows XP:
Start->
Control Panel->
Adjust the system volume ->
In the Device volume area in the middle of the Volume tab, click on Advanced. I know, I know, it looks like you are adjusting speaker volume, but go ahead and do it.
If the microphone doesn’t show up as one of the devices, select the menu item Options->Properties and put a check in the Microphone box.
In the microphone sub-panel, put a check in the Mute box.
(I am soooo not a Windows person…)
Permalink
02.24.08
Posted in robobait at 11:28 am by ducky
I always forget how to do this, and it is incredibly handy…
I frequently want to munge a bunch of files up, and afterwards, change its extension. So for example, I want to do something like
cat a.xml | ./xml2html > a.html
cat b.xml | ./xml2html > b.html
(etc)
It is really easy to just tack something onto the end in bash:
for x in *.xml; do echo $x; cat $x | ./xml2html > $x.html; done
but that will give me ugly files like a.xml.html, b.xml.html, etc.
The basename command to the rescue!
for x in *.xml; do echo $x; cat $x | ./xml2html > `basename $x .xml`.html; done
(Note1: I like to always to an echo $x as the only part of the for loop to make sure I’m only getting files I mean to.)
(Note2: Yes, yes, xargs is apossibility, but I don’t know off the top of my head how to keep the pipe in the command executed by xargs, and not have the pipe get the output of the xargs. Maybe someday I’ll figure out how to do that and post a robobait on that as well.)
Permalink
02.08.08
Posted in programmer productivity, robobait at 12:34 pm by ducky
Frequently, I use the robobait tag to say, “this is something that I know right now that I want to be able to find again in the future”. This robobait tag, by contrast means, “This is something that I think more people should know about. Yo, search engines! Give this page a higher ranking!”
Evan Robinson wrote an article about output as a function of hours per week that draws upon historical research. It says that working a lot is a bad idea.
Permalink
01.27.08
Posted in robobait at 1:32 pm by ducky
About once every six months, I ask myself, “What process has this file open?” (Usually it’s related to “why isn’t my sound playing?)
There is a Linux command-line utility that will tell me which processes have which files open, but it always takes me a little while to find it again. How do I find its name? What do I search for? “process file open”? “which program is using which file”?
So. The utility is named “lsof” (list open files). Now maybe next time it won’t take so long to find it.
Permalink
08.17.07
Posted in Eclipse, Hacking, robobait at 10:40 am by ducky
It took me way longer than it should have to get setup for my current project. I need to change some very fundamental behaviours of Eclipse. There is a plugin that does 80% of what I want, so I need to modify it.
I checked the plugin out of Eclipse’s CVS, but I couldn’t get at the Eclipse source (e.g. when I tried to do F3 or control-click on a class or method). I tried downloading the entire Eclipse source, but
- I got tons of errors because the projects weren’t set up right to refer to each other, and setting them up by hand would have been a nightmare.
- Everything got dog-slow.
SOLUTION
It turns out that I needed to first download the plugin from CVS, then convert it to a plug-in project. (Right-click on the project, then select PDE Tools, then select Convert Projects to Plug-in Projects.)
That gave me access to a lot of source, but not all of what I needed. To get other source, I needed to do
File -> Import -> Plugin&Fragments -> Project with source folder
then select the packages that I wanted the source for, Add, and then Finish.
Keywords: eclipse development, all eclipse source, attach source eclipse
Permalink
« Previous entries