Search in sources :

Example 1 with SampleDataShowWay

use of org.talend.dataquality.analysis.SampleDataShowWay in project tdq-studio-se by Talend.

the class AnalysisParametersImpl method setSampleDataShowWay.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setSampleDataShowWay(SampleDataShowWay newSampleDataShowWay) {
    SampleDataShowWay oldSampleDataShowWay = sampleDataShowWay;
    sampleDataShowWay = newSampleDataShowWay == null ? SAMPLE_DATA_SHOW_WAY_EDEFAULT : newSampleDataShowWay;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, AnalysisPackage.ANALYSIS_PARAMETERS__SAMPLE_DATA_SHOW_WAY, oldSampleDataShowWay, sampleDataShowWay));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) SampleDataShowWay(org.talend.dataquality.analysis.SampleDataShowWay)

Example 2 with SampleDataShowWay

use of org.talend.dataquality.analysis.SampleDataShowWay in project tdq-studio-se by Talend.

the class MatchAnalysisDetailsPage method createDataQueryButtonComp.

/**
 * create "Refresh Button", and the row control input.
 *
 * @param buttonComposite
 */
private void createDataQueryButtonComp(Composite parent) {
    Composite dataQueryComp = toolkit.createComposite(parent);
    GridLayout dataQueryCompLayout = new GridLayout(4, Boolean.FALSE);
    dataQueryComp.setLayout(dataQueryCompLayout);
    Button refreshDataBtn = toolkit.createButton(dataQueryComp, DefaultMessagesImpl.getString("MatchMasterDetailsPage.RefreshDataButton"), // $NON-NLS-1$
    SWT.NONE);
    GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(refreshDataBtn);
    refreshDataBtn.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseDown(MouseEvent e) {
            refreshPreviewData();
        }
    });
    // create the input to control how many rows will be loaded.
    Label rowLoadedLabel = toolkit.createLabel(dataQueryComp, DefaultMessagesImpl.getString("MatchMasterDetailsPage.ControlRowsLabel"), // $NON-NLS-1$
    SWT.NONE);
    GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(rowLoadedLabel);
    rowLoadedText = toolkit.createText(dataQueryComp, null, SWT.BORDER);
    GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(rowLoadedText);
    // fix the width of the text field
    GridData textData = new GridData();
    textData.widthHint = 100;
    rowLoadedText.setLayoutData(textData);
    rowLoadedText.setText(analysisHandler.getDefaultLoadedRowCount());
    rowLoadedText.addModifyListener(new ModifyListener() {

        public void modifyText(final ModifyEvent e) {
            setDirty(true);
        }
    });
    // ADD msjian TDQ-8428: add random way to show data
    sampleDataShowWayCombo = new CCombo(dataQueryComp, SWT.BORDER);
    sampleDataShowWayCombo.setEditable(false);
    for (SampleDataShowWay value : SampleDataShowWay.VALUES) {
        sampleDataShowWayCombo.add(value.getLiteral());
    }
    SampleDataShowWay sampleDataShowWay = getCurrentModelElement().getParameters().getSampleDataShowWay();
    sampleDataShowWayCombo.setText(sampleDataShowWay.getLiteral());
    sampleDataShowWayCombo.addModifyListener(new ModifyListener() {

        public void modifyText(final ModifyEvent e) {
            setDirty(true);
        }
    });
    // TDQ-8428~
    setSampleDataShowWayStatus();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) MouseEvent(org.eclipse.swt.events.MouseEvent) CCombo(org.eclipse.swt.custom.CCombo) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ModifyListener(org.eclipse.swt.events.ModifyListener) Button(org.eclipse.swt.widgets.Button) MouseAdapter(org.eclipse.swt.events.MouseAdapter) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) SampleDataShowWay(org.talend.dataquality.analysis.SampleDataShowWay)

Example 3 with SampleDataShowWay

use of org.talend.dataquality.analysis.SampleDataShowWay in project tdq-studio-se by Talend.

the class AbstractAnalysisMetadataPage method createRefreshDataButtonComp.

/**
 * create "Refresh Button", and the row control input.
 *
 * @param buttonComposite
 */
