Version 2.0
Programmers typically rely heavily on the clipboard - frequently, a single clipboard isn't enough. Some desktop systems, like KDE, provide tools to support multiple clipboards, allowing the user to switch between different content previously stored in the clipboard as required.
Clippets provides a similar feature integrated into the Eclipse IDE. Among other things, this means that switching clipboards works in the same way on all platforms supported by Eclipse, which can be useful for developers frequently working on different systems.
One clipboard content item stored by the plug-in is called a "clippet". Clippets can be labelled and arranged in multiple lists called "clippet collections". Individual collections can be marked as persistent, which causes them to be stored permanently so that they are still available when Eclipse is restarted.
The following features have been added to Clippets since the initial release:
Clippet collections can be configured to automatically move a clippet to the top of the collection whenever it is recalled.
Curly brace
Certain predefined
Clippets can be assigned styles to change the foreground and background colours shown in clippet lists.
The clippet selection popup by default opens with the last clippet collection that was selected. Changing the collection also updates the Clippet View.
To provide feedback with some of the "blind" actions (e.g. recalling clippets via keyboard shorcuts), certain actions trigger notification popup notifications.
Double clicking a clippet directly inserts the selected clippet into the current editor without changing the clipboard content.
Pressing
Clippets requires Java 6 and Eclipse 4.2 (Juno) or higher.
To install Clippets from the Update Site, select
http://eclipse.schedenig.name
You can now open the site in the list of available software, check
Clippets and click
The Clippets View allows you to view and manage your clippets. You can open
it from Eclipse's
Clippets are organised in clippet collections. Each collection has a name and a few additional settings. The clippet view always shows the contents of one collection at a time; you can switch between the collections via the tabs at the top of the view. By default, Clippets starts with two collections named "Temporary" and "Persistent".
All modifications you make to clippets and clippet collections, via the Clippet View or global keyboard shortcuts, can be revoked via Eclipse's standard undo/redo actions.
To add a new collection, you can use the "Add collection" action from the view's dropdown menu. Right clicking on of the tabs at the top of the view allows you to edit or delete that specific collection. You can rearrange collections by dragging them to a new position.
The list in the view shows all the clippets in the currently selected collection. The actions in the view's action bar allow you to edit these clippets. A popup menu which appears when you right click on the selected clippets offers more options. You can also rearrange the selected clippets by dragging them to a new position within the list.
The following actions are available:
Recalls the selected clippet by copying its content to the system clipboard.
Stores the current clipboard to a new clippet. The clippet will be added at the top of the clippet collection.
Stores the current clipboard to the selected clippet. The clippet's previous content will be overwritten.
Deletes the selected clipptes.
Opens the Clippet Dialogue for the selected clippet.
Pastes the selected clippet into the current editor. This action can also be triggered by double clicking a clippet.
Allows you to move the selected clippets to a different collection.
Opens the Clippet Collection Dialogue allowing you to create a new clippet collection.
Opens the Clippet Collection Dialogue allowing you to edit the selected collection.
Deletes the selected collection.
Clippet collections are added and edited using the clippet collection dialogue:
The following properties can be configured for a clippet collection:
The name for the clippet collection, as displayed in the clippets view and clippet selection dialogues.
Whether the collection retains its clippets after you exit Eclipse. Non persistent collections will be empty when you start Eclipse.
If this is set, the clippet collection will not grow longer than the specified maximum length. If adding new clippets results in the collection containing more clippets than specified here, clippets will be dropped from the end of the list until the collection no longer exceeds the maximum length.
If this option is enabled, clippets in this collection will be moved to the top of the collection automatically whenever they are recalled.
Clippets are edited using the clippet dialogue:
The following properties can be configured for a clippet:
An optional name for the clippet. If this is specified, the name will be used to represent the clippet in lists. Otherwise, the clippet's content will be displayed instead.
The clippet's text content as a multi line string. When hovering over this edit field, a tooltip will show a list of all available live tags, along with descriptions.
Allows you to select a keyboard shortcut to quickly access the clippet in the clippet dialogue..
This allows you to select a style for the clippet, which affects how the clippet is shown in the clippet list. To select a style, you first have to define it in the preferences.
In addition to recalling clippets by selecting them in the clippet view,
a keyboard shortcut also provides a quicker way to directly recall a
clippet. By default, the shortcut to recall a clippet is
Pressing the recall clippet shortcut opens the clippet selection dialogue:
You can use the cursor keys to navigate between clippets
(
You can use the
The dialogue also shows the configured keyboard shortcuts for the listed clippets, plus numbered shortcuts for the first ten clippets. Pressing one of these shortcuts will directly recall the corresponding clippet and close the dialogue.
There are shortcuts for storing clippets as well. By default,
To directly store the clipboard content to a new clippet in the clippet
collection currently selected in the clippet view, another shortcut can be
used. This shortcut defaults to
When storing clipboard text containing curly braces, each curly brace character will be duplicated to escape it and avoid it being treated as a tag.
Parts of a clippet's text surrounded by single curly braces ('{' and
'}'), are called
When recalling a clippet containing tags, you will be prompted to provide the content for each tag:
Some live tags support parameters to control how they are replaced.
Parameters are simply appeneded to the live tag with a colon. For example,
the live tag tag:param1
.
The following built in live tags are always available:
The name of the editor file. The parameter
The text currently selected in the editor.
The current clipboard's text content.
Additional live tags may be provided through extensions. See Live Tag Extensions for an overview of the officially provided extensions and Developing Live Tags to learn how to implement your own live tags.
The main preference page allows you to change the behaviour of the clippet selection popup. By default, the popup remembers the last used collection and will start with the same collection the next time it is opened. Also, the Clippets View will automatically switch to the selected collection after the popup has been used. The two checkboxes allow you to disable these features. Additionally, two colour selectors allow you to change the style of the popup from the default colours.
Certain operations can display popup notifications, which can be useful as a confirmation for otherwise "silent" actions like recalling a clippet to the clipboard. This page allows you to disable this feature (it is enabled by default) and to change the look up of the displayed popups.
As explained earlier, each clippet can be assigned a style to highlight it in the clippets list. Before you can assign a style, you have to define it in this preference page. Each style has a name and can have a foreground or background colour.
The official Clippets update site also offers extensions providing additional live tags. These live tags depend on specific versions or extensions of the Eclipse platform that may not be available on all installations and must therefore be installed seperately.
The following live tag extensions are available:
Provides live tags for Eclipse's CDT framework. The following tags are supported if the current editor is a C/C++ editor:
The name of the current struct or class.
The name of the current method or function.
Provides live tags for Eclipse's JDT framework. The following tags are supported if the current editor is a Java editor:
The name of the current type. Use the parameter
The name of the current method.
The name of the current package.
This section describes how to implement custom live tags. It is targeted at Java developers who are familiar with Eclipse's concept of plug-ins and features.
Clippets offers an extension point through which plug-ins can provide their own live tags:
name.schedenig.eclipse.clippets.livetags
A plug-in can provide one or more tag
s in an extension of this
type. Each tag has a name
(the text used, in curly braces, to
insert the live tag in a clippet), a description
(displayed to
the user in the clippet editor dialogue) and a class
The class must implement the interface
name.schedenig.eclipse.clippets.java.tags.ILiveTag
and
override the method resolveTag()
. In this method, it must
return the content for the tag or null
if no content is
available.
Multiple extensions may provide tags with identical names. In this case,
Clippets will call one extension's ILiveTag
implementation and
use its tag content, if it is provided. If the tag implementation provided
null
, the next extension is tried, until one implementation
provides content. If none of the available implementations provide content,
the tag is considered a non-live tag in the current context and the user
will be prompted to enter its content.
To distinguish a tag with a standard name from other implementations of the same tag, the clippet editor's tool tip which shows a list of all tags, will show the name of the extension along with each tag. It is therefore recommended to provide a name for the extension if it contains tags that are only available in a specific context (e.g. an editor of a specific type), but may have alternative implementations for different contexts.
Clippets websites:
Clippets was written by Marian Schedenig. You can find my website here.
Clippets is licensed under the terms of the Eclipse Public License v1.0.
Copyright © 2014 Marian Schedenig.