use of net.heartsome.cat.ts.ui.xliffeditor.nattable.search.coordinate.ActiveCellRegion in project translationstudio8 by heartsome.
the class FindReplaceDialog method doReplace.
/**
* 替换 ;
*/
private void doReplace() {
CellRegion activeCellRegion = ActiveCellRegion.getActiveCellRegion();
if (activeCellRegion == null) {
return;
}
StyledTextCellEditor cellEditor = HsMultiActiveCellEditor.getTargetStyledEditor();
if (cellEditor != null) {
StyledText text = cellEditor.getSegmentViewer().getTextWidget();
String sleText = text.getSelectionText();
String findStr = cmbFind.getText();
if (XliffEditorParameter.getInstance().isShowNonpirnttingCharacter()) {
findStr = findStr.replaceAll("\\n", Constants.LINE_SEPARATOR_CHARACTER + "\n");
findStr = findStr.replaceAll("\\t", Constants.TAB_CHARACTER + "");
findStr = findStr.replaceAll(" ", Constants.SPACE_CHARACTER + "");
}
if (sleText != null && sleText.toLowerCase().equals(findStr.toLowerCase())) {
Point p = text.getSelection();
text.replaceTextRange(p.x, p.y - p.x, cmbReplace.getText());
}
}
}
Aggregations