use of net.heartsome.cat.ts.core.bean.TransUnitBean in project translationstudio8 by heartsome.
the class MatchViewPart method reLoadMatches.
public void reLoadMatches(IXliffEditor editor, int rowIndex) {
// 修复 Bug #3064 编辑匹配--更换记忆库后再编辑原记忆库匹配,出现异常.刷新问题
// handler.getTransUnit(rowId);
TransUnitBean transUnit = editor.getRowTransUnitBean(rowIndex);
if (transUnit == null) {
return;
}
XLFHandler handler = editor.getXLFHandler();
if (handler == null) {
return;
}
IProject prj = null;
if (editor instanceof IEditorPart) {
IEditorPart p = (IEditorPart) editor;
FileEditorInput input = (FileEditorInput) p.getEditorInput();
prj = input.getFile().getProject();
}
if (prj == null) {
return;
}
String rowId = handler.getRowId(rowIndex);
TransUnitInfo2TranslationBean tuInfoBean = getTuInfoBean(transUnit, handler, rowId);
executeMatch(editor, rowId, transUnit, tuInfoBean, prj);
}
use of net.heartsome.cat.ts.core.bean.TransUnitBean in project translationstudio8 by heartsome.
the class MatchViewPart method manualExecSimpleTranslation.
public void manualExecSimpleTranslation(int rowIndex, IXliffEditor editor, ISimpleMatcher simpleMatcher) {
if (rowIndex == -1) {
return;
}
// handler.getTransUnit(rowId);
TransUnitBean transUnit = editor.getRowTransUnitBean(rowIndex);
if (transUnit == null) {
return;
}
XLFHandler handler = editor.getXLFHandler();
if (handler == null) {
return;
}
IProject prj = null;
if (editor instanceof IEditorPart) {
IEditorPart p = (IEditorPart) editor;
FileEditorInput input = (FileEditorInput) p.getEditorInput();
prj = input.getFile().getProject();
}
if (prj == null) {
return;
}
String rowId = handler.getRowId(rowIndex);
TransUnitInfo2TranslationBean tuInfo = getTuInfoBean(transUnit, handler, rowId);
TranslationTaskData data = new TranslationTaskData(simpleMatcher, transUnit, tuInfo, editor, rowIndex, prj);
synchronized (manualTranslationTaskContainer) {
manualTranslationTaskContainer.pushTranslationTask(data);
manualTranslationTaskContainer.notify();
}
}
use of net.heartsome.cat.ts.core.bean.TransUnitBean in project translationstudio8 by heartsome.
the class MatchViewPart method manualExecComplexTranslation.
public void manualExecComplexTranslation(int rowIndex, IXliffEditor editor, IComplexMatch complexMatcher) {
if (rowIndex == -1) {
return;
}
// handler.getTransUnit(rowId);
TransUnitBean transUnit = editor.getRowTransUnitBean(rowIndex);
if (transUnit == null) {
return;
}
XLFHandler handler = editor.getXLFHandler();
if (handler == null) {
return;
}
IProject prj = null;
if (editor instanceof IEditorPart) {
IEditorPart p = (IEditorPart) editor;
FileEditorInput input = (FileEditorInput) p.getEditorInput();
prj = input.getFile().getProject();
}
if (prj == null) {
return;
}
String rowId = handler.getRowId(rowIndex);
TransUnitInfo2TranslationBean tuInfo = getTuInfoBean(transUnit, handler, rowId);
TranslationTaskData data = new TranslationTaskData(complexMatcher, transUnit, tuInfo, editor, rowIndex, prj);
synchronized (manualTranslationTaskContainer) {
manualTranslationTaskContainer.pushTranslationTask(data);
manualTranslationTaskContainer.notify();
}
}
Aggregations