use of net.heartsome.cat.convert.ui.dialog.IConversionItemDialog in project translationstudio8 by heartsome.
the class ConversionWizardPage method createSegmentationGroup.
/**
* 创建分段规则选择组
* @param contents
* ;
*/
private void createSegmentationGroup(Composite contents) {
Group segmentation = new Group(contents, SWT.NONE);
//$NON-NLS-1$
segmentation.setText(Messages.getString("wizard.ConversionWizardPage.segmentation"));
segmentation.setLayout(new GridLayout(3, false));
GridData data = new GridData(GridData.FILL_HORIZONTAL);
data.widthHint = 500;
segmentation.setLayoutData(data);
Label segLabel = new Label(segmentation, SWT.NONE);
//$NON-NLS-1$
segLabel.setText(Messages.getString("wizard.ConversionWizardPage.segLabel"));
srxFile = new Text(segmentation, SWT.BORDER | SWT.READ_ONLY);
srxFile.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
srxFile.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
for (ConversionConfigBean conversionConfigBean : conversionConfigBeans) {
conversionConfigBean.setInitSegmenter(srxFile.getText());
}
validate();
}
});
final Button segBrowse = new Button(segmentation, SWT.PUSH);
//$NON-NLS-1$
segBrowse.setText(Messages.getString("wizard.ConversionWizardPage.segBrowse"));
segBrowse.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
IConversionItemDialog conversionItemDialog = FileDialogFactoryFacade.createFileDialog(getShell(), SWT.NONE);
int result = conversionItemDialog.open();
if (result == IDialogConstants.OK_ID) {
IConversionItem conversionItem = conversionItemDialog.getConversionItem();
srxFile.setText(conversionItem.getLocation().toOSString());
}
}
});
}
Aggregations