Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » again on actionbarcontributor
again on actionbarcontributor [message #207162] Wed, 11 January 2006 16:20
Vlad Ciubotariu is currently offline Vlad CiubotariuFriend
Messages: 14
Registered: July 2009
Junior Member
Following the logic design example I've added similar code to the shape
editor example. The newly added action shows up in the editor toolbar,
however
it never activates when I select shapes.

Any clues, please?

//ShapesEditorActionBarContributor

protected void buildActions() {
addRetargetAction(new DeleteRetargetAction());
addRetargetAction(new UndoRetargetAction());
addRetargetAction(new RedoRetargetAction());
addRetargetAction(new AlignmentRetargetAction(PositionConstants.CENTER));
}

/**
* Add actions to the given toolbar.
* @see
org.eclipse.ui.part.EditorActionBarContributor#contributeToT oolBar(org.eclipse.jface.action.IToolBarManager)
*/
public void contributeToToolBar(IToolBarManager toolBarManager) {
toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
toolBarManager.add(getAction(ActionFactory.REDO.getId()));
toolBarManager.add(getAction(ActionFactory.DELETE.getId()));
toolBarManager.add(getAction(GEFActionConstants.ALIGN_CENTER ));
}

//ShapesEditor

protected void createActions() {
super.createActions();
ActionRegistry registry = getActionRegistry();
IAction action;

action = new AlignmentAction((IWorkbenchPart)this,
PositionConstants.CENTER);
//action.setId(GEFActionConstants.ALIGN_CENTER);
registry.registerAction(action);
getSelectionActions().add(action.getId());
}
Previous Topic:Shold I start from EMF or GMF?
Next Topic:How to reflect model state in a custom view after Undo
Goto Forum:
  


Current Time: Thu Dec 08 17:55:49 GMT 2022

Powered by FUDForum. Page generated in 0.03377 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top