A Few Words on the State of Grep Console Development

It’s been a while since I’ve posted an update or new information on Grep Console. There are two main reasons for that.

First, I have several other projects I’m interested in working on, so as long as Grep Console isn’t in immediate need of maintenance, I try to spend my time and energy on those.

However, over the last few months, I’ve become somewhat unhappy with some points in Grep Console which I’d like to improve. Also, I’ve received a couple of suggestions for features and improvements which would be nice to have in a new version. Here’s where the second reason comes into play.

Several of these features simply aren’t compatible with the current structure of the Grep Console code base. The only way I can see to add them is to reimplement the whole thing, which of course takes considerably more time, which in turn distracts me even more from my other projects.

Nevertheless, I’ve decided a while ago to do this, and have been working on and off on it over the summer. I keep getting distracted by work and other things, so I haven’t yet gotten as far as I’d like. But since I’ve planned to write this post for quite some time, and have also neglected to reply to emails regarding Grep Console during this time until I had all the information collected and ready to post, I think it’s time for a status update.

Please excuse my non-replies to your reports and suggestions. If you sent me an email, forgive me if I haven’t replied; I wanted to wait until I actually had something to report, which turned out to take considerably longer than expected. I hope all questions are covered in this post. Feel free to comment if you have further questions or suggestions.

Features

A number of features may be part of the new release, partly based on my own thoughts about what wasn’t quite right with previous versions, and partly based on your suggestions. Not all of these features might actually make into the release, depending on how complex they turn out to be (Eclipse’s APIs can be a serious handicap at times).

  • Expression sets
  • Line filtering directly in the console view
  • Support for multiple console views
  • Highlighting also in text editors
  • Expression conditions
  • Dynamic colours

Expression Sets

The main idea here is to make Grep Console quicker and easier to use if you have a lot of projects in your Eclipse workspace. I’ve found that I tend to amass expression items until the list gets too confusing to maintain. At that point, I just start logging my debug messages on the warn, error and fatal levels so they’re caught my my default expressions. Obviously not what I had in mind when I created Grep Console, and it messes up my logs and requires me to go through all my log statements before a release.

With expression sets, the actual expression items will still be held in one large pool of folders and items. However, expression sets can be created which contain only those items which should be active at a given time. These expression sets can be named and also organised in folders, and can be simply switched with a drop down menu in the console view. This also makes it possible to switch between two or more expression sets on the fly.

Line Filtering Directly in the Console View

When I wrote the first version of Grep Console, the initial idea was to simply filter out certain lines from the console view. When this turned out to be (much more) complicated than I’d hoped, I switched to highlighting matching lines instead, which was pretty much directly supported by Eclipse.

The Grep View introduced in a later version was my first attempt at actually filtering lines. It’s rather cumbersome to use, though – in fact, I rarely use it myself. What I really need is what my original idea was: Filtering right there in the console view.

This is also one of the reasons why the old code base won’t do anymore: So far, Grep Console is mostly based on Eclipse’s line listeners, which can change the style of individual console lines as they are displayed. But for actual filtering, I have to directly change the console model whenever new lines are logged.

After lots of playing and hacking with the Eclipse console code, I have what seems to be a working prototype of this. It will be one of the central features of the new version, and it can be toggled quickly with a drop down menu in the console view.

Support for Multiple Console Views

This feature was requested a while ago and isn’t possible with the current code base, which relies too extensively on singletons. Since much of Grep Console’s functionality is invoked from listeners to Eclipse events, it’s sometimes pretty convoluted to get to a global registry or console settings without singletons, but the new version should be ready for this.

Highlighting Also in Text Editors

Also a requested features, and again I have a working (if rough) prototype. Obviously, line filtering and events like popup notifications don’t make a much sense in this context, but line highlighting does, and works in my current development version, more or less. I still need to get a grip on Eclipse’s editor updates (Eclipse often only refreshes part of the editor view, leaving the rest out of date with the new styles) and find a way to smoothly integrate the necessary controls in the editor GUI.

Expression Conditions

These will allow expression items to influence each other, e.g. to have three items A, B and C, where A and B match the beginning and end of a certain block in your console output, and C is to be used on the lines in between, but not on anything outside that block.

For this feature, expression items will be able to set variables depending on the lines they match, and other items can use conditions on these items to determine whether they are active.

