use of org.talend.core.repository.model.ProjectRepositoryNode in project tesb-studio-se by Talend.
the class CreateESBAction method selectRootObject.
private 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 (!IBrandingConfiguration.PERSPECTIVE_DI_ID.equals(currentPerspective.getId())) {
// show Integration perspective
try {
workbenchWindow.getWorkbench().showPerspective(IBrandingConfiguration.PERSPECTIVE_DI_ID, workbenchWindow);
workbenchPage = workbenchWindow.getActivePage();
} catch (WorkbenchException e) {
ExceptionHandler.process(e);
return;
}
}
IRepositoryView view = RepositoryManagerHelper.getRepositoryView();
if (view != null) {
Object type = params.get("type");
if (ESBRepositoryNodeType.SERVICES.name().equals(type)) {
RepositoryNode servicesNode = ((ProjectRepositoryNode) view.getRoot()).getRootRepositoryNode(ESBRepositoryNodeType.SERVICES);
if (servicesNode != null) {
setWorkbenchPart(view);
final StructuredViewer viewer = view.getViewer();
if (viewer instanceof TreeViewer) {
((TreeViewer) viewer).expandToLevel(servicesNode, 1);
}
viewer.setSelection(new StructuredSelection(servicesNode));
}
}
}
}
use of org.talend.core.repository.model.ProjectRepositoryNode in project tesb-studio-se by Talend.
the class ESBService method getServicesTopNode.
private RepositoryNode getServicesTopNode(RepositoryNode node) {
RepositoryNode parent = node.getParent();
if (parent.getParent() instanceof ProjectRepositoryNode) {
return parent;
}
parent = getServicesTopNode(parent);
return parent;
}
use of org.talend.core.repository.model.ProjectRepositoryNode in project tdi-studio-se by Talend.
the class AbstractVersionManagementProjectSettingPage method addRepositoryTreeViewer.
/**
* repository tree viewer.
*/
private void addRepositoryTreeViewer(Composite leftComposite) {
GridData gridData = new GridData(GridData.FILL_BOTH);
gridData.widthHint = 210;
gridData.heightHint = 400;
leftComposite.setLayoutData(gridData);
RepoCommonViewerProvider provider = RepoCommonViewerProvider.CHECKBOX;
treeViewer = (CheckboxRepositoryTreeViewer) provider.createViewer(leftComposite);
IProjectRepositoryNode projectRepositoryNode = provider.getProjectRepositoryNode();
processItems(versionObjects, (RepositoryNode) projectRepositoryNode);
addMenuAction(treeViewer.getTree());
// filter
treeViewer.addFilter(new ViewerFilter() {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
RepositoryNode node = (RepositoryNode) element;
return filterRepositoryNode(node);
}
});
// event
treeViewer.addCheckStateListener(checkStateListener);
treeViewer.addTreeListener(new ITreeViewerListener() {
@Override
public void treeCollapsed(TreeExpansionEvent event) {
//
}
@Override
public void treeExpanded(TreeExpansionEvent event) {
// refreshCheckedTreeView();
}
});
expandSomeNodes(projectRepositoryNode);
}
Aggregations