Thursday, March 22, 2007

Eclipse Code Snippets

In this post I am collecting some useful code snippets for programming eclipse. Currently they are not in any order.

Access Status Bar of Eclipse Workbench

final IActionBars actionBars = getViewSite().getActionBars();
IStatusLineManager status = actionBars.getStatusLineManager();
status.setMessage("Status Message");

Console Manipulation
new Runnable() {
public void run() {
IViewPart consoleView = PlatformUI.getWorkbench().
}catch(Exception e){
System.out.println("Console Not Highlighted "+e);

GEF Undo/Redo Contextual Text
To provide contextual text in GEF Undo/Redo menu actions (e.g. instead of plain Undo you want Undo XYZ), please provide a label to every command. For that please override the setLabel(String label) of Command Class.

More can be found here.

No comments:

(c) Jyotirmaya Nanda 2012