Saturday, December 10, 2011
TIP: Stable history navigation using Eclipse toolbar
Sunday, December 04, 2011
Selection Explorer Eclipse Plug-in
- Active Part (this is somewhat similar to Plug-in spy action)
- Part name
- Part Id
- Class implementing the part
- Super class of the class implementing the part
- Interfaces
- Contributing Plugin
- Active Selection
- Class of selection objects
- Superclass of selection object
- Interfaces
- Adapted Types
- toString() value
- Active Contexts
- Active ActionSet Contexts
Thursday, December 01, 2011
Close Views Eclipse Plug-in
- Window > Close (active) View - This closes the last active view.
- Window > Close All Views in Tab - This closes all views in the tab containing the last active view.
- Window > Close Other Views in Tab - This closes other views in the tab containing the last active view.
- Window > Other Views - This closes all views except the last active view.
- Window > Close All Views - As such this closes all the open views. If all the views are already closed it offers to reset the perspectives.
Update site:
http://sandipchitaleseclipseplugins.googlecode.com/svn/trunk/CloseViewsFeatureUpdateSite/site.xml
Also on Eclipse Marketplace.
Monday, November 28, 2011
Path Tools Eclipse Plug-in Updated
What is new?
- Added support for Copy Path, Explore and Command Line Shell actions to local resources in RSE (needs RSE)
- Added Copy SVN URL for resources in SVN based projects (needs Subclipse)
Wednesday, July 13, 2011
Google Factor
Just came up with a new term - Google Factor or GF for short
Google Factor, noun
GF, acronym
definition:
- Percentage or ratio of your waking life that involves Google services
- What is your GF?
- Just signed up for new Google Service FOO, now my Google Factor is .37.
Friday, June 17, 2011
Eclipse: Key Strokes display utility
Saturday, June 04, 2011
Eclipse: Command Key binding Cross Reference
The Command Key binding Cross Reference Plug-in shows a pop-up dialog. The dialog can be invoked in two modes:
- Key binding centric
- Command centric
(Ctrl+Alt+Shift+K) in the status bar. It shows the following pop-up dialog:Eclipse has different key binding schemes. You can explore the key bindings of other schemes by selecting it in the Scheme: combo box.
(Ctrl+Alt+Shift+L) in the status bar. It shows the following pop-up dialog:Lastly, the P column shows the icon of the platform if the command is defined for a specific platform such as Windows
, Mac
or Linux
. The U column shows the
icon if the user has customized the key binding using Preferences > General > Keys.You can install the plug-in from it's update site:
http://sandipchitaleseclipseplugins.googlecode.com/svn/trunk/commandkeybinding.xref.updatesite
Please file any issues at:
http://code.google.com/p/sandipchitaleseclipseplugins/issues/list
Works in Eclipse 3.5.x and 3.6.x.
Enjoy!
Sunday, May 29, 2011
Eclipse: Show all instances of selected Java Class
- Run > All Instances of Java Class...
- All Instances of Java Class... toolbar buttons in the Variables and Expressions views
Once you selects the class it adds the <Java Class> Instances expression to the Expressions view. Please note that instances of sub classes are also shown if the Show instances of subclasses checkbox is selected. For example, when java.io.OutputStream is selected it shows the instances of it's subclasses also. You can further filter out inner and anonymous inner classes using the additional check boxes. This functionality is not provided by Eclipse Java debugger's All Instances... action.
These expressions are automatically removed from the Expressions view when the debug session terminates.
You can further explore the instances using the All References... popup menu item provided by the Eclipse Expressions view. This can help you track down who is holding on to the instance potentially causing a memory leak.
The functionality works only if you have a active Java debug session, running under a JavaSE-1.6 (and above) that supports the all instances retrieval functionality, selected in the Debug view.
You can install the plug-in from the plug-in's update site:
http://sandipchitaleseclipseplugins.googlecode.com/svn/trunk/AllInstancesUpdateSite
Please file any issues at:
http://code.google.com/p/sandipchitaleseclipseplugins/issues/list
Thursday, April 21, 2011
Eclipse: Find/Replace Bar
Find/Replace Bar Plug-in is on Eclipse Marketplace !
Currently the Find/Replace Bar supports the following features:
- Find as you type
- Find Next/Find Previous
- same key bindings as Eclipse
- Show the total number of occurrences in the document
- Case sensitive mode
- Whole word only mode
- Regular Expression mode
- Indicate illegal regular expression
- Show Find/Replace dialog by pressing CTRL+F on Windows and Linux and COMMAND+F on Mac
- Enable/Disable Find/Replace Bar using preferences
- Show Preferences button on the Find/Replace Bar
- Optionally override the standard Find/Replace Dialog of Eclipse. Control the override through preference page.
- Press CTRL+F on Windows and Linux and COMMAND+F on Mac to show the Find/Replace Bar
- Press ESCAPE to hide the Find/Replace bar
- Find/Replace Bar works with text editors inside a Multi page editor e.g. plugin.xml XML editor inside the Plug-in Manifest editor.
- Show the preceding and succeeding match count
- Show text matching groups in regular expressions in a combobox
- Full Replace/Find,Replace and Replace All support
- Find in selection
- Highlight current and other occurrences of the matched text
- Highlight groups in regular expressions in different colors
- Show current line number and column range of the match
- Make it work in Console and other views where Find/Replace dialog is applicable
Please file any issues at:
http://code.google.com/p/sandipchitaleseclipseplugins/issues/list
After installing the plug-in, go the Find/Replace Bar preferences page to enable the Find/Replace Bar as shown in the screenshot below:
Wednesday, March 30, 2011
One-click editor splitting in Eclipse
UPDATE: Eclipse Luna 4.4 M4 now supports editor splitting... NEW and NOTEWORTHY.
You may know that one can split layout the editors in Eclipse by dragging the editor tab to any edge of the editor area. This works only if you have more than one editor. However there are times when I want to work on two parts of the same file. To do that I first do Window > New Editor to duplicate the editor and then drag it to split the editor in a side-by-side or top-bottom layout. But that is too many clicks and drags. I developed a simple Eclipse Plugin which will help you split the active editor either horizontally or vertically with a single click. It is based on some code I found here that was written by Dimitri Missoh (thanks Dimitri - I have given you credit in the source code of the plug-in). I adapted his code to suite our purpose.
Here is the screenshot:
Split Editor Plug-in is available on Eclipse Marketplace!
You can install it from the plug-in's update site:
http://sandipchitaleseclipseplugins.googlecode.com/svn/trunk/SplitEditorFeatureUpdateSite
Source code is here.
Works in Eclipse 3.4, 3.5, 3.6, 3.7 and 3.8.
Also available on Eclipse Marketplace.
Enjoy!
Tuesday, March 15, 2011
XCode: Corrected user scripts - Delete Line, Copy/Move line Up/Down
XCode has the following scripts:
- Delete Line
- Move Line Up
- Move Line Down
- Copy Line Up
- Copy Line Down
It turns out the window 1 is always the window which has the focus. I corrected the scripts to make use of this fact. Here is the general strategy behind the modifications I made to the scripts:
:
: using terms from application "Xcode" set selectedDocument to missing value repeat with index from 1 to (count of text documents) if (associated file name of window 1 as string) is equal to (path of text document index) then -- found the document set selectedDocument to (text document index) exit repeat end if end repeat if (selectedDocument is not missing value) then tell selectedDocument -- do the modifications to document end tell else beep 1 end if end using terms from
Download the scripts here. Just unzip and drop the scripts in /Developer/Library/Xcode/User Scripts/ .
I have filed a bug at http://radar.apple.com for this. The problem Id is 9138643. I have attached the fixed scripts to the problem.
Wednesday, March 09, 2011
XCode: Copy/Move Up/Down line
XCode already has the following scripts under Script Menu > Text
- Delete Line
- Move Line Up
- Move Line Down
- Copy Line Up
- Copy Line Down
Here is the screenshot:
Sunday, September 05, 2010
Updated Path Tools Eclipse plug-in
- The Custom commands can now we edited using the table editor which allows you to use a display labels and wildcard patterns for the command. The display label is used in the menu items that invoke the commands. The wildcard patterns are used to determine if the command applies to the selected file.

