public class GefActionBarContributor extends ActionBarContributor {
public GefActionBarContributor() {
super();
}
protected void buildActions() {
// addRetargetAction(new UndoRetargetAction());
// addRetargetAction(new RedoRetargetAction());
// addRetargetAction(new DeleteRetargetAction());
// addRetargetAction(new RetargetAction(ActionFactory.SAVE.getId(), Messages.save));
// addRetargetAction(new RetargetAction(ActionFactory.SELECT_ALL.getId(), Messages.select_all));
// addRetargetAction(new ZoomInRetargetAction());
// addRetargetAction(new ZoomOutRetargetAction());
// addRetargetAction(new RetargetAction("abc","aaaaa"));
// b.getBundleContext().installBundle(location);
}
@Override
public void contributeToToolBar(IToolBarManager toolBarManager) {
// System.out.println(getAction(ActionFactory.UNDO.getId())+"...........");
// toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
// toolBarManager.add(getAction(ActionFactory.REDO.getId()));
// toolBarManager.add(getAction(ActionFactory.DELETE.getId()));
// toolBarManager.add(getAction(ActionFactory.SAVE.getId()));
// toolBarManager.add(getAction(ActionFactory.SELECT_ALL.getId()));
//
// Action action= new Action("abc"){};
// action.setId("abc");
// getActionRegistry().registerAction(action);
// toolBarManager.add(action);
//
// toolBarManager.add(getAction(GEFActionConstants.ZOOM_IN));
// toolBarManager.add(getAction(GEFActionConstants.ZOOM_OUT));
// toolBarManager.add(new ZoomComboContributionItem(getPage()));
///这里先执行了,所以活动的为空
// System.out.println("活动的编辑器:"+this.getPage().getActiveEditor());
// DeleteAction action = new DeleteAction(this.getPage().getActiveEditor());
// toolBarManager.add(action);
}
@Override
protected void declareGlobalActionKeys() {
}