use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class GenericWizardInternalService method createRepositoryNode.
@Override
public RepositoryNode createRepositoryNode(RepositoryNode curParentNode, String label, ERepositoryObjectType type, ENodeType nodeType) {
RepositoryNode dynamicNode = new RepositoryNode(null, (RepositoryNode) curParentNode.getRoot(), nodeType);
dynamicNode.setProperties(EProperties.LABEL, label);
dynamicNode.setProperties(EProperties.CONTENT_TYPE, type);
curParentNode.getChildren().add(dynamicNode);
return dynamicNode;
}
use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class GenericRepositoryContentHandler method createTable.
private void createTable(RepositoryNode parentNode, IRepositoryViewObject repObj, MetadataTable metadataTable) {
if (!SubItemHelper.isDeleted(metadataTable)) {
RepositoryNode tableNode = RepositoryNodeManager.createMetatableNode(parentNode, repObj, metadataTable);
parentNode.getChildren().add(tableNode);
if (metadataTable.getColumns().size() > 0) {
RepositoryNodeManager.createColumns(tableNode, repObj, metadataTable);
}
}
}
use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class GenericRepositoryContentHandler method createSubNodes.
private void createSubNodes(RepositoryNode parentNode, IRepositoryViewObject repObj, Package pack) {
List<SubContainer> subContainers = PackageHelper.getOwnedElements(pack, SubContainer.class);
if (subContainers.size() > 0) {
for (SubContainer subContainer : subContainers) {
RepositoryNode subContainerNode = createSubContainerNode(parentNode, subContainer.getName());
createSubNodes(subContainerNode, repObj, subContainer);
}
} else {
List<MetadataTable> metadataTables = PackageHelper.getOwnedElements(pack, MetadataTable.class);
for (MetadataTable metadataTable : metadataTables) {
createTable(parentNode, repObj, metadataTable);
}
}
}
use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class ReadRoutineAction method init.
/*
* (non-Javadoc)
*
* @see org.talend.repository.ui.actions.ITreeContextualAction#init(org.eclipse.jface.viewers.TreeViewer,
* org.eclipse.jface.viewers.IStructuredSelection)
*/
public void init(TreeViewer viewer, IStructuredSelection selection) {
super.init(viewer, selection);
boolean canWork = !selection.isEmpty() && selection.size() == 1;
if (canWork) {
RepositoryNode node = (RepositoryNode) selection.getFirstElement();
if (node.getObjectType() != ERepositoryObjectType.ROUTINES) {
canWork = false;
}
if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.LOCK_BY_USER) {
canWork = false;
}
}
setEnabled(canWork);
}
use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class ExportItemWizardPage method getUnTestCaseChildren.
private List<Object> getUnTestCaseChildren(Object[] children) {
ITestContainerProviderService testContainerService = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
testContainerService = (ITestContainerProviderService) GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
}
List<Object> childrenNodes = new ArrayList<Object>();
for (Object obj : children) {
if ((obj instanceof RepositoryNode) && testContainerService != null) {
boolean isTestCase = testContainerService.isTestContainerType(((RepositoryNode) obj).getObjectType());
if (!isTestCase) {
childrenNodes.add(obj);
}
} else {
childrenNodes.add(obj);
}
}
return childrenNodes;
}
Aggregations