Saturday, December 31, 2011

Code Clips Eclipse Plug-in

The Code Clips Eclipse Plug-in lets you create code clips on the fly and associate abbreviations with them. The abbreviations are expanded using the TAB key.



If there is more than one abbreviation that matches the prefix before the caret then a content assist style popup is shown. You may select the item in the popup by clicking on it or typing it's ordinal number. Once selected the expansion associated with the selected abbreviation is inserted in place of the prefix.



The expansion text may contain the following variables:



The numbered variables ${1} through ${9} act as tab stops. The ${clipboard} variable will be replaced by the contents of the clipboard at the time of expansion. You can use the Variablize... dialog to convert multiple occurrence of same word into a variables. All occurrences of the same variable can be edited together using the Linked editing support of Eclipse editors.

To create a code clips use the Edit > Create Code Clip menu item


or use Control+5 (windows and linux) or Command+5 (mac) keyboard shortcuts. This will show the Create Code Clip dialog.


If you had any text selected in the editor that will be populated in the Expansion text area. You may insert the above mentioned variables using the Insert Variables menu button.

You can manager the Code Clips using the Manage Code Clips dialog which can be invoked by clicking on the Manage... button in Create Code Clips dialog :


The Code Clips Eclipse Plug-in is available on Eclipse Marketplace!

Tuesday, December 27, 2011

UPDATED:One-click editor splitting in Eclipse

In the One-click editor splitting in Eclipse post I blogged about a simple Eclipse plug-in that lets you split the active editor. I have updated the plug-in to let you split the active editor with any other editors in the same tab. The functionality is available in the Split Editor toolbar's Horizontal and Vertical split button's drop down menu.


The updated Split Editor Plug-in is available on Eclipse Marketplace!

Saturday, December 10, 2011

TIP: Stable history navigation using Eclipse toolbar

Eclipse has a nice location history navigation toolbar. By repeatedly clicking on the history toolbar buttons you can quickly navigate to the locations the cursor/focus was at in various editors that are open. Unfortunately, out of the box, the position of the history navigation toolbar buttons is not stable if you have files of varying types open in the editor area. That is because the toolbar contributed by various editors are shown and hidden as the focused editor changes. These editor contributed toolbars (shown in blue rectangle below), when shown, are inserted to the left of history navigation toolbar. The following two screenshots demonstrates the behavior.



Fortunately there is a way to fix this behavior. It is possible to to drag the editor toolbar to the right-most side of the toolbar strip like shown in the following screenshot:



With this adjustment the history navigation toolbar remains in same place making it easier to use.

You may have to unlock the toolbars to see the drag handles as shown in the screenshot below:


I think this should be the default location of editor toolbars in Eclipse. Just filed this enhancement.

Such small adjustments makes the tool more productive.


Sunday, December 04, 2011

Selection Explorer Eclipse Plug-in


This Selection Explorer feature shows information about:
  • 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

in the Selection Explorer view. Here are some screenshots:


Clicking on the hyperlinks shows the Open Type dialog:


Thursday, December 01, 2011

Close Views Eclipse Plug-in


The Close Views feature provides commands related to closing views:
  • 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.
Here is a screenshot:



Update site:
http://sandipchitaleseclipseplugins.googlecode.com/svn/trunk/CloseViewsFeatureUpdateSite/site.xml

Also on Eclipse Marketplace.