UNDO Implemantation by ActionFactory.UNDO.create(window)(PLEASE...)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Tapamay_Ghosh
Posted On:   Friday, March 30, 2007 02:06 AM

Is There anyone who can answer me how to implement UNDO feature by using ActionFactory.UNDO.create(window) for an editor which is created by extending EditorPart.Please give some idea its really very urgent.

Any help would be really very much appreciated..please help urgently.

Thanks,

Re: UNDO Implemantation by ActionFactory.UNDO.create(window)(PLEASE...)

Posted By:   kulbir_singh  
Posted On:   Tuesday, April 17, 2007 06:05 AM

hi friend
try this code

import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;

import org.eclipse.ui.IWorkbenchActionConstants;

import org.eclipse.ui.IWorkbenchWindow;

import org.eclipse.ui.actions.ActionFactory;

import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;

import org.eclipse.ui.application.ActionBarAdvisor;

import org.eclipse.ui.application.IActionBarConfigurer;



public class ApplicationActionBarAdvisor extends ActionBarAdvisor {



private IWorkbenchAction undoAction;


public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {

super(configurer);

}



protected void makeActions(final IWorkbenchWindow window) {



undoAction = ActionFactory.UNDO.create(window);

register(undoAction);


}


protected void fillMenuBar(IMenuManager menuBar) {

MenuManager editMenu = new MenuManager("&Edit",
IWorkbenchActionConstants.M_EDIT);

menuBar.add(editMenu);

editMenu.add(undoAction);

}


}


hope this will help u

regards

Kulbir Singh
About | Sitemap | Contact