use of org.talend.core.repository.model.ProjectRepositoryNode in project tdi-studio-se by Talend.
the class MetadataGenericContentProvider method getChildren.
@Override
public Object[] getChildren(Object element) {
if (!(element instanceof RepositoryNode)) {
return super.getChildren(element);
}
RepositoryNode repoNode = (RepositoryNode) element;
ProjectRepositoryNode projectRepositoryNode = (ProjectRepositoryNode) repoNode.getRoot();
if (metadataNodeTester.isMetadataTopNode(repoNode)) {
getTopLevelNodes().clear();
getTopLevelNodes().addAll(projectRepositoryNode.getGenericTopNodesMap().values());
// so as to inherit common settings from parent.
getAndStoreTopLevelNode(projectRepositoryNode);
return getTopLevelNodes().toArray();
}
if (!repoNode.isInitialized() && getTopLevelNodes().contains(repoNode)) {
projectRepositoryNode.initializeChildren(repoNode);
repoNode.setInitialized(true);
}
return repoNode.getChildren().toArray();
}
use of org.talend.core.repository.model.ProjectRepositoryNode in project tdi-studio-se by Talend.
the class AbstractVersionManagementProjectSettingPage method processItems.
protected void processItems(List<ItemVersionObject> objects, RepositoryNode node) {
if (node == null) {
return;
}
// if the root node of type is not init, force init.
IProjectRepositoryNode root = node.getRoot();
if (root instanceof ProjectRepositoryNode) {
((ProjectRepositoryNode) root).initNode(node);
}
if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
if (node.getObject() != null) {
Property property = node.getObject().getProperty();
Item item = property.getItem();
if (item != null && filterRepositoryNode(node)) {
// must be item
ItemVersionObject object = createItemVersionObject(node, property);
objects.add(object);
}
}
} else {
IContentProvider contentProvider = treeViewer.getContentProvider();
if (contentProvider instanceof NavigatorContentServiceContentProvider) {
NavigatorContentServiceContentProvider navigatorProvider = (NavigatorContentServiceContentProvider) contentProvider;
Object[] children = navigatorProvider.getChildren(node);
for (Object child : children) {
if (child instanceof RepositoryNode) {
processItems(objects, (RepositoryNode) child);
}
}
} else {
for (IRepositoryNode child : node.getChildren()) {
processItems(objects, (RepositoryNode) child);
}
}
}
}
use of org.talend.core.repository.model.ProjectRepositoryNode in project tdi-studio-se by Talend.
the class CreateProcess method selectRootObject.
protected final void selectRootObject(Properties params) {
IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (null == workbenchWindow) {
return;
}
IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
if (null == workbenchPage) {
return;
}
IPerspectiveDescriptor currentPerspective = workbenchPage.getPerspective();
if (!getPerspectiveId().equals(currentPerspective.getId())) {
// show di perspective
try {
workbenchWindow.getWorkbench().showPerspective(getPerspectiveId(), workbenchWindow);
workbenchPage = workbenchWindow.getActivePage();
} catch (WorkbenchException e) {
ExceptionHandler.process(e);
return;
}
}
IRepositoryView view = RepositoryManagerHelper.getRepositoryView();
if (view != null) {
Object type = params.get("type");
if (getProcessType().name().equals(type)) {
IRepositoryNode processNode = ((ProjectRepositoryNode) view.getRoot()).getRootRepositoryNode(getProcessType());
if (processNode != null) {
setWorkbenchPart(view);
final StructuredViewer viewer = view.getViewer();
if (viewer instanceof TreeViewer) {
((TreeViewer) viewer).expandToLevel(processNode, 1);
}
viewer.setSelection(new StructuredSelection(processNode));
}
}
}
}
use of org.talend.core.repository.model.ProjectRepositoryNode in project tdi-studio-se by Talend.
the class StatusManagerSettingPage method processItems.
private void processItems(List<RepositoryObject> objects, IRepositoryNode node) {
if (node == null) {
return;
}
// if the root node of type is not init, force init.
IProjectRepositoryNode root = node.getRoot();
if (root instanceof ProjectRepositoryNode) {
((ProjectRepositoryNode) root).initNode(node);
}
if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
if (node.getObject() != null) {
Property property = node.getObject().getProperty();
Item item = property.getItem();
if (item != null && filterRepositoryNode((RepositoryNode) node)) {
// must be item
RepositoryObject object = new RepositoryObject(node.getObject().getProperty());
object.setRepositoryNode(node);
// ItemVersionObject object = new ItemVersionObject(node, property.getVersion());
objects.add(object);
}
}
} else {
IContentProvider contentProvider = treeViewer.getContentProvider();
if (contentProvider instanceof NavigatorContentServiceContentProvider) {
NavigatorContentServiceContentProvider navigatorProvider = (NavigatorContentServiceContentProvider) contentProvider;
Object[] children = navigatorProvider.getChildren(node);
for (Object child : children) {
if (child instanceof RepositoryNode) {
processItems(objects, (RepositoryNode) child);
}
}
} else {
for (IRepositoryNode child : node.getChildren()) {
processItems(objects, child);
}
}
}
}
use of org.talend.core.repository.model.ProjectRepositoryNode in project tesb-studio-se by Talend.
the class CreateCamelBean method selectRootObject.
private void selectRootObject(Properties params) {
IRepositoryView view = RepositoryManagerHelper.getRepositoryView();
if (view != null) {
Object type = params.get("type");
if (CamelRepositoryNodeType.repositoryBeansType.name().equals(type)) {
IRepositoryNode processNode = ((ProjectRepositoryNode) view.getRoot()).getRootRepositoryNode(ERepositoryObjectType.PROCESS);
if (processNode != null) {
setWorkbenchPart(view);
final StructuredViewer viewer = view.getViewer();
if (viewer instanceof TreeViewer) {
((TreeViewer) viewer).expandToLevel(processNode, 1);
}
viewer.setSelection(new StructuredSelection(processNode));
}
}
}
}
Aggregations