private void createRefreshDataButtonComp(Composite parent) {
    Composite dataQueryComp = toolkit.createComposite(parent, SWT.NONE);
    GridLayout dataQueryCompLayout = new GridLayout(4, Boolean.FALSE);
    dataQueryComp.setLayout(dataQueryCompLayout);
    // create the input to control how many rows will be loaded.
    Label rowLoadedLabel = toolkit.createLabel(dataQueryComp, DefaultMessagesImpl.getString("MatchMasterDetailsPage.ControlRowsLabel"), // $NON-NLS-1$
    SWT.NONE);
    GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(rowLoadedLabel);
    rowLoadedText = toolkit.createText(dataQueryComp, null, SWT.BORDER);
    // $NON-NLS-1$
    rowLoadedText.setToolTipText(DefaultMessagesImpl.getString("ColumnAnalysisDetailsPage.ControlRowsLabelTooltip"));
    GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(rowLoadedText);
    // fix the width of the text field
    GridData textData = new GridData();
    textData.widthHint = 100;
    rowLoadedText.setLayoutData(textData);
    int number = Integer.valueOf(getAnalysisHandler().getDefaultLoadedRowCount()) > PREVIEW_MAX_ROW_COUNT ? PREVIEW_SUGGEST_ROW_COUNT : Integer.valueOf(getAnalysisHandler().getDefaultLoadedRowCount());
    rowLoadedText.setText(String.valueOf(number));
    rowLoadedText.setTextLimit(3);
    rowLoadedText.addVerifyListener(new VerifyListener() {

        public void verifyText(VerifyEvent e) {
            String inputValue = e.text;
            // $NON-NLS-1$
            Pattern pattern = Pattern.compile("^[0-9]");
            char[] charArray = inputValue.toCharArray();
            for (char c : charArray) {
                if (!pattern.matcher(String.valueOf(c)).matches()) {
                    e.doit = false;
                }
            }
        }
    });
    rowLoadedText.addModifyListener(new ModifyListener() {

        public void modifyText(final ModifyEvent e) {
            setDirty(true);
        }
    });
    // ADD msjian TDQ-8428: add random way to show data
    sampleDataShowWayCombo = new CCombo(dataQueryComp, SWT.BORDER);
    sampleDataShowWayCombo.setEditable(false);
    for (SampleDataShowWay value : SampleDataShowWay.VALUES) {
        sampleDataShowWayCombo.add(value.getLiteral());
    }
    SampleDataShowWay sampleDataShowWay = getCurrentModelElement().getParameters().getSampleDataShowWay();
    sampleDataShowWayCombo.setText(sampleDataShowWay.getLiteral());
    sampleDataShowWayCombo.addModifyListener(new ModifyListener() {

        public void modifyText(final ModifyEvent e) {
            setDirty(true);
        }
    });
    // TDQ-8428~
    Button refreshDataBtn = toolkit.createButton(dataQueryComp, DefaultMessagesImpl.getString("MatchMasterDetailsPage.RefreshDataButton"), // $NON-NLS-1$
    SWT.NONE);
    GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(refreshDataBtn);
    refreshDataBtn.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseDown(MouseEvent e) {
            refreshPreviewData();
        }
    });
}
Also used : Pattern(java.util.regex.Pattern) VerifyListener(org.eclipse.swt.events.VerifyListener) MouseEvent(org.eclipse.swt.events.MouseEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) Label(org.eclipse.swt.widgets.Label) MouseAdapter(org.eclipse.swt.events.MouseAdapter) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) CCombo(org.eclipse.swt.custom.CCombo) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) VerifyEvent(org.eclipse.swt.events.VerifyEvent) SampleDataShowWay(org.talend.dataquality.analysis.SampleDataShowWay)

Aggregations

SampleDataShowWay (org.talend.dataquality.analysis.SampleDataShowWay)3 CCombo (org.eclipse.swt.custom.CCombo)2 ModifyEvent (org.eclipse.swt.events.ModifyEvent)2 ModifyListener (org.eclipse.swt.events.ModifyListener)2 MouseAdapter (org.eclipse.swt.events.MouseAdapter)2 MouseEvent (org.eclipse.swt.events.MouseEvent)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Button (org.eclipse.swt.widgets.Button)2 Composite (org.eclipse.swt.widgets.Composite)2 Label (org.eclipse.swt.widgets.Label)2 Pattern (java.util.regex.Pattern)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 VerifyEvent (org.eclipse.swt.events.VerifyEvent)1 VerifyListener (org.eclipse.swt.events.VerifyListener)1