Search in sources :

Example 1 with ColumnIndicator

use of org.talend.dataprofiler.core.model.ColumnIndicator in project tdq-studio-se by Talend.

the class AnalysisColumnNominalIntervalTreeViewer method getTheSuitedComposite.

/*
     * (non-Javadoc)
     * 
     * @see
     * org.talend.dataprofiler.core.ui.editor.composite.AbstractColumnDropTree#getTheSuitedComposite(org.eclipse.swt
     * .events.SelectionEvent)
     */
@Override
public ExpandableComposite getTheSuitedComposite(SelectionEvent e) {
    Composite[] previewChartCompsites = masterPage.getPreviewChartCompsites();
    if (previewChartCompsites == null) {
        return null;
    }
    Object obj = e.item.getData(COLUMN_INDICATOR_KEY);
    if (obj instanceof ColumnIndicator) {
        ColumnIndicator columnIndicator = (ColumnIndicator) obj;
        for (Composite comp : previewChartCompsites) {
            if (comp.getData() == columnIndicator) {
                return (ExpandableComposite) comp;
            }
        }
    }
    return null;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ColumnIndicator(org.talend.dataprofiler.core.model.ColumnIndicator) MetadataColumnRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite)

Example 2 with ColumnIndicator

use of org.talend.dataprofiler.core.model.ColumnIndicator in project tdq-studio-se by Talend.

the class AnalysisColumnSetTreeViewer method getTheSuitedComposite.

/*
     * (non-Javadoc)
     * 
     * @see
     * org.talend.dataprofiler.core.ui.editor.composite.AbstractColumnDropTree#getTheSuitedComposite(org.eclipse.swt
     * .events.SelectionEvent)
     */
@Override
public ExpandableComposite getTheSuitedComposite(SelectionEvent e) {
    Composite[] previewChartCompsites = masterPage.getPreviewChartCompsites();
    if (previewChartCompsites == null) {
        return null;
    }
    Object obj = e.item.getData(COLUMN_INDICATOR_KEY);
    if (obj instanceof ColumnIndicator) {
        ColumnIndicator columnIndicator = (ColumnIndicator) obj;
        for (Composite comp : previewChartCompsites) {
            if (comp.getData() == columnIndicator) {
                return (ExpandableComposite) comp;
            }
        }
    }
    return null;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ColumnIndicator(org.talend.dataprofiler.core.model.ColumnIndicator) EObject(org.eclipse.emf.ecore.EObject) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite)

Example 3 with ColumnIndicator

use of org.talend.dataprofiler.core.model.ColumnIndicator in project tdq-studio-se by Talend.

the class ModelElementIndicatorHelper method getColumns.

/**
 * Get columns from modelElementIndicators
 *
 * @param modelElementIndicators
 * @return
 */
public static final List<MetadataColumn> getColumns(ModelElementIndicator[] modelElementIndicators) {
    List<MetadataColumn> columns = new ArrayList<MetadataColumn>();
    for (ModelElementIndicator modelElementIndicator : modelElementIndicators) {
        ColumnIndicator switchColumnIndicator = switchColumnIndicator(modelElementIndicator);
        if (switchColumnIndicator == null) {
            continue;
        }
        columns.add(switchColumnIndicator.getTdColumn());
    }
    return columns;
}
Also used : MetadataColumn(org.talend.core.model.metadata.builder.connection.MetadataColumn) ColumnIndicator(org.talend.dataprofiler.core.model.ColumnIndicator) ArrayList(java.util.ArrayList) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator)

Example 4 with ColumnIndicator

use of org.talend.dataprofiler.core.model.ColumnIndicator in project tdq-studio-se by Talend.

the class ModelElementIndicatorHelper method getModelElementDisplayName.

/**
 * DOC xqliu Comment method "getModelElementDisplayName".
 *
 * @param meIndicator
 * @return
 */
public static final String getModelElementDisplayName(ModelElementIndicator meIndicator) {
    String meName = meIndicator.getElementName();
    // $NON-NLS-1$
    String typeName = "";
    if (meIndicator instanceof ColumnIndicator) {
        // MOD scorreia 2010-10-20 bug 16403 avoid NPE here
        TdSqlDataType sqlDataType = ((ColumnIndicator) meIndicator).getTdColumn().getSqlDataType();
        // $NON-NLS-1$
        typeName = sqlDataType != null ? sqlDataType.getName() : "unknown";
    } else if (meIndicator instanceof DelimitedFileIndicatorImpl) {
        MetadataColumn mColumn = ((DelimitedFileIndicatorImpl) meIndicator).getMetadataColumn();
        typeName = TalendTypeConvert.convertToJavaType(mColumn.getTalendType());
    }
    return meName != null ? meName + PluginConstant.SPACE_STRING + PluginConstant.PARENTHESIS_LEFT + typeName + PluginConstant.PARENTHESIS_RIGHT : // $NON-NLS-1$
    "null";
}
Also used : MetadataColumn(org.talend.core.model.metadata.builder.connection.MetadataColumn) ColumnIndicator(org.talend.dataprofiler.core.model.ColumnIndicator) DelimitedFileIndicatorImpl(org.talend.dataprofiler.core.model.impl.DelimitedFileIndicatorImpl) TdSqlDataType(org.talend.cwm.relational.TdSqlDataType)

Example 5 with ColumnIndicator

use of org.talend.dataprofiler.core.model.ColumnIndicator in project tdq-studio-se by Talend.

the class ModelElementIndicatorHelper method getColumn.

/**
 * Get column from modelElementIndicator
 *
 * @param modelElementIndicator
 * @return MetadataColumn if convert is normal else return null
 */
public static final MetadataColumn getColumn(ModelElementIndicator modelElementIndicator) {
    if (modelElementIndicator == null) {
        return null;
    }
    ColumnIndicator switchColumnIndicator = switchColumnIndicator(modelElementIndicator);
    if (switchColumnIndicator != null) {
        return switchColumnIndicator.getTdColumn();
    }
    // TDQ-10198: support Delimited File connection column
    DelimitedFileIndicator switchDelimitedFileIndicator = switchDelimitedFileIndicator(modelElementIndicator);
    if (switchDelimitedFileIndicator != null) {
        return switchDelimitedFileIndicator.getMetadataColumn();
    }
    return null;
}
Also used : ColumnIndicator(org.talend.dataprofiler.core.model.ColumnIndicator) DelimitedFileIndicator(org.talend.dataprofiler.core.model.DelimitedFileIndicator)

Aggregations

ColumnIndicator (org.talend.dataprofiler.core.model.ColumnIndicator)8 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)3 ArrayList (java.util.ArrayList)2 Composite (org.eclipse.swt.widgets.Composite)2 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)2 TdSqlDataType (org.talend.cwm.relational.TdSqlDataType)2 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)2 DelimitedFileIndicatorImpl (org.talend.dataprofiler.core.model.impl.DelimitedFileIndicatorImpl)2 IFile (org.eclipse.core.resources.IFile)1 EObject (org.eclipse.emf.ecore.EObject)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)1 DelimitedFileIndicator (org.talend.dataprofiler.core.model.DelimitedFileIndicator)1 Pattern (org.talend.dataquality.domain.pattern.Pattern)1 DataminingType (org.talend.dataquality.indicators.DataminingType)1 Indicator (org.talend.dataquality.indicators.Indicator)1 PatternMatchingIndicator (org.talend.dataquality.indicators.PatternMatchingIndicator)1