use of org.eclipse.ui.navigator.CommonNavigator in project tdi-studio-se by Talend.
the class MetadataGenericContentProvider method addResourceVisitor.
@Override
protected void addResourceVisitor(CommonViewer v) {
if (v == null) {
return;
}
RepoViewCommonNavigator navigator = null;
if (v instanceof RepoViewCommonViewer) {
CommonNavigator commonNavigator = ((RepoViewCommonViewer) v).getCommonNavigator();
if (commonNavigator instanceof RepoViewCommonNavigator) {
navigator = ((RepoViewCommonNavigator) commonNavigator);
}
}
if (navigator == null) {
return;
}
if (this.genericNodeVisitor != null) {
navigator.removeVisitor(this.genericNodeVisitor);
}
this.genericNodeVisitor = new GenericNodeDirectChildrenNodeVisitor();
navigator.addVisitor(this.genericNodeVisitor);
}
use of org.eclipse.ui.navigator.CommonNavigator in project translationstudio8 by heartsome.
the class ApplicationWorkbenchWindowAdvisor method setInitLinkEnable.
/**
* 当程序第一次运行时(或是重新换了命名空间),设置项目视图的 link with editor 按钮处于选中状态
* robert 2013-01-04
*/
private void setInitLinkEnable() {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
boolean isInitialRun = !store.getBoolean(IPreferenceConstants.INITIAL_RUN);
if (isInitialRun) {
IViewPart navigator = getWindowConfigurer().getWindow().getActivePage().findView("net.heartsome.cat.common.ui.navigator.view");
CommonNavigator commonNavigator = (CommonNavigator) navigator;
commonNavigator.setLinkingEnabled(true);
store.setValue(IPreferenceConstants.INITIAL_RUN, true);
}
}
use of org.eclipse.ui.navigator.CommonNavigator in project linuxtools by eclipse.
the class GcovTest method testGcovSummaryByLaunch.
@Test
public void testGcovSummaryByLaunch() {
display.syncExec(() -> {
try {
CommonNavigator vc = (CommonNavigator) window.getActivePage().showView(ProjectExplorer.VIEW_ID);
vc.selectReveal(new StructuredSelection(project.getFile(getBinName())));
Menu menu = new MenuManager().createContextMenu(vc.getCommonViewer().getControl());
new ProfileContextualLaunchAction(menu);
for (MenuItem item : menu.getItems()) {
if (item.getText().endsWith("Profile Code Coverage")) {
((ActionContributionItem) item.getData()).getAction().run();
break;
}
}
} catch (PartInitException e1) {
Assert.fail("Cannot show Project Explorer.");
}
try {
window.getActivePage().showView("org.eclipse.linuxtools.gcov.view");
} catch (PartInitException e2) {
Assert.fail("Cannot show GCov View.");
}
});
// Wait for the build job to finish (note: DebugUIPlugin doesn't put launch jobs in a family)
Job[] jobs = Job.getJobManager().find(null);
for (Job job : jobs) {
if (job.getName().contains("Gcov")) {
try {
job.join();
} catch (InterruptedException e) {
}
break;
}
}
}
use of org.eclipse.ui.navigator.CommonNavigator in project linuxtools by eclipse.
the class RemoveConnectionCommandHandler method execute.
@Override
public Object execute(ExecutionEvent event) {
final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
if (activePart instanceof CommonNavigator) {
final CommonViewer viewer = ((CommonNavigator) activePart).getCommonViewer();
final ITreeSelection selection = (ITreeSelection) viewer.getSelection();
Stream.of(selection.getPaths()).forEach(p -> DockerConnectionManager.getInstance().removeConnection((IDockerConnection) p.getLastSegment()));
}
return null;
}
use of org.eclipse.ui.navigator.CommonNavigator in project tdq-studio-se by Talend.
the class RepositoryNodeHelper method getDQCommonViewer.
public static CommonViewer getDQCommonViewer(boolean open) {
IViewPart part = null;
CommonViewer commonViewer = null;
IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (activeWorkbenchWindow != null) {
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
if (activePage != null) {
part = activePage.findView(DQRESPOSITORYVIEW);
if (part == null) {
if (open) {
try {
part = activePage.showView(DQRESPOSITORYVIEW);
// open detail view at the same time
IViewPart detailPart = activePage.findView(DQRESPOSITORY_DETAIL_VIEW);
if (detailPart == null) {
activePage.showView(DQRESPOSITORY_DETAIL_VIEW);
}
} catch (PartInitException e) {
e.printStackTrace();
}
if (part == null) {
return null;
}
} else {
return null;
}
}
CommonNavigator dqView = (CommonNavigator) part;
commonViewer = dqView.getCommonViewer();
}
}
return commonViewer;
}
Aggregations