Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » actionbar and editor actions
actionbar and editor actions [message #207104] Tue, 10 January 2006 20:52
Vlad Ciubotariu is currently offline Vlad CiubotariuFriend
Messages: 14
Registered: July 2009
Junior Member
I'm playing with the shape example, trying to add an align action to the
toolbar. When I run the example the AlignmentAction doesn't become active.
I'm missing smth, can't figure what.

thanks

Added this code ShapesActionBarContributor

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

/**
* 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(aa1);
//toolBarManager.add(aa2);
}

And also added this to the ShapeEditor

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

action = new AlignmentAction((IWorkbenchPart) this,
PositionConstants.CENTER);
registry.registerAction(action);
getSelectionActions().add(action.getId());
}
Previous Topic:Starting out
Next Topic:Opening a GEF editor crashes Eclipse with cairo error
Goto Forum:
  


Current Time: Thu Apr 25 08:18:10 GMT 2024

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

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

Back to the top