Action action = new SwitchStyleAction(this);
IMenuManager dropDownMenu = actionBars.getMenuManager();
dropDownMenu.add(action);
IToolBarManager toolBarManager = actionBars.getToolBarManager();
// wide left annotation side action
WideLeftAnnotationSideAction wideLeftAnnotationSideAction = new WideLeftAnnotationSideAction(
editor);
wideLeftAnnotationSideAction.setActionDefinitionId(WideLeftAnnotationSideAction.ID);
wideLeftAnnotationSideAction.setText("Wides the left annotation side");
wideLeftAnnotationSideAction.setImageDescriptor(CasEditorPlugin
.getTaeImageDescriptor(Images.WIDE_LEFT_SIDE));
getSite().getSelectionProvider().addSelectionChangedListener(wideLeftAnnotationSideAction);
actionBars.setGlobalActionHandler(WideLeftAnnotationSideAction.ID, wideLeftAnnotationSideAction);
toolBarManager.add(wideLeftAnnotationSideAction);
// lower left annotation side action
LowerLeftAnnotationSideAction lowerLeftAnnotationSideAction = new LowerLeftAnnotationSideAction(
editor);
lowerLeftAnnotationSideAction.setActionDefinitionId(LowerLeftAnnotationSideAction.ID);
lowerLeftAnnotationSideAction.setText("Lowers the left annotation side");
lowerLeftAnnotationSideAction.setImageDescriptor(CasEditorPlugin
.getTaeImageDescriptor(Images.LOWER_LEFT_SIDE));
getSite().getSelectionProvider().addSelectionChangedListener(lowerLeftAnnotationSideAction);
actionBars.setGlobalActionHandler(LowerLeftAnnotationSideAction.ID, lowerLeftAnnotationSideAction);
toolBarManager.add(lowerLeftAnnotationSideAction);
// lower right annotation side action
LowerRightAnnotationSideAction lowerRightAnnotationSideAction =
new LowerRightAnnotationSideAction(editor);
lowerRightAnnotationSideAction.setActionDefinitionId(LowerRightAnnotationSideAction.ID);
lowerRightAnnotationSideAction.setText("Lowers the right annotation side");
lowerRightAnnotationSideAction.setImageDescriptor(CasEditorPlugin
.getTaeImageDescriptor(Images.LOWER_RIGHT_SIDE));
getSite().getSelectionProvider().addSelectionChangedListener(lowerRightAnnotationSideAction);
actionBars.setGlobalActionHandler(LowerRightAnnotationSideAction.ID, lowerRightAnnotationSideAction);
toolBarManager.add(lowerRightAnnotationSideAction);
// wide right annotation side action
WideRightAnnotationSideAction wideRightAnnotationSideAction = new WideRightAnnotationSideAction(
editor);
wideRightAnnotationSideAction.setActionDefinitionId(WideRightAnnotationSideAction.ID);
wideRightAnnotationSideAction.setText("Wides the right annotation side");
wideRightAnnotationSideAction.setImageDescriptor(CasEditorPlugin
.getTaeImageDescriptor(Images.WIDE_RIGHT_SIDE));
getSite().getSelectionProvider().addSelectionChangedListener(wideRightAnnotationSideAction);
actionBars.setGlobalActionHandler(WideRightAnnotationSideAction.ID, wideRightAnnotationSideAction);
toolBarManager.add(wideRightAnnotationSideAction);
// merge action
MergeAnnotationAction mergeAction = new MergeAnnotationAction(editor);
getSite().getSelectionProvider().addSelectionChangedListener(mergeAction);
mergeAction.setImageDescriptor(CasEditorPlugin.getTaeImageDescriptor(Images.MERGE));
toolBarManager.add(mergeAction);
// delete action
toolBarManager.add(ActionFactory.DELETE.create(getSite().getWorkbenchWindow()));
super.setActionBars(actionBars);
}