New Quick Bookmarks Release 1.1

Version 1.1 of Quick Bookmarks adds a popup dialogue listing the most recently used bookmarks:

Quick BookmarksThe dialogue is triggered via Alt+End and can be navigated with the cursor keys. Selecting a bookmark and pressing Return jumps directly to the bookmark and also moves it to the top of the list.

For installation instructions, please see here. As always, feedback is welcome.

82c98e1f0639dffcd15a104c4e27fb9c
Share via email Share
Posted in Uncategorized | Leave a comment

New Eclipse Plug-in: Quick Bookmarks

For years I’ve been missing simple bookmarks in Eclipse – bookmarks that can be quickly toggled and navigated via the keyboard, like I remember them from Delphi all those years ago.

Now I decided to do something against it and wrote another simple plug-in: Quick Bookmarks.

It doesn’t do much – just provide a keyboard shortcut to add or remove a bookmark from the current editor line, and two shortcuts to jump to the previous or next bookmark relative to the current line. The bookmarks created by the plug-in are sub types of the standard Eclipse bookmarks, but you don’t have to enter a name every time you create a new bookmark.

Feedback, as always, is welcome.

185332b4a5c4049b885212c4b25b845e
Share via email Share
Posted in Uncategorized | Tagged , , , | Leave a comment

New Releases

Over the past weeks I’ve made several bug fixes to Grep Console and Tail Console. In the case of Clippets, I’ve added new few features.

Grep Console’s popup notification implementation is now also used by Clippets and therefore has been moved to its own plug-in. Eclipse will automatically install the new plug-in when installing or updating to the latest versions.

As always, feedback is welcome.

Grep Console 3.6.1

This is a bugfix release, containing the following fixes:

  • Disablement of items not stored – Disabled items were enabled again after reloading the configuration. Folderes were unaffected. Thanks to Thomas Widmaier for reporting this bug.
  • Wrong style ranges for overlapping highlighting styles – Overlapping styles ended one character too early, leaving the last matched character unstyled. Thanks to 赛文思 for reporting this bug.
  • File link path and base dir not handled correctly – Absolute file paths were not recognised correctly and would always be prefixed with the base directory. Some Eclipse variables return file: URIs. These are now automatically converted to regular file paths. Thanks to 赛文思 for reporting this bug.

For installation instructions, please see here.

Clippets 1.1.0

This is a feature release, containing the following improvements:

  • Styles – Clippets can now be assigned styles to change the foreground and background colours shown in clippet lists.
  • Clippet collection memory – The clippet selection popup by default now opens with the last clippet collection that was selected. Changing the collection also updates the Clippet View. Both features can be deactivated in the preferences.
  • Popup notifications – To provide feedback with some of the “blind” actions (e.g. recalling clippets via keyboard shorcuts), certain actions now trigger notification popup notifications. These popups can be disabled in the preferences.
  • Inserting clippets – A new action (triggered e.g. by double clicking a clippet) directly inserts the selected clippet into the current editor without changing the clipboard content. Thanks to Robert Mark Bram for suggesting this feature.
  • Store to selection in popup – Pressing Shift+Enter in the clippet storing popup dialogue now stores the clipboard content into the selected clippet. Thanks to Robert Mark Bram for suggesting this feature.

For installation instructions, please see here.

Tail Console 1.0.1:

This is a bugfix release, containing the following fix:

  • Launch configuration icon – The launch configuration was missing an icon.

For installation instructions, please see here.

Popup Notifications 1.0:

This is a helper plug-in. It doesn’t offer any active end user features on its own. Instead, it provides an API to display popup notifications that automatically disappear after a short moment. The plug-in is used by both Grep Console and Clippets and may be used in other projects under the terms of the Eclipse Public Licence.

For more info, please see here.

96e18b949a334578cbf90e5428003da6
Share via email Share
Posted in Clippets, Eclipse, Grep Console, Tail Console | Tagged , , , , , | Leave a comment

