Do you hang out in IRC channels often? And do you use pastebin.com or other services to show the users snippets of your source code that illustrates a problem you have? Then you no longer need to switch between your Eclipse IDE, a webbrowser and the IRC chat window.
A small solution that can save time
I have finished today the first alpha version of a small Eclipse Plugin that adds a new menu and toolbar button to the Eclipse Workbench.
In its basic version it allows you to click any resource in the Package/Project Explorer and copies the content of the resource to the pastebin service of your choice. I have created some default configurations for the most used ones. The one working most stable is "pastebin.com". "Codepad.org" is experimental and "pastebin.ca" returns invalid URLs in its JSON response. I have contacted the author of the service already. They merely serve as samples and I am sure most users will just use "pastebin.com". And if you choose to only install one "Target", like "pastebin.com" then there will be no submenu but you can directly select "Copy to pastebin.com" as shown below:
The targets are configurable in the preferences and are persisted in your Eclipse configuration location. That means you do not have to re-configure the targets for each workspace (a feature I would wish for a lot of Eclipse options to be the default).
You can also install the "CopyTo JDT" feature which allows you to copy Java methods or classes from the Outline view, the source editor or the Package Explorer. For "pastebin.com" this will also enable Java syntax highlighting. Since the whole plugin code is available at github others could contribute specialized modules for Ruby, PHP, etc.
After the selected content was sent to the target and the target returned a valid redirection URL (or JSON response, that contains a URL) there are several actions possible. The default action is the "Copy to clipboard" action which is supplied by default.
You can install additional "PasteTo" actions like for direct pasting into your favorite IRC client.
I have implemented support for Eclipse ECF (IRC) Chats (newest ECF 3.2 required) and some experimental for my favorite IRC client that comes with Miranda-IM for Windows. You can see that in action in the video below:
Of course having many actions will slow down your workflow so there will be a mechanism to select a default action and display the dialog only if you hold down the "CTRL" key. If there is only one action available, then no dialog will be displayed. And for the "Copy to clipboard" action you can disable the initial warning it gives you when the clipboard contains (probably) valuable data.
Unfortunately there is no way to get the "CopyTo" menu at a consistent place in popups and main menu. That's because some popup menus do not provide anchors or group-markers. And sometimes the group marker is below the seperator (Text editor popup). If anyone has an idea how to solve that placement problem he can say or change the source :)
Test it out
I am already using the plugin in my daily Eclipse life and if you want to give it a test run you can add the Update URL http://pke.github.com/CopyTo/update/ to your Eclipse Installation. Don't forget to select at least the main feature and the "pastebin.com target". The update manager will warn you that the features are not signed but you can safely ignore the message (if you trust my code :) You need to restart the workbench to get the pastebin.com configuration visible to "CopyTo". That's currently an known issue.
I would like to hear from you, especially if you have suggestions for the workflow.