use of org.talend.repository.hadoopcluster.ui.dynamic.form.AbstractDynamicDistributionForm.ICheckListener in project tbd-studio-se by Talend.
the class HadoopUiService method createDynamicDistributionPrefForm.
/* (non-Javadoc)
* @see org.talend.core.ui.services.IHadoopUiService#createDynamicDistributionPrefForm(org.eclipse.swt.widgets.Composite)
*/
@Override
public IPreferenceForm createDynamicDistributionPrefForm(Composite parent, PreferencePage prefPage) {
IDynamicMonitor monitor = new DummyDynamicMonitor();
DynamicDistributionPreferenceForm existingConfigForm = new DynamicDistributionPreferenceForm(parent, SWT.NONE, monitor, ITalendCorePrefConstants.ARTIFACT_PROXY_SETTING);
AbstractDynamicDistributionForm.ICheckListener checkListener = new ICheckListener() {
@Override
public String getMessage() {
return prefPage.getMessage();
}
@Override
public void showMessage(String message, int level) {
prefPage.setMessage(message, level);
}
@Override
public void updateButtons() {
boolean isValid = existingConfigForm.isComplete();
prefPage.setValid(isValid);
}
@Override
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws Exception {
// $NON-NLS-1$
throw new Exception("Please implement it if needed");
}
};
existingConfigForm.setCheckListener(checkListener);
return new IPreferenceForm() {
@Override
public void setLayoutData(Object layoutData) {
existingConfigForm.setLayoutData(layoutData);
}
@Override
public boolean performApply() {
return existingConfigForm.performApply();
}
@Override
public boolean performDefaults() {
return existingConfigForm.performDefaults();
}
@Override
public boolean isComplete() {
return existingConfigForm.isComplete();
}
};
}
use of org.talend.repository.hadoopcluster.ui.dynamic.form.AbstractDynamicDistributionForm.ICheckListener in project tbd-studio-se by Talend.
the class DynamicDistributionDetailsPage method createControl.
@Override
public void createControl(Composite parent) {
IDynamicMonitor monitor = new DummyDynamicMonitor();
AbstractDynamicDistributionForm.ICheckListener checkListener = new ICheckListener() {
@Override
public void showMessage(String message, int level) {
setMessage(message, level);
setErrorMessage(message);
}
@Override
public void updateButtons() {
getContainer().updateButtons();
}
@Override
public String getMessage() {
return DynamicDistributionDetailsPage.this.getMessage();
}
@Override
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws Exception {
getContainer().run(fork, cancelable, runnable);
}
};
AbstractDynamicDistributionForm setupForm = new DynamicDistributionDetailsForm(parent, SWT.NONE, getDynamicBuildConfigurationData(), monitor);
setupForm.setCheckListener(checkListener);
setControl(setupForm);
setCurrentForm(setupForm);
setPageComplete(false);
}
use of org.talend.repository.hadoopcluster.ui.dynamic.form.AbstractDynamicDistributionForm.ICheckListener in project tbd-studio-se by Talend.
the class DynamicDistributionPreferencePage method createContents.
@Override
protected Control createContents(Composite parent) {
AbstractDynamicDistributionForm.ICheckListener checkListener = new ICheckListener() {
@Override
public String getMessage() {
return DynamicDistributionPreferencePage.this.getMessage();
}
@Override
public void showMessage(String message, int level) {
setMessage(message, level);
}
@Override
public void updateButtons() {
boolean isValid = getCurrentForm().isComplete();
setValid(isValid);
}
@Override
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws Exception {
// $NON-NLS-1$
throw new Exception("Please implement it if needed");
}
};
IDynamicMonitor monitor = new DummyDynamicMonitor();
DynamicDistributionPreferenceForm existingConfigForm = new DynamicDistributionPreferenceForm(parent, SWT.NONE, monitor, ITalendCorePrefConstants.DYNAMIC_DISTRIBUTION_SETTING);
existingConfigForm.setCheckListener(checkListener);
setCurrentForm(existingConfigForm);
boolean isValid = getCurrentForm().isComplete();
setValid(isValid);
return existingConfigForm;
}
use of org.talend.repository.hadoopcluster.ui.dynamic.form.AbstractDynamicDistributionForm.ICheckListener in project tbd-studio-se by Talend.
the class DynamicDistributionOptionPage method createControl.
@Override
public void createControl(Composite parent) {
IDynamicMonitor monitor = new DummyDynamicMonitor();
AbstractDynamicDistributionForm.ICheckListener checkListener = new ICheckListener() {
@Override
public void showMessage(String message, int level) {
setMessage(message, level);
}
@Override
public void updateButtons() {
getContainer().updateButtons();
}
@Override
public String getMessage() {
return DynamicDistributionOptionPage.this.getMessage();
}
@Override
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws Exception {
getContainer().run(fork, cancelable, runnable);
}
};
AbstractDynamicDistributionForm setupForm = new DynamicDistributionOptionForm(parent, SWT.NONE, getDynamicBuildConfigurationData(), monitor);
setupForm.setCheckListener(checkListener);
setControl(setupForm);
setCurrentForm(setupForm);
setPageComplete(false);
}
Aggregations