Remote control your Android phone through adb

I wrecked my phone the other day:

Broken PhoneDoesn’t look so bad, but in fact the touch screen is completely dead. So not only do I now have to decide whether to get a new phone or try to replace the screen myself, I also had to find a way to regain control over the phone so I could backup my data.

A bluetooth mouse would be one way to control the phone without the touch screen, but I don’t have one – and even if I did, I didn’t have bluetooth turned on (though that could apparently be accomplished through the console).

A USB keyboard would also be of help if the Nexus 4 had USB Host support. Sadly, unlike the Nexus 5 (and the Nexus 1, if I recall correctly), doesn’t.

What else then? A series of internet searches yielded the following results:

  1. There’s a ton of remote control apps for Android (as was to be expected). Most require root though. Those that don’t generally can’t control the touchscreen/mouse. And even they generally require some setup steps before they can be used – back to the start.
  2. adb (the Android Debug Bridge, part of the SDK tools) provides shell access to the phone via USB. And the shell has commands to simulate key presses and touch events. Touch events require the exact screen coordinates as numbers, so as a standalone solution that’s still rather tedious.
  3. There are ways to get screenshots from an Android phone through adb – obviously; after all, even the official Eclipse plug-ins provide a screenshot feature.
  4. A combination of points 2 and 3 would be a way to actually simulate touch events in a useful manner. Astonishingly though, nobody seems to have written such a tool.

So what does a programmer to when the obvious tool doesn’t yet exist? Write it himself, of course.

ADB Control

I spent yesterday evening hacking together a crude Java tool to serve as a primitive remote control through an Android phone. I present it here in case someone else might face the same problem I did. It requires no extra software installed on the phone, just a USB connection and the Java tool (Java 7 required) and SDK tools installed on the computer. It uses adb access to the phone – meaning that you have to have the SDK tools installed and you have to have already confirmed the USB debug connection on your phone earlier. If you didn’t, connecting the phone will open a confirmation dialogue on the phone – and without a touchscreen, you obviously won’t be able to confirm it. But if you’re a programmer like me and have already access the phone via adb before, all you have to do is fire up the tool on the computer. I won’t get into how to setup and configure adb here – please check the official docs if necessary.

The tool does the following:

  • Repeatedly grab a screenshot from the phone and display it in a Window
  • Capture keyboard events and forward them to the phone
  • Capture mouse clicks and drags and forward them to the phone

It’s slow as hell (everything is being done through shell calls, which makes the screenshot updates particularly slow), but it works.

Before you first start it, make sure you have adb installed and modify the config file provided with the download. It contains four settings:

  • adbCommand – the full path to the adb tool as a shell command. Linux users note that Java doesn’t seem like the ~ character in file paths to access the home directory.
  • screenshotDelay – the delay (in milliseconds) between displaying a screenshot and grabbing the next one. Note that the actual grabbing process will probably take considerably longer than this delay, so the update rate will be slower.
  • localImageFilePath – the tool has to download the image file from the phone. This path tells it where to store the file on the local system before displaying it.
  • phoneImageFilePath – the location on the phone where the screenshot file is stored before downloading it.

Once the configuration is done, simply run the tool like this:

java -jar adbcontrol.jar

If you put the config file in a different directory, you can add the path to it as an option after the jar file name.

Here’s what it looks like:

ADB ControlIn the window, you can single click to send a tap event or click-drag to send a swipe event to the phone. Pressing a number or letter key (or anything else that produces an ASCII character between 33 and 127) will send that key press to the phone. Additionally, the following keys are forwarded:

  • Enter
  • Escape – as the Back key on Android
  • Home
  • Backspace
  • Cursor keys

Download

The download includes the full source code and is provided under the Eclipse Public Licence.




In case you find this tool useful, please consider donating – after all, I only wrote it because I wrecked my phone.

3c79ebe22acefd9649ff9a23c21f8563
Share via email Share
Posted in Android, Uncategorized | Tagged , , | 2 Comments

