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;
}
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;
}
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;
}
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";
}
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;
}
Aggregations