Search in sources :

Example 26 with ItemRecord

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

the class FileTreeLabelProviderTest method testGetImageObjectCase3.

/**
 * Test method for {@link org.talend.dataprofiler.core.ui.imex.FileTreeLabelProvider#getImage(java.lang.Object)}.
 * case 2 :element is sql rule
 */
@Test
public void testGetImageObjectCase3() {
    File file = ResourcesPlugin.getWorkspace().getRoot().getFolder(new Path(createTDQSQLRuleItem.getDqrule().eResource().getURI().toPlatformString(false))).getLocation().toFile();
    ItemRecord itemRecord = new ItemRecord(file);
    FileTreeLabelProvider fileTreeLabelProvider = new FileTreeLabelProvider();
    Image image = fileTreeLabelProvider.getImage(itemRecord);
    Assert.assertEquals(ImageLib.getImage(ImageLib.DQ_RULE), image);
}
Also used : Path(org.eclipse.core.runtime.Path) ItemRecord(org.talend.dataprofiler.core.ui.imex.model.ItemRecord) Image(org.eclipse.swt.graphics.Image) File(java.io.File) Test(org.junit.Test)

Aggregations

ItemRecord (org.talend.dataprofiler.core.ui.imex.model.ItemRecord)26 File (java.io.File)15 ArrayList (java.util.ArrayList)14 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)10 IFile (org.eclipse.core.resources.IFile)6 Path (org.eclipse.core.runtime.Path)6 IndicatorDefinition (org.talend.dataquality.indicators.definition.IndicatorDefinition)5 List (java.util.List)4 Image (org.eclipse.swt.graphics.Image)4 TreeItem (org.eclipse.swt.widgets.TreeItem)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 IPath (org.eclipse.core.runtime.IPath)3 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 Test (org.junit.Test)3 Property (org.talend.core.model.properties.Property)3 HashMap (java.util.HashMap)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)2 ModifyEvent (org.eclipse.swt.events.ModifyEvent)2