use of org.talend.dataquality.analysis.category.AnalysisCategory in project tdq-studio-se by Talend.
the class ViewerDataFactory method createTreeData.
public static Object createTreeData() {
List<AnalysisTypeNode> returnList = new ArrayList<AnalysisTypeNode>();
// use CategoryHandler
AnalysisCategories analysisCategories = CategoryHandler.getAnalysisCategories();
// use this tree (use label attribute of each Category instance)
EList<AnalysisCategory> categories = analysisCategories.getCategories();
for (AnalysisCategory category : categories) {
AnalysisTypeNode typeNode = new AnalysisTypeNode(category.getLabel(), category.getAnalysisType().getLiteral(), null);
if (category.getSubCategories() != null) {
List<AnalysisTypeNode> subCategories = new ArrayList<AnalysisTypeNode>();
for (AnalysisCategory subCategory : category.getSubCategories()) {
// the Semantic analysis must not appear in TOS DQ.
String label = subCategory.getLabel();
if (org.talend.commons.utils.platform.PluginChecker.isOnlyTopLoaded()) {
if (label.equals("Semantic-aware Analysis")) {
// $NON-NLS-1$
continue;
}
}
subCategories.add(new AnalysisTypeNode(label, label, typeNode));
}
typeNode.setChildren(subCategories.toArray());
}
returnList.add(typeNode);
}
return returnList;
}
use of org.talend.dataquality.analysis.category.AnalysisCategory in project tdq-studio-se by Talend.
the class AnalysisCategoryItemProvider method getText.
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
AnalysisType labelValue = ((AnalysisCategory) object).getAnalysisType();
String label = labelValue == null ? null : labelValue.toString();
return label == null || label.length() == 0 ? getString("_UI_AnalysisCategory_type") : getString("_UI_AnalysisCategory_type") + " " + label;
}
use of org.talend.dataquality.analysis.category.AnalysisCategory in project tdq-studio-se by Talend.
the class CategoryHandlerTest method testGetAnalysisCategories.
/**
* Test method for {@link org.talend.dq.analysis.category.CategoryHandler#getAnalysisCategories()}.
*/
@Test
public void testGetAnalysisCategories() {
AnalysisCategories analysisCategories = CategoryHandler.getAnalysisCategories();
Assert.assertNotNull(analysisCategories);
EList<AnalysisCategory> categories = analysisCategories.getCategories();
Assert.assertNotNull(categories);
Assert.assertFalse(categories.isEmpty());
for (AnalysisCategory analysisCategory : categories) {
// $NON-NLS-1$
System.out.println("-" + analysisCategory.getLabel());
if (!analysisCategory.getSubCategories().isEmpty()) {
for (AnalysisCategory subCategory : analysisCategory.getSubCategories()) {
// $NON-NLS-1$
System.out.println("\t+--" + subCategory.getLabel());
}
}
}
}
Aggregations