use of net.heartsome.cat.ts.ui.xliffeditor.nattable.celleditor.SourceEditMode in project translationstudio8 by heartsome.
the class ChangeSourceEditableHandler method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
IEditorPart editor = HandlerUtil.getActiveEditor(event);
if (editor != null && editor instanceof XLIFFEditorImplWithNatTable) {
XLIFFEditorImplWithNatTable xliffEditor = (XLIFFEditorImplWithNatTable) editor;
ICellEditor cellEditor = xliffEditor.getTable().getConfigRegistry().getConfigAttribute(EditConfigAttributes.CELL_EDITOR, DisplayMode.EDIT, XLIFFEditorImplWithNatTable.SOURCE_EDIT_CELL_LABEL);
if (cellEditor == null || !(cellEditor instanceof StyledTextCellEditor)) {
return null;
}
HsMultiActiveCellEditor.commit(false);
StyledTextCellEditor sce = (StyledTextCellEditor) cellEditor;
EditableManager editableManager = sce.getEditableManager();
// SourceEditMode nextMode = editableManager.getSourceEditMode().getNextMode();
SourceEditMode nextMode = getSourceEditMode(editableManager);
editableManager.setSourceEditMode(nextMode);
// element.setIcon(Activator.getImageDescriptor(nextMode.getImagePath()));
if (!sce.isClosed()) {
editableManager.judgeEditable();
// 更新全局 Action 的可用状态,主要是更新编辑-删除功能的可用状态。
sce.getActionHandler().updateActionsEnableState();
}
sce.addClosingListener(listener);
}
return null;
}
Aggregations