use of org.talend.repository.ui.views.IRepositoryView in project tdi-studio-se by Talend.
the class ExportItemAction method doRun.
@Override
protected void doRun() {
if (toolbarAction) {
this.setWorkbenchPart(null);
}
IRepositoryView repositoryView = getViewPart();
if (repositoryView != null && repositoryView.getViewer() instanceof TreeViewer) {
((TreeViewer) repositoryView.getViewer()).getTree().setFocus();
}
ExportItemWizard wizard = new ExportItemWizard((repositoryView != null ? repositoryView.getViewSite().getId() : null));
IWorkbench workbench = getWorkbench();
wizard.setWindowTitle(EXPORT_ITEM);
if (!toolbarAction) {
wizard.init(workbench, (IStructuredSelection) this.getSelection());
} else {
if (repositoryView != null) {
IStructuredSelection selection = (IStructuredSelection) repositoryView.getViewer().getSelection();
wizard.init(workbench, selection);
}
}
Shell activeShell = Display.getCurrent().getActiveShell();
WizardDialog dialog = new WizardDialog(activeShell, wizard);
dialog.open();
}
use of org.talend.repository.ui.views.IRepositoryView in project tdi-studio-se by Talend.
the class ExpandAllAction method doRun.
@Override
protected void doRun() {
IRepositoryView view = getViewPart();
ISelection selection = getSelection();
if (selection == null) {
return;
}
Object objNode = ((IStructuredSelection) selection).getFirstElement();
if (view != null) {
if (objNode != null) {
RepositoryNode node = (RepositoryNode) objNode;
if ((node.getProperties(EProperties.CONTENT_TYPE) != null) && (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SVN_ROOT)) {
view.expand(node);
view.getViewer().refresh();
return;
}
}
Set<ERepositoryObjectType> types = new HashSet<ERepositoryObjectType>();
for (Object obj : ((IStructuredSelection) selection).toArray()) {
expand(view, (RepositoryNode) obj, !view.getExpandedState(obj));
types.add(((RepositoryNode) obj).getContentType());
}
// TDI-21143 : Studio repository view : remove all refresh call to repo view
// for (ERepositoryObjectType type : types) {
// view.refresh(type);
// }
}
}
use of org.talend.repository.ui.views.IRepositoryView in project tdi-studio-se by Talend.
the class TalendWizardArchiveFileResourceExportPage2 method saveDirtyEditors.
@Override
protected boolean saveDirtyEditors() {
boolean result = false;
IRepositoryView repView = RepositoryManagerHelper.findRepositoryView();
if (repView instanceof RepoViewCommonNavigator) {
((RepoViewCommonNavigator) repView).setShouldCheckRepositoryDirty(false);
result = super.saveDirtyEditors();
((RepoViewCommonNavigator) repView).setShouldCheckRepositoryDirty(true);
} else {
return super.saveDirtyEditors();
}
return result;
}
use of org.talend.repository.ui.views.IRepositoryView 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.repository.ui.views.IRepositoryView 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