New Grep Console Release 3.6 and two new Eclipse plug-ins

It’s been a while since the last update, but there finally is a new version of Grep Console, providing bug fixes and a new feature.

Features:

  • Statistics – Expression occurences can be counted and displayed in a separate view. Also, the last match for an expression can be displayed in the same view. Based on a feature suggestion by Frank Musolf.

Bug Fixes:

  • When an item has a null name and expression, the item table throws null pointer exceptions. Reported by Thomas Klimke.
  • Grep View should be cleared when the console is cleared. Reported by Thomas Dutreuilh.

Also, because it has been such a frequent cause of confusion, the default match length for Grep View matching has been increased to 100.

As usual, thanks go to everyone who sent suggestions and bug reports to help continue improving Grep Console.

For installation instructions, please see here. As always, feedback is welcome.

New Plug-in: Tail Console

Jakub Staš suggested allowing Grep View to open random text files. Instead of implementing this as a Grep Console feature, I turned it into a separate plug-in.

Tail ConsoleTail Console can open text files and output them to a new console. Like the GNU command line tool tail, the console will keep monitoring the file and output any new content added to the file live.

Tail Console is fully compatible with Grep Console (in its latest version), so using both plug-ins together, text files can be styled and filtered as usual with Grep Console.

New Plug-in: Clippets

This is based on an idea I’d been thinking about for a long time. Clippets allows you to store the current clipboard text content inside Eclipse, temporarily or permanently, and later recall it directly to the clipboard, allowing you to use the clipboard for other content and then return to the earlier text. These so-called “clippets” can be arranged in collections for better overview.

ClippetsI have several ideas for extending Clippets with advanced features, but before I think about them in detail, I’d like to see what others think about the core functionality – and get used to working with it myself. So if you like the plug-in and have any feedback or feature suggestions, be sure to let me know!

8773a9613018c1c2d5eed1befc76e113
Share via email Share
Posted in Clippets, Grep Console, Tail Console | Tagged , , , | Leave a comment

Flash Builder and Grep Console (video)

Steve Warren has posted a video on using Grep Console in Flash Builder on his blog.

4671e7c9dd5334eb1d6bcb282e5309ce
Share via email Share
Posted in Grep Console | Tagged , , | Leave a comment

Eclipse, CMake and C++11

Getting C++11 to work with CMake is easy. Getting Eclipse to work with a CMake project is easy. Getting Eclipse to work with C++11 also seems to be relatively easy (there are plenty of guides on various wikis).

But getting all three to cooperate nicely is a bit trickier – or rather, the standard Eclipse way to configure C++11 support doesn’t work for CMake projects, and none of the guides I could find at first mentioned that.

It’s perfectly possible to work with a C++11 CMake project in Eclipse without any special settings. Compiling and running the code works fine (as the compiler gets its settings from the CMake config), but the code editor will keep mark various C++11 code bits as errors.

Fortunately, this Stack Overflow post shows how easy it is to fix this for Eclipse Kepler if you just know the right option to set. Simply create your Eclipse project with something like this:

cmake ../my_src_dir -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_VERSION=4.2 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER_ARG1=-std=c++11

The above is for a Linux Make project. For different platforms, change the -G option accordingly. The relevant bit is of course the CMAKE_CXX_COMPILER_ARG1 option.

85b7fbdcd29918fee01a59ac5a76bf90
Share via email Share
Posted in C++11, CMake, Eclipse | Tagged , , | Leave a comment

Bugfix Release: Grep Console 3.5.1

Two bugs were introduced in version 3.5 and have been fixed in service release 3.5.1:

  • Old, close consoles would throw null pointer exceptions when the Grep View filter settings were changed
  • Even if notifications were disabled for an expression item, they would still be triggered when the item filtered lines to the Grep View

For installation instructions, please see here. As always, feedback is welcome.

8773bc16d5a1258c9d85d2bb0a8a7466
Share via email Share
Posted in Grep Console | Tagged , | Leave a comment