This is another feature that can only work with the new code base, because it requires Grep Console to analyse every line in order to determine which items should be active for a new line, something that can’t be done with the existing code which only reacts to lines as they are displayed.

What makes it more tricky is to determine how simple/complex defining these conditions and variable assignments should be for the feature to make sense without the code to get more complicated than necessary.

Dynamic Colours

Another requested feature, and one I’m not yet sure how to solve, more from a GUI standpoint than from the model or logic code. The idea is to style a line not using the colours from a predefined style, but instead to take the colours from the strings captured by the line’s regular expression.

Release Date

Unknown. It will be ready when it’s ready, which is a boring and clichéd thing to say, but the only promise I can make at this point. I was hoping development would go faster than it has so far, but perhaps this update will also help me get more focused and ignore the distractions better. I’d like to get this ready sooner rather than later, not least because I’d like to get back to my other projects.

Icons

A few users have mentioned that the current icon is too non-specific and can look like an error indicator. I’d be happy to switch to a new icon with the new version, the only problem is: The current icon presents the extent of my skills with modern graphic tools. I used to be much better in the low res days of pixel graphics, but my Gimp skills are basic at best (and my Photoshop skills are non-existent).

If anyone wants a new icon enough to design it yourself and contribute it to the project, I’ll gladly accept it (if I like it and I think it represents Grep Console well), and give you full credit of course.

Otherwise, we’ll all just have to keep living with the current icon.

Conclusion

Long story short, a new version is coming, with some (I believe) exciting features, but it’s coming slowly. I hope this status update answers any questions you may have for now. If not, feel free to post in the comments below.

Posted in Grep Console | Tagged , | Leave a comment

SWT GTK Bug Affecting Grep Console

If you are using Grep Console with Eclipse Mars on a Linux system, you might have faced a strange issue: In certain versions of GTK, the Manage Expressions dialogue is empty – or rather, it shows the tree node expansion icons and the icons for enabling the individual expressions, but the labels and colour preview boxes are gone.

The reason for this is that with Eclipse Mars, SWT has switched from using GTK2 to using GTK3 by default. The GTK3 implementation of SWT still has some problems though, and one of them seems to be that the paint() method of an OwnerDrawLabelProvider is never called on some systems.

I’ve been able to reproduce this issue with Ubuntu 14.10, which uses libgtk3 3.12.2. The labels and icons do show up for me in Ubuntu 15.04 (with libgtk3 3.14.13), though there are some scaling issues there.

I’ve filed a bug report in the official Eclipse bug tracker. In the mean time, the best workaround is to tell Eclipse to use libgtk2. In fact, this may fix some other graphics issues as well. Andrey Loskutov describes how to do this:

Either call Eclipse with the shell variable SWT_GTK3 set to 0, e.g. like this:

SWT_GTK3=0 ./eclipse

Or change your eclipse.ini by adding two lines:

--launcher.GTK_version
2

Thanks to Florian Weitling and Marco for reporting this issue.

Posted in Eclipse, Grep Console | Tagged , , , | 2 Comments

Grep Console 3.7, Clippets 2.0 and Quick Bookmarks 1.3.1

New updates for Grep Console, Clippets and Quick Bookmarks are ready, somewhat delayed due to work and some technical problems with my update site (there might be a tutorial blog post on Tycho coming soon). Thanks for all suggestions and bug reports, and sorry if it took a bit longer than expected this time. As always, feedback is welcome.

Grep Console 3.7

This release provides new features and fixes several bugs.

Features:

  • Line length margins in preview – The console preview in the expression management and editing dialogues now show the currently configured style and filter match line length limits as coloured vertical lines. A warning is shown when one or more lines in the preview console exceeds one of these limits. Thanks to @nfonrose for suggesting this feature.
  • Output to Eclipse’s error log – Matched lines can now be written to Eclipse’s error log using one of the standard error levels. Thanks to Michael Schaefer for suggesting this feature.
  • Support for message consoles – Previously, only process consoles were directly supported. Message consoles are Eclipse’s more generic type of consoles.

