use of org.talend.core.model.utils.IComponentName in project tdi-studio-se by Talend.
the class ComponentChooseDialog method getAppropriateComponent.
private void getAppropriateComponent(Item item, boolean quickCreateInput, boolean quickCreateOutput, TempStore store, ERepositoryObjectType type) {
IComponentName rcSetting = RepositoryComponentManager.getSetting(item, type);
// For handler, need check for esb
if (rcSetting == null) {
for (IDragAndDropServiceHandler handler : DragAndDropManager.getHandlers()) {
rcSetting = handler.getCorrespondingComponentName(item, type);
if (rcSetting != null) {
break;
}
}
if (rcSetting == null) {
return;
}
}
boolean isCurrentProject = true;
String projectName = null;
if (store.seletetedNode.getObject() != null) {
projectName = store.seletetedNode.getObject().getProjectLabel();
isCurrentProject = projectName.equals(ProjectManager.getInstance().getCurrentProject().getLabel());
}
List<IComponent> neededComponents = RepositoryComponentManager.filterNeededComponents(item, store.seletetedNode, type, isCurrentProject, projectName);
for (IDragAndDropServiceHandler handler : DragAndDropManager.getHandlers()) {
List<IComponent> comList = handler.filterNeededComponents(item, store.seletetedNode, type);
if (comList != null) {
for (IComponent handlerComp : comList) {
if (!neededComponents.contains(handlerComp) && !handlerComp.isTechnical()) {
neededComponents.add(handlerComp);
}
}
}
}
// special handle hbase to support tpigLoad
String hbaseName = EDatabaseTypeName.HBASE.getDisplayName().toUpperCase();
if (rcSetting != null && (hbaseName).equals(rcSetting.toString())) {
IComponentsService service = (IComponentsService) GlobalServiceRegister.getDefault().getService(IComponentsService.class);
String componentProductname = null;
Set<IComponent> components = service.getComponentsFactory().getComponents();
for (IComponent component : components) {
componentProductname = component.getRepositoryType();
if (componentProductname != null && componentProductname.contains(hbaseName) && !neededComponents.contains(component) && !component.isTechnical()) {
neededComponents.add(component);
}
}
}
neededComponents = (List<IComponent>) ComponentUtilities.filterVisibleComponents(neededComponents);
// Check if the components in the list neededComponents have the same category that is required by Process.
IComponent component = chooseOneComponent(extractComponents(neededComponents), rcSetting, quickCreateInput, quickCreateOutput);
store.component = component;
store.componentName = rcSetting;
}
use of org.talend.core.model.utils.IComponentName in project tdi-studio-se by Talend.
the class ComponentChooseDialog method getChangePropertyCommand.
private Command getChangePropertyCommand(RepositoryNode selectedNode, Node node, ConnectionItem connectionItem) {
ERepositoryObjectType selectedNodeType = selectedNode.getObjectType();
IComponentName rcSetting = RepositoryComponentManager.getSetting(connectionItem, selectedNodeType);
if (rcSetting == null) {
for (IDragAndDropServiceHandler handler : DragAndDropManager.getHandlers()) {
rcSetting = handler.getCorrespondingComponentName(connectionItem, selectedNodeType);
if (rcSetting != null) {
break;
}
}
if (rcSetting == null) {
return null;
}
}
List<IComponent> neededComponents = RepositoryComponentManager.filterNeededComponents(connectionItem, selectedNode, selectedNodeType);
for (IDragAndDropServiceHandler handler : DragAndDropManager.getHandlers()) {
List<IComponent> comList = handler.filterNeededComponents(connectionItem, selectedNode, selectedNodeType);
if (comList != null) {
for (IComponent handlerComp : comList) {
if (!neededComponents.contains(handlerComp)) {
neededComponents.add(handlerComp);
}
}
}
}
List<String> componentNameList = new ArrayList<String>();
for (IComponent component : neededComponents) {
componentNameList.add(component.getName());
}
String nodeComponentName = node.getComponent().getName();
if (componentNameList.contains(nodeComponentName)) {
IElementParameter param = node.getElementParameterFromField(EParameterFieldType.PROPERTY_TYPE);
if (param != null) {
return getPropertyPublicPart(selectedNode, param, node, connectionItem);
}
}
return null;
}
use of org.talend.core.model.utils.IComponentName in project tesb-studio-se by Talend.
the class CamelEditorDropTargetListener method getAppropriateComponent.
private void getAppropriateComponent(Item item, boolean quickCreateInput, boolean quickCreateOutput, TempStore store, ERepositoryObjectType type) {
IComponentName rcSetting = RepositoryComponentManager.getSetting(item, type);
// For handler, need check for esb
if (rcSetting == null) {
for (IDragAndDropServiceHandler handler : DragAndDropManager.getHandlers()) {
rcSetting = handler.getCorrespondingComponentName(item, type);
if (rcSetting != null) {
break;
}
}
if (rcSetting == null) {
return;
}
}
boolean isCurrentProject = true;
String projectName = null;
if (store.seletetedNode.getObject() != null) {
projectName = store.seletetedNode.getObject().getProjectLabel();
isCurrentProject = projectName.equals(ProjectManager.getInstance().getCurrentProject().getLabel());
}
List<IComponent> neededComponents = RepositoryComponentManager.filterNeededComponents(item, store.seletetedNode, type, isCurrentProject, projectName);
neededComponents = (List<IComponent>) ComponentUtilities.filterVisibleComponents(neededComponents);
// Check if the components in the list neededComponents have the same category that is required by Process.
IComponent component = chooseOneComponent(extractComponents(neededComponents), rcSetting, quickCreateInput, quickCreateOutput);
store.component = component;
store.componentName = rcSetting;
}
Aggregations