use of net.heartsome.cat.ts.ui.qa.dialogs.AddOrEditNontransElementDialog in project translationstudio8 by heartsome.
the class NonTranslationQAPage method addNonTransElement.
/**
* 添加非译元素
*/
public void addNonTransElement() {
NontransElementBean bean = new NontransElementBean();
AddOrEditNontransElementDialog dialog = new AddOrEditNontransElementDialog(getShell(), true, tableViewer, bean);
int result = dialog.open();
if (result == IDialogConstants.OK_ID) {
// 先添加到listViewer中
dataList.add(bean);
tableViewer.refresh();
tableViewer.setSelection(new StructuredSelection(bean));
}
}
use of net.heartsome.cat.ts.ui.qa.dialogs.AddOrEditNontransElementDialog in project translationstudio8 by heartsome.
the class NonTranslationQAPage method editNontransElement.
/**
* 编辑非译元素
*/
private void editNontransElement() {
NontransElementBean bean = null;
ISelection selection = tableViewer.getSelection();
if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
if (structuredSelection.getFirstElement() instanceof NontransElementBean) {
bean = (NontransElementBean) structuredSelection.getFirstElement();
if (validIsInternalElementNonTip(bean)) {
return;
}
AddOrEditNontransElementDialog dialog = new AddOrEditNontransElementDialog(getShell(), false, tableViewer, bean);
int result = dialog.open();
if (result == IDialogConstants.OK_ID) {
tableViewer.refresh();
}
}
}
}
Aggregations