- The Path Tools commands remain enabled even if there is no file selected in the Eclipse workbench. The commands operate on the workspace folder when no file is selected in the workbench.
Tuesday, May 11, 2010
LinearLayout gravity and layout_gravity explained
- android:gravity
- android:layout_gravity
<?xml version="1.0" encoding="utf-8"?>This results in the following layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" android:background="#666666">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Linear Layout - horizontal, gravity=center"
android:textColor="#FFFFFF" android:padding="2dip" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:orientation="horizontal"
android:layout_height="0dip" android:layout_weight="1"
android:gravity="center" android:background="#EEEEEE">
<Button android:id="@+id/Button01" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_gravity="top"
android:text="top"></Button>
<Button android:id="@+id/Button02" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_gravity="center"
android:text="center"></Button>
<Button android:id="@+id/Button03" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="bottom"
android:layout_gravity="bottom"></Button>
</LinearLayout>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Linear Layout - vertical, gravity=center"
android:textColor="#FFFFFF" android:padding="2dip" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:orientation="vertical"
android:layout_height="0dip" android:layout_weight="1"
android:gravity="center" android:background="#DDDDDD">
<Button android:id="@+id/Button04" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_gravity="left"
android:text="left"></Button>
<Button android:id="@+id/Button05" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_gravity="center"
android:text="center"></Button>
<Button android:id="@+id/Button06" android:layout_height="wrap_content"
android:text="right" android:layout_gravity="right"
android:layout_width="wrap_content"></Button>
</LinearLayout>
</LinearLayout>
- top
- center
- bottom
- left
- center
- right
Wednesday, December 23, 2009
Mac Win Man - a unified Mac OS X Desktop Window and Application Manager
- Hide/Unhide Application
- Minimize/Unminimize Window
- Show window with same action no matter it was minimized or hidden
- Zoom/Unzoom Window
- Move and Resize windows using keyboard and mouse
- Resize windows by dragging on the window edges and corners
- Snap window to edges and center of the display using keystrokes
- Precisely position and size the windows by entering the location and size values
- Tile Windows Vertically
- Tile Windows Horizontally
- Cascade Windows
- Close Window
- Quit Application
Friday, October 16, 2009
TIP:Applescript to invoke All Windows function of Exposé and bind it to key you please
on runAssuming you have bound Exposé:All Windows function to F9 key.
-- delay is needed so that keybindings defined in
-- tools like Fastscripts works
delay 0.1
tell application "System Events"
-- 101 is key code for F9 key
key code 101
end tell
end run
So you say - what is the big deal?
Well, if you look at System Preferences... > Exposé and Spaces pane > Exposé Tab , you will see that it allows you to bind various functions to limited set of keys. The script enables you to bind it to any key such as Option+Tab. How? Heres how:
Save the above script in ~/Library/Scripts/Expose.app . Then bind it to Option+Tab using Quicksilver or Launchbar or Fastscripts.
Saturday, October 03, 2009
Un-minimize minimized windows and bring them to front using Applescript
-- assuming you have name of a minimized window
set theWindowName to ....
-- is it minimized?
if (value of attribute "AXMinimized" of window theWindowName is true) then
-- first un-minimize the window
value of attribute "AXMinimized" of window theWindowName to false
end if
-- raise it
perform action "AXRaise" of window theWindowName
I had not much documentation on attributes such as "AXMinimized" and perform action "AXRaise".
Friday, October 02, 2009
Ruby on Rails : Injecting routes from a separate file
In a Ruby on Rails application the routing is configured using the config/routes.rb file. The routes are defined using the draw method of ActionController::Routing::Routes class like this:
ActionController::Routing::Routes.draw do |map|The block is executed with a local variable map in the scope. I wanted to insert routes defined in a separate file that is generated by another tool. To do that I tried to use the load or require methods. However I realized that it will not work because the load or require methods reset the scope to the top level. So I came up with the following:
...
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
# insert routes from generated file
instance_eval(File.read(File.expand_path(File.dirname(__FILE__)) + "/generated-routes.rb"))
Basically it is evaluating the contents of a file in the instance (current) scope. The File.expand_path(File.dirname(__FILE__)) simply computes the path to folder that contains routes.rb file. To that I append the name of generated routes file which lives next to routes.rb file.
Is there a better/idiomtic way to do this?
AWS - a unified Application and Window Switcher i.e. a Command TAB alternative
TAB)/Command Shift Tab (
TAB).
Tuesday, July 14, 2009
Tuesday, July 07, 2009
Thursday, May 28, 2009
A Swing component to display last keystroke and keystroke history
How it works
The KeyLabel component registers a global listener for KeyEvents using:
Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);On receiving KEY_RELEASED event formats the KeyStroke as a string and displays it. The dropdown shows history of last 100 keystrokes. Clicking on the X (Clear KeyStroke History) button clears the keystroke history. The KeyEvent listening can be suspended by deseleting the checkbox.
Usage
JComponent keyLabel = KeyLabelFactory.createKeyLabel();Demo
// Use keyLabel in your application's statusbar
Download (KeyLabel.jar)
> java -jar KeyLabel.jarScreenshot of KeyLabel Demo

