use of org.eclipse.ui.part.CellEditorActionHandler in project knime-core by knime.
the class AnnotationEditManager method initCellEditor.
/**
* Initializes the cell editor.
*
* @see org.eclipse.gef.tools.DirectEditManager#initCellEditor()
*/
@Override
protected void initCellEditor() {
// de-select the underlying annotation to remove the selection handles
final GraphicalEditPart editPart = getEditPart();
editPart.getRoot().getViewer().deselectAll();
editPart.getFigure().setVisible(false);
StyledTextEditor stw = (StyledTextEditor) getCellEditor();
Annotation anno = ((AnnotationEditPart) editPart).getModel();
Font defaultFont;
if (editPart instanceof NodeAnnotationEditPart) {
defaultFont = AnnotationEditPart.getNodeAnnotationDefaultFont();
} else if (anno.getVersion() < AnnotationData.VERSION_20151012) {
defaultFont = FontStore.INSTANCE.getSystemDefaultFont();
} else {
defaultFont = AnnotationEditPart.getWorkflowAnnotationDefaultFont();
}
stw.setDefaultFont(defaultFont);
stw.setValue(anno);
// Hook the cell editor's copy/paste actions to the actionBars so that
// they can
// be invoked via keyboard shortcuts.
m_actionBars = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorSite().getActionBars();
saveCurrentActions(m_actionBars);
m_actionHandler = new CellEditorActionHandler(m_actionBars);
m_actionHandler.addCellEditor(getCellEditor());
m_actionBars.updateActionBars();
}
Aggregations