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));
}
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();
}
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();
}
});
}
Aggregations