Source Code
Wednesday, May 27, 2009
Error launching Mozilla (only from inside Eclipse) using simple Runtime.exec() on Ubuntu.
Here is the program that I used to test it:
import java.io.IOException;Very interesting. May be that is why Eclipse has trouble launching help in default external browser on Ubuntu.
public class MB {
/**
* @param args
*/
public static void main(String[] args) {
try {
Process exec = Runtime.getRuntime().exec("/usr/bin/mozilla"
// Uncommenting out following line will launch mozilla browser on Ubuntu
//, new String[] {"DISPLAY=:0.0", "HOME="+System.getProperty("user.home")}
);
System.out.println(exec.waitFor());
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
UPDATE: It turns out that this fails only if I run the above program from inside Eclipse. If I run it from a terminal window it works. It turns out that Eclipse sets an environment variable MOZILLA_FIVE_HOME to point to /usr/lib[64]/xulrunner-addon to make the SWT's embedded browser widget work correctly. However this environment variable is inherited by any process that is launched from within Eclipse. And apparently MOZILLA_FIVE_HOME inteferes with the Mozilla browser (/usr/bin/mozilla) launch.
Two issues have been filed in Eclipse Bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=278415
https://bugs.eclipse.org/bugs/show_bug.cgi?id=278296
Sunday, May 17, 2009
MultiPage Editor Tab Traverse Eclipse Plug-in
Screenshots:
Starting with Overview tab:

Type CTRL+TAB to go to Dependencies tab:

Type CTRL+SHIFT+TAB instead to go to build.properties tab:
Saturday, April 25, 2009
Move and Resize windows on Mac OS X
How it works (Swing version)
The implementation uses Applescript to get the frontmost window and it's bound. It sends the bounds rectangle to a server implemented in Java over a socket connection. The Java server takes the screen shot of the full Desktop and uses it as the Image label (a JLabel with ImageIcon) as the content pane of an undecorated JFrame which has the same bounds as the Desktop. A JPanel with semitransparent background and a dark rounded rectangular border is given the same bounds that were received over the socket. This JPanel is added to the PALETTE_LAYER of the JFrame's layered pane - which makes it appear floating in front of the front window. Mouse and Key listeners on the JPanel allows moving and resizing of the JPanel. When the user types the ENTER key the JFrame is hidden and the new bounds of the JPanel are sent back to the Applescript over the socket connection which moves and resizes the frontmost window.
Initially I had implemented the original version using SWT. However, it turns out that it is implementable in Swing also - once again proving that Swing is a very good toolkit. Added advantage is that Swing is part of the JDK making the implementation much much smaller. BTW the Swing implementation is much faster and plays nicely with log off and shutdown.
Watch Screencast
Here is a screenshot:

Saturday, April 18, 2009
Wednesday, April 15, 2009
Sunday, March 29, 2009
Sampler Eclipse Plug-in
Saturday, March 21, 2009
Reverse Text Selection Eclipse Plug-in
The following screencast shows how you can start with a initial selection and then extend it in both directions using the Reverse Text Selection command (Alt+Shift+/).
Tuesday, March 17, 2009
Google Clips Eclipse Plug-in
Thursday, March 12, 2009
ClickIt a desktop variant of Screen shot Eclipse Plug-in
Saturday, February 21, 2009
Screenshot Plug-in for Eclipse
Thursday, January 01, 2009
Copy paths of selected items in Mac OS X Finder to clipboard
(*
Script: copypaths.app
This script sets the clipboard to the paths of items selected in Finder window.
If there is no selection the clipboard is set to the path of the target
of the Finder window.
Installation:
1. Paste this script in Script editor
2. Save it as an application - ~/scripts/finder/copypaths.app
3. Drag and drop copypaths.app onto the Finder widow toolbar.
@author Sandip V. Chitale
@version 1.0
@date 1/1/2009
*)
tell application "Finder"
set paths to ""
set selected to selection
if (count of selected) is 0 then
set paths to POSIX path of (target of front window as alias)
else
repeat with aPath in every item in selected
set aPathString to POSIX path of (aPath as alias)
if paths is "" then
set paths to aPathString
else
set paths to paths & "
" & aPathString
end if
end repeat
end if
if paths is not "" then
set the clipboard to paths as text
end if
end tell
Go to parent folder in Mac OS X Finder
(*
Script: up.app
This script sets the target of the Finder window to the
parent of the current target of the Finder window.
Installation:
1. Paste this script in Script editor
2. Save it as an application - ~/scripts/finder/up.app
3. Drag and drop up.app onto the Finder widow toolbar.
@author Sandip V. Chitale
@version 1.0
@date 1/1/2009
*)
tell application "Finder"
set target of front window to (parent of target of front window)
end tell
Keep Mac OS X Finder and Terminal in sync
(*
Script: findercd.scpt
This script sets the target of the front window of Finder
to the directory path passed as the first argument. If
there is no Finder window, one is created. Optionally
the finder window can be activated by passing in "true"
as second argument. If no argument is passed
the user is prompted to select a directory
to go to.
The following two bash functions can be used to
invoke this script from bash running in Terminal
window:
# Change the directory of front window of
# Finder to pwd of shell
fcd() {
cd "${1}"
osascript ~/scripts/finder/findercd.scpt "`pwd`" ${2}
}
# Change the directory of front window of
# Finder to pwd of shell and activate the
# Finder window
fcda() {
fcd "${1}" true
}
Installation:
1. Paste this script in Script editor
2. Save it as a script - ~/scripts/finder/findercd.scpt
3. Add the fcd() and fcda() functions mentioned above
to your .bashrc or .bashrc_profile
This script complements the terminalcd.scpt script.
@author Sandip V. Chitale
@version 1.0
@date 1/1/2009
*)
on run argv
if (count of argv) is 0 then
try
set directory to POSIX path of (choose folder with prompt "Go to")
on error
return
end try
else
set directory to (item 1 of argv)
end if
set doActivate to false
if (count of argv) is greater than 1 then
set doActivate to (item 2 of argv)
end if
tell application "Finder"
if (count of windows) is 0 then
make new Finder window
end if
set target of front window to (POSIX file directory)
if doActivate = "true" then
activate
end if
end tell
end run
terminalcd.app
(*
Script: terminalcd.app
This script sets the directory of the shell in front window of Terminal to the
target directory of front window of Finder. If there is no Terminal window
is there a new window is created. If the the front window of
Terminal is busy new window is created.
Installation:
1. Paste this script in Script editor
2. Save it as an application - ~/scripts/finder/temrinalcd.app
3. Drag and drop terminalcd.app onto the Finder widow toolbar.
This script compliments the findercd.scpt script.
@author Sandip V. Chitale
@version 1.0
@date 1/1/2009
*)
tell application "Finder"
if (count of windows) is greater than 0 then
set cdTo to POSIX path of (target of front window as alias)
set terminalWasRunning to false
tell application "System Events"
if exists process "Terminal" then
set terminalWasRunning to true
end if
end tell
tell application "Terminal"
activate
if (count of windows) is 0 then
do script ""
else if window 1 is busy then
do script ""
end if
do script "cd '" & cdTo & "'" in front window
end tell
end if
end tell
Wednesday, December 17, 2008
Automatically Create Working Sets Eclipse plug-in
Tuesday, December 16, 2008
Smart Semicolon Eclipse plug-in
Sunday, December 07, 2008
Hooking into Eclipse command execution
// Add listener to monitor Cut and Copy commands
ICommandService commandService = (ICommandService) PlatformUI
.getWorkbench().getAdapter(ICommandService.class);
if (commandService != null) {
commandService.addExecutionListener(new IExecutionListener() {
public void notHandled(String commandId,
NotHandledException exception) {
}
public void postExecuteFailure(String commandId,
ExecutionException exception) {
}
public void postExecuteSuccess(String commandId,
Object returnValue) {
// Is it a Cut or Copy command
if ("org.eclipse.ui.edit.copy".equals(commandId)
|| "org.eclipse.ui.edit.cut".equals(commandId)) {
Clipboard clipboard = new Clipboard(PlatformUI
.getWorkbench().getActiveWorkbenchWindow()
.getShell().getDisplay());
Object contents = clipboard
.getContents(TextTransfer.getInstance());
if (contents instanceof String) {
// Now do something with text selection
}
}
}
public void preExecute(String commandId, ExecutionEvent event) {
}
});
}
Cool huh?
Thursday, November 27, 2008
Graphical cd
gcd() {
local CDTO=`zenity --title="cd" --file-selection --directory`
if [ -n "${CDTO}" ] ; then
cd "${CDTO}"
fi
}
Thursday, November 13, 2008
Zero length Java array cache
The output is:
import java.util.Map;
import java.util.WeakHashMap;
/**
* A simple cache using WeakHashMap of zero length arrays of a given class.
*
* @author schitale
*
*/
public class ZeroLength {
private static Mapmap = new WeakHashMap ();
@SuppressWarnings("unchecked")
public staticT[] array(Class c) {
T[] array = (T[]) map.get(c);
if (array == null) {
array = (T[]) java.lang.reflect.Array.newInstance(c, 0);
map.put(c, array);
}
return array;
}
public static void main(String[] args) {
System.out.println(array(String.class).getClass().getCanonicalName()
+ " of length " + array(String.class).length);
System.out.println(array(String[].class).getClass().getCanonicalName()
+ " of length " + array(String.class).length);
}
}
java.lang.String[] of length 0If you want to rely on the identity of the zero length array instance (e.g. == based comparison) then replace the WeakHashMap with HashMap. However, in that case you have to watch out for memory leaks through static fields of array component classes. You may want to add a method to remove the reference to the array from the HashMap.
java.lang.String[][] of length 0
Is there a better way to do this?
IMHO the java.lang.Class class should provide such factory method. This is along the lines of factory method:
public static final T List T java.util.Collections.emptyList();
The implementation in java.lang.Class may look like:
private static T[] zeroLengthArray;
public static synchronized T[] emptyArray() {
if (zeroLengthArray == null) {
zeroLengthArray = (T[]) java.lang.reflect.Array.newInstance(this, 0);
}
return zeroLengthArray;
}
Thursday, October 23, 2008
Bundles, Extension Points, Extensions View for Eclipse 3.4
- Bundles
- Extensions Points
- Extensions
You can start with any one of these at the top level by using the toolbar settings. You can continue to expand the relationships between these objects to any level.
Several actions are supported in the context menu:
- Open plugin.xml
- Copy extension and extension element trees
- Open Java Type specified by attributes which specify implementing Java classes.
For example, the Copy Extension action copied the following xml to the Clipboard:
Export a file containing the names and locations of the shared projects in the workspace.
I plan to make more enhancements to this view.
You can download it here.
DISCLAIMER: This plug-in is experimental. So no guarantees. Use the plug-in at your own risk.
Tuesday, October 14, 2008
Reclaim Ctrl+C and Ctrl+V for familiar Copy and Paste in gnome-terminal
In this entry I describe how to make Ctrl+C and Ctrl+V do Copy and Paste in gnome-terminals. Here is how to do it:
Open a gnome-terminal window and type the following commands:
Add the following to .bashrc
> stty intr ^K # free Ctrl+C for copy
> stty lnext ^- # free Ctrl+V for paste
> stty -g
> stty -g > ~/.stty # store the settings in home directory
case $- inNow using the gconf-editor, edit the gnome-terminal's key bindings (@ /apps/gnome-terminal/keybindings key).
*i*)
stty `cat ~/.stty` # reload the stored stty settings
bind -u quoted-insert # unbind the quoted-insert function of bash - free Ctrl+V for paste
esac
Close and reopen the terminal window. And now Ctrl+C will copy and Ctrl+V will paste.
Sunday, October 12, 2008
Launching the Open Type dialog
OpenTypeSelectionDialog dialog = new OpenTypeSelectionDialog(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
true,
PlatformUI.getWorkbench().getProgressService(),
null,
IJavaSearchConstants.TYPE);
dialog.setTitle(JavaUIMessages.OpenTypeAction_dialogTitle);
dialog.setMessage(JavaUIMessages.OpenTypeAction_dialogMessage);
dialog.setInitialPattern("java.lang.String");
int result= dialog.open();
if (result != IDialogConstants.OK_ID)
{
return;
}
Object[] types= dialog.getResult();
if (types != null && types.length > 0) {
IType type= null;
for (int i= 0; i < types.length; i++) {
type= (IType) types[i];
try {
JavaUI.openInEditor(type, true, true);
} catch (CoreException x) {
// Handle exception
}
}
}
Enhanced Plug-in Registry View
The Plug-in Registry View has a mode (Show Extension Content only) to show:
- extension-points
- extensions
- extension elements
- extension attributes
This plug-in adds some additional actions on the Plug-in Registry View's tool bar. The following screen shot shows the example of the additional actions.
For attributes with values that look like Java Type name - the Open
This works well if you have added all the plug-in classes to your Java search using the tip - Extending the Java search scope.
The other supported action is:
- Open plugin.xml
You can download the plug-in here.
BTW this plug-in makes use of the technique described in the entry - Add pulldown actions to Eclipse View's Toolbars.
DISCLAIMER: This plug-in is experimental. So no guarantees. Use the plug-in at your own risk.




