Bug fixes:

  • Dynamic handling of newline delimiters – Grep Console can now handle mixed newline delimiters (e.g. Windows and UNIX style newlines) within the same console. Previously this caused problems with filtering and highlighting. Specifically, this should now make Grep Console work correctly with PyDev on Windows systems. Thanks to Luke Hughes for reporting this bug.
  • Eclipse’s own console stylings off by one character – Previously, Grep Console broke the styles applied by Eclipse itself to certain console lines by shifting the style ranges e.g. of underlined exception locations by one character. Thanks to Sam Hasler for reporting this bug.
  • Repeated popup notifications – When changing Grep Console’s settings, popup notifications that had already been shown would be repeated.

For installation instructions, please see here.

Clippets 2.0

This release provides new features and fixes several bugs.

Features:

  • Reordering Clippets – Clippet collections can be configured to automatically move a clippet to the top of the collection whenever it is recalled.
  • Tags – Curly brace tags can be used in clippets to include custom content whenever the clippet is recalled. When recalling a clippet containing such tags, the user will be prompted with a dialogue for entering the content for the tags. Certain predefined live tags can be replaced automatically without user intervention, e.g. by the name or path of the current file.

Bug fixes:

  • Java 6 Support – Though the source code has always been Java 6 compliant, previous versions specified Java 7 as a plug-in requirement. Thanks to Robert Mark Bram for reporting this bug.
  • Reversed clippets order when restoring settings – When reloading clippets (e.g. after restarting Eclipse), the order of clippets within collections would be reversed.
  • Newlines get lost in settings – Clippets always supported content with newlines, but previous versions would break the newlines when restoring the settings.

For installation instructions, please see here.

Quick Bookmarks 1.3.1

This is a service release fixing the the following bug:

  • Quickmark command crashes on Juno – Pressing Alt+Home caused an endless recursion in Eclipse Juno. Thanks to Roman Geraschenko for reporting this bug.

For installation instructions, please see here.

A word on German translations

In the past I’ve provided German translations for all my plug-ins. However, I doubt that many people, even among my German users, actually install them – I know I don’t, as I like to keep my development tools set to English, finding German translations in general (and therefore, by necessity, my own as well) clumsy and a waste of screen estate (German terms often being significantly longer than their English counterparts).

Therefore, and as creating and updating the translations is quite a bit of effort, I have decided to stop maintaining them. Starting with these releases, you will no longer find German translation packages on my update site.

The plug-ins themselves remain internationalised of course. That is, all display strings are kept in properties files which can be changed or replaced with different languages. For example, if you embed these plug-ins in your own internationalised products, you are of course free to provide your own translations along with them as well.

Posted in Clippets, Grep Console, Quick Bookmarks | Tagged , , , , | 1 Comment

New Quick Bookmarks Release 1.3

Version 1.3 of Quick Bookmarks is out, providing the following new features:

  • Shortcuts for navigation across files: In addition to the the keyboard shortcuts for navigation between bookmarks in the current file (Alt+PgUp/PgDn by default), shortcuts for navigation through all bookmarks in the current project and the current workspace are now available. Bookmark navigation across the entire workspace is bound to Alt+Shift+PgUp/PgDn by default. Thanks to David Ei and LarsWH for suggesting this feature.
  • Quickmarks: Alt+Home will set a quickmark at the current position. Pressing Alt+Home again will jump back to the quickmark and delete it.
  • Jump to file: Pressing Shift+Return (or using the context menu) in the bookmark popup dialogue can be used to jump to the file containing the selected bookmark without changing the cursor position in that file.
  • Sort bookmarks list by resource: The bookmark popup dialogue’s context menu can now be used to switch between ordering bookmarks chronologically (the standard behaviour) and sorting them by resource.

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

Posted in Quick Bookmarks | Tagged , , , | Leave a comment

New Quick Bookmarks Release 1.2

Version 1.2 of Quick Bookmarks introduces a few new features.

A third page was added to the popup dialogue listing all bookmarks from the workspaces. The selected bookmark list in the dialogue is now remembered even when restarting Eclipse.

Bookmarks store the editor type they were set in. For example, when opening an HTML file in a text editor and setting a bookmark, then reopening the same file in browser mode, jumping to the bookmark will jump to the text editor instead of the browser.

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

Posted in Quick Bookmarks | Tagged , , , | Leave a comment

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.

Posted in Quick Bookmarks | Tagged , , , | 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.

Posted in Uncategorized | Tagged , , , | 1 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.

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.

Posted in Android, Uncategorized | Tagged , , | 108 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!

Posted in Clippets, Grep Console, Tail Console | Tagged , , , | Leave a comment