use of org.talend.designer.xmlmap.util.problem.ProblemsAnalyser in project tdi-studio-se by Talend.
the class FooterComposite method createComponents.
/**
* DOC amaumont Comment method "createComponents".
*/
private void createComponents() {
FormLayout formLayout = new FormLayout();
formLayout.spacing = 15;
this.setLayout(formLayout);
Button applyButton = new Button(this, SWT.NONE);
applyButton.setEnabled(!mapperUi.getMapperComponent().isReadOnly());
//$NON-NLS-1$
applyButton.setText("Apply");
FormData applyFormData = new FormData();
applyFormData.width = 100;
applyButton.setLayoutData(applyFormData);
applyButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
mapperUi.closeMapperDialog(SWT.APPLICATION_MODAL);
}
});
statusBar = new StatusBar(this, SWT.NONE);
final ProblemsAnalyser problemsAnalyser = mapperUi.getMapperManager().getProblemsAnalyser();
if (!problemsAnalyser.getProblems().isEmpty()) {
statusBar.setValues(STATUS.ERROR, problemsAnalyser.getErrorMessage());
}
Button okButton = new Button(this, SWT.NONE);
okButton.setEnabled(!mapperUi.getMapperComponent().isReadOnly());
//$NON-NLS-1$
okButton.setText("OK");
FormData okFormData = new FormData();
okFormData.width = 100;
okButton.setLayoutData(okFormData);
okButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
mapperUi.closeMapperDialog(SWT.OK);
}
});
Button cancelButton = new Button(this, SWT.NONE);
//$NON-NLS-1$
cancelButton.setText("Cancel");
cancelButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
mapperUi.closeMapperDialog(SWT.CANCEL);
}
});
FormData cancelFormData = new FormData();
cancelFormData.width = 100;
cancelButton.setLayoutData(cancelFormData);
cancelFormData.right = new FormAttachment(100, -5);
okFormData.right = new FormAttachment(cancelButton, -5);
applyFormData.right = new FormAttachment(okButton, -5);
}
Aggregations