Search in sources :

Example 1 with IComponentsFactory

use of org.talend.core.model.components.IComponentsFactory in project tdi-studio-se by Talend.

the class ExchangeUtils method reloadComponents.

/**
     * Reload all components from folder and update palette.
     */
public static void reloadComponents() {
    // reload from folder, see ComponentsFactory and UserComponentsProvider
    IComponentsFactory componentsFactory = ComponentsFactoryProvider.getInstance();
    componentsFactory.resetCache();
    // update the palette view, the position of the new component is
    // determined by the FAMILY value in the
    // component's property file
    ComponentPaletteUtilities.updatePalette();
}
Also used : IComponentsFactory(org.talend.core.model.components.IComponentsFactory)

Example 2 with IComponentsFactory

use of org.talend.core.model.components.IComponentsFactory in project tdi-studio-se by Talend.

the class DesignerCoreService method getRefrenceNode.

@Override
public INode getRefrenceNode(String componentName, String paletteType) {
    if (componentName == null) {
        return null;
    }
    IComponentsFactory compFac = CorePlugin.getDefault().getRepositoryService().getComponentsFactory();
    IComponent component = compFac.get(componentName, paletteType);
    if (component == null) {
        return null;
    }
    return new DataNode(component, componentName);
}
Also used : IComponentsFactory(org.talend.core.model.components.IComponentsFactory) IComponent(org.talend.core.model.components.IComponent) DataNode(org.talend.designer.core.model.process.DataNode)

Example 3 with IComponentsFactory

use of org.talend.core.model.components.IComponentsFactory in project tdi-studio-se by Talend.

the class AbstractTalendEditor method init.

protected void init() {
    IComponentsFactory componentsFactory = ComponentsFactoryProvider.getInstance();
    this.componenentsHandler = initComponentsHandler();
    componentsFactory.setComponentsHandler(componenentsHandler);
}
Also used : IComponentsFactory(org.talend.core.model.components.IComponentsFactory)

Example 4 with IComponentsFactory

use of org.talend.core.model.components.IComponentsFactory in project tdi-studio-se by Talend.

the class TalendEditorPaletteFactoryTest method testGetRelatedComponents_partOfComponentName.

@Test
public void testGetRelatedComponents_partOfComponentName() {
    storeRecentlyUsed();
    IComponentsFactory componentsFactory = ComponentsFactoryProvider.getInstance();
    String keyword = "row";
    List<IComponent> componentHits = TalendEditorPaletteFactory.getRelatedComponents(componentsFactory, keyword);
    Assert.assertFalse("Can't find any components", componentHits.isEmpty());
    assertExistedComponent(TJAVAROW, keyword, componentHits);
    assertExistedComponent(TMYSQLROW, keyword, componentHits);
    keyword = "Row";
    componentHits = TalendEditorPaletteFactory.getRelatedComponents(componentsFactory, keyword);
    Assert.assertFalse("Can't find any components", componentHits.isEmpty());
    assertExistedComponent(TJAVAROW, keyword, componentHits);
    assertExistedComponent(TMYSQLROW, keyword, componentHits);
}
Also used : IComponentsFactory(org.talend.core.model.components.IComponentsFactory) IComponent(org.talend.core.model.components.IComponent) Test(org.junit.Test)

Example 5 with IComponentsFactory

use of org.talend.core.model.components.IComponentsFactory in project tdi-studio-se by Talend.

the class TalendEditorPaletteFactoryTest method testGetRelatedComponents_help.

@Test
public void testGetRelatedComponents_help() {
    storeRecentlyUsed();
    IComponentsFactory componentsFactory = ComponentsFactoryProvider.getInstance();
    String keyword = "enter code";
    List<IComponent> componentHits = TalendEditorPaletteFactory.getRelatedComponents(componentsFactory, keyword);
    Assert.assertFalse("Can't find any components", componentHits.isEmpty());
    assertExistedComponent(TJAVA, keyword, componentHits);
    keyword = "enter";
    componentHits = TalendEditorPaletteFactory.getRelatedComponents(componentsFactory, keyword);
    Assert.assertFalse("Can't find any components", componentHits.isEmpty());
    assertExistedComponent(TJAVA, keyword, componentHits);
    assertExistedComponent(TJAVAROW, keyword, componentHits);
}
Also used : IComponentsFactory(org.talend.core.model.components.IComponentsFactory) IComponent(org.talend.core.model.components.IComponent) Test(org.junit.Test)

Aggregations

IComponentsFactory (org.talend.core.model.components.IComponentsFactory)16 IComponent (org.talend.core.model.components.IComponent)12 Test (org.junit.Test)5 File (java.io.File)3 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 RepositoryContext (org.talend.core.context.RepositoryContext)2 FileFilter (java.io.FileFilter)1 LinkedHashSet (java.util.LinkedHashSet)1 IFile (org.eclipse.core.resources.IFile)1 CoreException (org.eclipse.core.runtime.CoreException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 Job (org.eclipse.core.runtime.jobs.Job)1 PaletteRoot (org.eclipse.gef.palette.PaletteRoot)1 PersistenceException (org.talend.commons.exception.PersistenceException)1 ComponentDefinition (org.talend.components.api.component.ComponentDefinition)1 ECodeLanguage (org.talend.core.language.ECodeLanguage)1