Search in sources :

Example 1 with AbstractIndicatorForm

use of org.talend.dataprofiler.core.ui.wizard.indicator.forms.AbstractIndicatorForm in project tdq-studio-se by Talend.

the class DynamicIndicatorOptionsPage method createControl.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
     */
public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(new FillLayout());
    tabFolder = new TabFolder(container, SWT.FLAT);
    tabFolder.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            Object formObject = e.item.getData();
            if (formObject != null && getCurrentDialog() != null) {
                AbstractIndicatorForm form = (AbstractIndicatorForm) formObject;
                String helpHref = form.getFormEnum().getHelpHref();
                getCurrentDialog().setHref(helpHref);
                getCurrentDialog().showHelp();
            }
        }
    });
    FormEnum[] forms = FormEnum.getForms(indicatorUnit);
    if (forms != null) {
        validFroms = createForm(tabFolder, listener, forms);
        setControl(createView(validFroms));
    }
}
Also used : Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) AbstractIndicatorForm(org.talend.dataprofiler.core.ui.wizard.indicator.forms.AbstractIndicatorForm) TabFolder(org.eclipse.swt.widgets.TabFolder) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormEnum(org.talend.dataprofiler.core.ui.wizard.indicator.forms.FormEnum) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 2 with AbstractIndicatorForm

use of org.talend.dataprofiler.core.ui.wizard.indicator.forms.AbstractIndicatorForm in project tdq-studio-se by Talend.

the class DynamicIndicatorOptionsPage method createView.

private Composite createView(AbstractIndicatorForm... forms) {
    try {
        for (AbstractIndicatorForm iForm : forms) {
            TabItem item = new TabItem(tabFolder, SWT.NONE);
            item.setData(iForm);
            item.setText(iForm.getFormName());
            item.setControl(iForm);
        }
    } catch (Exception e) {
        log.error(e, e);
    }
    return tabFolder;
}
Also used : TabItem(org.eclipse.swt.widgets.TabItem) AbstractIndicatorForm(org.talend.dataprofiler.core.ui.wizard.indicator.forms.AbstractIndicatorForm)

Example 3 with AbstractIndicatorForm

use of org.talend.dataprofiler.core.ui.wizard.indicator.forms.AbstractIndicatorForm in project tdq-studio-se by Talend.

the class DynamicTableIndicatorOptionsPage method createForm.

public AbstractIndicatorForm[] createForm(Composite parent, ICheckListener listener, FormEnum[] formTypes) {
    IndicatorParameters parameters = indicatorUnit.getIndicator().getParameters();
    if (parameters == null) {
        parameters = IndicatorsFactory.eINSTANCE.createIndicatorParameters();
        indicatorUnit.getIndicator().setParameters(parameters);
    }
    AbstractIndicatorForm[] froms = new AbstractIndicatorForm[formTypes.length];
    for (int i = 0; i < formTypes.length; i++) {
        AbstractIndicatorForm form = IndicatorFormFactory.createForm(parent, formTypes[i], parameters);
        form.setListener(listener);
        froms[i] = form;
    }
    return froms;
}
Also used : IndicatorParameters(org.talend.dataquality.indicators.IndicatorParameters) AbstractIndicatorForm(org.talend.dataprofiler.core.ui.wizard.indicator.forms.AbstractIndicatorForm)

Example 4 with AbstractIndicatorForm

use of org.talend.dataprofiler.core.ui.wizard.indicator.forms.AbstractIndicatorForm in project tdq-studio-se by Talend.

the class DynamicTableIndicatorOptionsPage method createControl.

public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(new FillLayout());
    tabFolder = new TabFolder(container, SWT.FLAT);
    tabFolder.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            Object formObject = e.item.getData();
            if (formObject != null && getCurrentDialog() != null) {
                AbstractIndicatorForm form = (AbstractIndicatorForm) formObject;
                String helpHref = form.getFormEnum().getHelpHref();
                getCurrentDialog().setHref(helpHref);
                getCurrentDialog().showHelp();
            }
        }
    });
    FormEnum[] forms = FormEnum.getForms(indicatorUnit);
    if (forms != null) {
        validFroms = createForm(tabFolder, listener, forms);
        setControl(createView(validFroms));
    }
}
Also used : Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) AbstractIndicatorForm(org.talend.dataprofiler.core.ui.wizard.indicator.forms.AbstractIndicatorForm) TabFolder(org.eclipse.swt.widgets.TabFolder) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormEnum(org.talend.dataprofiler.core.ui.wizard.indicator.forms.FormEnum) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 5 with AbstractIndicatorForm

use of org.talend.dataprofiler.core.ui.wizard.indicator.forms.AbstractIndicatorForm in project tdq-studio-se by Talend.

the class DynamicTableIndicatorOptionsPage method createView.

private Composite createView(AbstractIndicatorForm... forms) {
    try {
        for (AbstractIndicatorForm iForm : forms) {
            TabItem item = new TabItem(tabFolder, SWT.NONE);
            item.setData(iForm);
            item.setText(iForm.getFormName());
            item.setControl(iForm);
        }
    } catch (Exception e) {
        log.error(e, e);
    }
    return tabFolder;
}
Also used : TabItem(org.eclipse.swt.widgets.TabItem) AbstractIndicatorForm(org.talend.dataprofiler.core.ui.wizard.indicator.forms.AbstractIndicatorForm)

Aggregations

AbstractIndicatorForm (org.talend.dataprofiler.core.ui.wizard.indicator.forms.AbstractIndicatorForm)6 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 FillLayout (org.eclipse.swt.layout.FillLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 TabFolder (org.eclipse.swt.widgets.TabFolder)2 TabItem (org.eclipse.swt.widgets.TabItem)2 FormEnum (org.talend.dataprofiler.core.ui.wizard.indicator.forms.FormEnum)2 IndicatorParameters (org.talend.dataquality.indicators.IndicatorParameters)2