Eclipse 4.x tab font sizes in GTK

The Eclipse 4 branch introduced some notable visual changes compared to the previous 3.x releases, like a reliance on more whites than greys. While unexpected at first, most of these changes just take some getting used to. With the exception of the size of the tab title font, that is – on GTK in Linux, tabs are just huge:

Bad tabs (huge).Fortunately, there’s an easy remedy to be found on Stack Overflow. Eclipse’s design is now based on CSS files. For the GTK main layout, the file is $eclipse/plugins/org.eclipse.platform_4.*/css/e4_default_gtk.css, and the CSS responsible for the tab headers is .MPartStack.

A simple change to this class is sufficient to set the tab font size back to normal:

.MPartStack {
/*      font-size: 11;*/
        swt-simple: false;
        swt-mru-visible: false;
}

As you can see, it’s enough to simply comment out the font-size style to set the size back to normal:

Good tabs (normal).

b3b081a10541de2c83018730f797de52
Share via email Share
Posted in Eclipse, Linux | Tagged , , | 2 Comments

Grep Console How-to #8: Notifications

Grep Console 3.5 introduced the notification feature, designed to give you feedback about key information in your Eclipse console even if Eclipse isn’t currently your active window. This article gives an overview of how to use notifications. If you’ve been using previous versions of Grep Console, you can also see the new tabbed interface on the expression dialogue for the first time.

Scenario

Let’s say you have a test case which runs for a while before producing a temporary output file. The path to the output file is written to the console so you can open and verify it. For exactly this situation at work, I’ve been using Grep Console’s link feature to make the file paths clickable and directly view the PDF files created by my test cases.

Our example output looks like this:

Generating output...
Output is ready: /home/grepconsole/temp/demo.pdf

We want to highlight the second line, and turn the path into a link we can click to view the PDF. In addition to that, we want to set up notifications triggered by this line.

Styles and Links

We start by creating a new expression item, using the following expression to capture the path part of all “Output is ready” lines:

\QOutput is ready: \E(\S+)

All other fields on the General tab can be left on the default settings for our purpose. On the Styles & Links tab, we assign a highlight style to the line and a further highlight to the capture group:

We configure highlights for the line and the file path, turn the file path into a link and rename the capture group to "file".

As you can see, we’ve also renamed the capture group to “file” for easier reference (see below in the notifications section) and added a File link to it. The link simply specifies “{group}” as the file path (as we’ve renamed the capture group, we could just as well have specified “{file}” here). This turns the path portion of our output line into a clickable link which will open the referenced file.

Notifications

On the Notifications tab, we configure a popup notification to display a popup message, and a sound notification to play when our test output is ready:

We configure a popup and a sound notification.

The popup notification is set up to use the fixed title “Output” and the message “Output is ready:” followed by the path from our file capture group (which we named “file” in the previous step). Also, we assign the same link action to the notification which we already used in the previous step (you can simply use copy & paste to assign the same link here). Setting this link means that when we click on the popup message, the referenced file will open directly. If we don’t set a link, we can still click on the message – it will simply activate the Eclipse window in this case.

The sound notification is straightforward: We’ve assigned a “click.wav” sound. This sound will play as soon as the output line is written to the console.

Also on this tab, we could specify an autostart action, which is exactly the same feature described in How To #6: Autostart Links. As of Grep Console version 3.5, autostart links have been renamed to autostart actions and moved to the notifications tab.

Result

And this is what it looks like when our demo application finishes:

The popup message can be seen on the lower right.

To the lower right you can see the popup message which you can click to open the output file. Even if your Eclipse window is minimised or in the background, this message will pop up as soon as our demo file is ready. The message will automatically fade out and disappear after a few seconds, unless you move the mouse pointer inside the popup, which will keep it alive until the pointer leaves the popup again.

f284ad9e7bad44d23573377414ca67ca
Share via email Share
Posted in Grep Console | Tagged , | Leave a comment