use of net.heartsome.cat.ts.ui.xliffeditor.nattable.UpdateDataBean in project translationstudio8 by heartsome.
the class XLIFFEditorImplWithNatTable method affterFuzzyMatchApplayTarget.
/**
* (non-Javadoc)
* @see net.heartsome.cat.ts.ui.editors.IXliffEditor#affterFuzzyMatchApplayTarget(int, String, String, String)
*/
public void affterFuzzyMatchApplayTarget(int rowIndex, String targetContent, String matchType, String quality) {
StyledTextCellEditor cellEditor = HsMultiActiveCellEditor.getTargetStyledEditor();
if (cellEditor != null && cellEditor.getRowIndex() == rowIndex) {
String currentText = cellEditor.getSegmentViewer().getText();
if (currentText == null || currentText.trim().equals("")) {
UpdateDataBean bean = new UpdateDataBean(targetContent, matchType, quality);
cellEditor.setCanonicalValue(bean);
}
}
}
use of net.heartsome.cat.ts.ui.xliffeditor.nattable.UpdateDataBean in project translationstudio8 by heartsome.
the class StyledTextCellEditor method activateCell.
protected Control activateCell(final Composite parent, HsMultiCellEditor hsCellEditor) {
this.hsCellEditor = hsCellEditor;
StyledText text = createTextControl(parent);
text.setBounds(hsCellEditor.getEditorBounds());
// analyzeCellType(); // 分析单元格类型。
this.cellType = hsCellEditor.getType();
if (cellType == NatTableConstant.TARGET) {
this.source = HsMultiActiveCellEditor.getSourceEditor().getOriginalCanonicalValue().toString();
// 设置原文本,用来解析内部标记
viewer.setSource(source);
}
// 判断“可编辑”状态;
editableManager.judgeEditable();
// If we have an initial value, then
Object originalCanonicalValue = this.hsCellEditor.getOriginalCanonicalValue();
if (originalCanonicalValue != null) {
setCanonicalValue(new UpdateDataBean(originalCanonicalValue.toString(), null, null));
} else {
setCanonicalValue(new UpdateDataBean());
}
// 改变关闭状态标识
close = false;
xliffEditor.getTable().addDisposeListener(this);
// text.forceFocus();
// 初始化撤销/重做管理器,设置步长为 50。
viewer.initUndoManager(50);
// 绑定全局 Edit 菜单
actionHandler.addTextViewer(viewer);
text.addKeyListener(movedKeyListener);
// 移除向上和向下键默认事件处理,将此部分实现放到upAndDownKeyListener监听中
text.setKeyBinding(SWT.ARROW_DOWN, SWT.NULL);
text.setKeyBinding(SWT.ARROW_UP, SWT.NULL);
addMouselistener(text);
return text;
}
Aggregations