private ITextEditor showOpenTextEditor(IWorkbenchPage page, IFile file) { IEditorPart editor= page.findEditor(new FileEditorInput(file)); if (editor instanceof ITextEditor) { page.bringToTop(editor); return (ITextEditor) editor; } return null; }
public void run() { if (!fTree.isDisposed()) { fTreeViewer.refresh(); fDeleteLogAction.setEnabled(fInputFile.exists() && fInputFile.equals(Platform.getLogFileLocation().toFile())); fOpenLogAction.setEnabled(fInputFile.exists()); fExportAction.setEnabled(fInputFile.exists()); if (activate && fActivateViewAction.isChecked()) { IWorkbenchPage page = PDERuntimePlugin.getActivePage(); if (page != null) page.bringToTop(view); } } } });
@Override public void activateEditor(IWorkbenchPage page, IStructuredSelection selection) { if (selection == null || selection.isEmpty()) return; Object element= selection.getFirstElement(); IEditorPart part= EditorUtility.isOpenInEditor(element); if (part != null) { page.bringToTop(part); if (element instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) element); } }
@Override public void activateEditor(IWorkbenchPage page, IStructuredSelection selection) { if (selection == null || selection.isEmpty()) return; Object element= selection.getFirstElement(); IEditorPart part= EditorUtility.isOpenInEditor(element); if (part != null) { page.bringToTop(part); if (element instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) element); } }
public void activateEditor(IWorkbenchPage page, IStructuredSelection selection) { if (selection == null || selection.isEmpty()) return; Object element= selection.getFirstElement(); IEditorPart part= EditorUtility.isOpenInEditor(element); if (part != null) { page.bringToTop(part); if (element instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) element); } }
/** * Links to editor (if option enabled) * @param selection the selection */ private void linkToEditor(ISelection selection) { Object obj = getSingleElement(selection); if (obj != null) { IEditorPart part = isOpenInEditor(obj); if (part != null) { IWorkbenchPage page= getSite().getPage(); page.bringToTop(part); } } }
private IHistoryPage checkForExistingPage(Object object, boolean refresh, boolean thisViewOnly, IHistoryPageSource pageSource) { //first check to see if the main history view contains the current resource IHistoryPage tempPage = checkForExistingPage(object, refresh, pageSource); if (tempPage != null || thisViewOnly) return tempPage; tempPage = searchHistoryViewsForObject(object, refresh, pageSource); if (tempPage != null) getSite().getPage().bringToTop((IWorkbenchPart)tempPage.getHistoryView()); return tempPage; }
private IHistoryPage checkForExistingPage(Object object, boolean refresh, boolean thisViewOnly, IHistoryPageSource pageSource) { // first check to see if the main history view contains the current resource IHistoryPage tempPage = checkForExistingPage(object, refresh, pageSource); if (tempPage != null || thisViewOnly) return tempPage; tempPage = searchHistoryViewsForObject(object, refresh, pageSource); if (tempPage != null) getSite().getPage().bringToTop((IWorkbenchPart)tempPage.getHistoryView()); return tempPage; }
@Override public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) { if (aSelection == null || aSelection.isEmpty()) return; if (aSelection.getFirstElement() instanceof IFile) { IEditorInput fileInput = new FileEditorInput((IFile) aSelection.getFirstElement()); IEditorPart editor = null; if ((editor = aPage.findEditor(fileInput)) != null) aPage.bringToTop(editor); } }
private void showView(String id) { IWorkbenchWindow window = getWorkbench().getActiveWorkbenchWindow(); if (window == null) return; IWorkbenchPage page = window.getActivePage(); if (page != null) { try { IViewPart view = page.showView(id); page.bringToTop(view); } catch (PartInitException e) { log(e); } } } /* (non-Javadoc)
/** * Links to editor (if option enabled) * @param selection the selection */ private void linkToEditor(ISelection selection) { Object obj= SelectionUtil.getSingleElement(selection); if (obj != null) { IEditorPart part= EditorUtility.isOpenInEditor(obj); if (part != null) { IWorkbenchPage page= getSite().getPage(); page.bringToTop(part); if (obj instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) obj); } } }
private void showView(String id) { IWorkbenchWindow window = getWorkbench().getActiveWorkbenchWindow(); if (window == null) { return; } IWorkbenchPage page = window.getActivePage(); if (page != null) { try { IViewPart view = page.showView(id); page.bringToTop(view); } catch (PartInitException e) { log(e); } } }
/** * Links to editor (if option enabled) * @param selection the selection */ private void linkToEditor(ISelection selection) { Object obj= SelectionUtil.getSingleElement(selection); if (obj != null) { IEditorPart part= EditorUtility.isOpenInEditor(obj); if (part != null) { IWorkbenchPage page= getSite().getPage(); page.bringToTop(part); if (obj instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) obj); } } }
/** * Links to editor (if option enabled) * @param selection the selection */ private void linkToEditor(ISelection selection) { Object obj= SelectionUtil.getSingleElement(selection); if (obj != null) { IEditorPart part= EditorUtility.isOpenInEditor(obj); if (part != null) { IWorkbenchPage page= getSite().getPage(); page.bringToTop(part); if (obj instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement)obj); } } }
private void showExpressionsView() { IWorkbenchPage page = DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage(); IViewPart part = page.findView(IDebugUIConstants.ID_EXPRESSION_VIEW); if (part == null) { try { page.showView(IDebugUIConstants.ID_EXPRESSION_VIEW); } catch (PartInitException e) { } } else { page.bringToTop(part); } }
/** * Links to editor (if option enabled) * @param selection the selection */ private void linkToEditor(ISelection selection) { Object obj= SelectionUtil.getSingleElement(selection); if (obj != null) { IEditorPart part= EditorUtility.isOpenInEditor(obj); if (part != null) { IWorkbenchPage page= getSite().getPage(); page.bringToTop(part); if (obj instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement)obj); } } }
private void doSelectionChanged(SelectionChangedEvent selectionChangedEvent) { IStructuredSelection selection = (IStructuredSelection) selectionChangedEvent.getSelection(); if (!isActivePart() && AntUIPlugin.getActivePage() != null) { AntUIPlugin.getActivePage().bringToTop(this); } AntElementNode selectedXmlElement = (AntElementNode) selection.getFirstElement(); if (selectedXmlElement != null) { setSelection(selectedXmlElement, !isActivePart()); } }
/** * Links to editor (if option enabled) * @param selection the selection */ private void linkToEditor(IStructuredSelection selection) { Object obj= selection.getFirstElement(); if (selection.size() == 1) { IEditorPart part= EditorUtility.isOpenInEditor(obj); if (part != null) { IWorkbenchPage page= getSite().getPage(); page.bringToTop(part); if (obj instanceof IJavaElement) EditorUtility.revealInEditor(part, (IJavaElement) obj); } } }
@Override protected void persist() { super.persist(); DebugPlugin.getDefault().getExpressionManager().addExpression(fExpression); fExpression = null; IWorkbenchPage page = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage(); IViewPart part = page.findView(IDebugUIConstants.ID_EXPRESSION_VIEW); if (part == null) { try { page.showView(IDebugUIConstants.ID_EXPRESSION_VIEW); } catch (PartInitException e) { } } else { page.bringToTop(part); } }
private void revealElementInEditor(Object elem, StructuredViewer originViewer) { // only allow revealing when the type hierarchy is the active page // no revealing after selection events due to model changes if (getSite().getPage().getActivePart() != this) { return; } if (fSelectionProviderMediator.getViewerInFocus() != originViewer) { return; } IEditorPart editorPart= EditorUtility.isOpenInEditor(elem); if (editorPart != null && (elem instanceof IJavaElement)) { getSite().getPage().removePartListener(fPartListener); getSite().getPage().bringToTop(editorPart); EditorUtility.revealInEditor(editorPart, (IJavaElement) elem); getSite().getPage().addPartListener(fPartListener); } }