Eclipse Text Editor Extensions (ETEE)
ETEE is an Eclipse plug-in which extends
the Eclipse text editors with some extra capabilities for
filtering the text using command line pipes/filters. This
is a humble but powerful addition, as it immediately makes
the features and flexibility of hundreds of command line
tools available to the Eclispe user.
The Eclipse Text Editor Extensions is an open source project housed at the Eclipse Text Editor Extensions project at www.sourceforge.net. Visit the Download page for download and installation instructions.
Features
The editor extension appear in a new Filters submenu on the context (right mouse button or Shift-F10) menu in the Eclipse text editors.Filter - run an external command filter on the selected text
Quote XML Special Characters
Unquote XML Special Characters
Filter
The Filter action allows you to run
a Unix-like filter over the selected region. This is useful
for embedding base64 encoded text in a .properties file, running
a sed(1) or awk(1) script on the text, running uniq(1) to
remove duplicate lines of text, sort(1) to sort the text -
anything that can work on standard input/standard
output.
You may also invoke the filter action with the key binding
Alt-| (that is
Alt and vertical bar, or Alt-Shift \).
When you select this option, Eclipse displays a dialog
asking you for the name of a command to execute. Enter a
command name and press Enter or click OK and the command
will run, consuming the selected region of text as its
standard input. When the command completes, its output
replaces the
selected region. If there is no selected region, the
standard input for the command will be empty and its output
will be inserted at the current cursor location. If you
select the Direct filter output to console instead of
replacing selection option, ETEE will print the output of
the filter in an Eclipse Console window, replacing the last
filter output, if there is any, and make the Console
active.
ETEE maintains a history of commands which you can reselect
by using the combo UI control in the dialog.
The command runs in its own process and inherits the
environment of the Eclipse process (environment variables,
etc.)
You should only use commands which are true pipes --
commands which read standard input and write standard
output. If you run some other command (like Notepad on
Windows or xterm on Linux) the dialog will stay up as long
as the command is executing, which is not what you
want.
Note that the Filter operation treats the text as just that - text. It does not operate on the logical structure of a Java source file or an XML source file - it does not know the context in which you are editing text. Thus, it is quite possible to replace a bit of valid Java or XML or other source with something that is not correct Java (or XML or...). In other words, use this command when you want to do text manipulation of the source, not symbolic manipulation. Don't use sed s/oldVarName/newVarname/g in a Java source file; for such operations, use the Eclipse JDT refactoring support instead.
See Examples for just a small sample
of the power of the command line tools now callable
directly from Eclipse editors.
Quote XML Special Characters
This action will convert
XML special characters in the region to XML character
entities.
- < is replaced with <
- > is replaced with >
- & replaced with &
- " replaced with "
Unquote XML Special Characters
This action is the opposite
operation of Quote XML Special Characters. For example,
<is changed back to <.
Notes
This version of the plug-in works with Eclipse 3.0, 3.1, and 3.2
as well as with the Structured Source (XML, JSP,
JavaScript, DTD, CSS etc.) Editors
that come with Eclipse WebTools 1.0/1.0.1.