public void install(IWorkbenchPage page) { page.addPartListener(this); fIsVisible= page.isPartVisible(getViewPart()); if (fIsVisible) { installOnActiveEditor(page); } }
public void install(IWorkbenchPage page) { page.addPartListener(this); fIsVisible= page.isPartVisible(getViewPart()); if (fIsVisible) { installOnActiveEditor(page); } }
private boolean checkIfPageIsVisible() { return getViewSite().getPage().isPartVisible(this); }
private boolean checkIfPageIsVisible() { return getViewSite().getPage().isPartVisible(this); }
private void initEditors() { IWorkbenchPage[] pages= fWindow.getPages(); for (int i = 0; i < pages.length; i++) { IEditorReference[] editors= pages[i].getEditorReferences(); for (int j = 0; j < editors.length; j++) { IEditorPart editor= editors[j].getEditor(false); if (editor != null && pages[i].isPartVisible(editor)) { startHighlighting(editor); } } } }
private void initEditors() { IWorkbenchPage[] pages= fWindow.getPages(); for (IWorkbenchPage page : pages) { IEditorReference[] editors= page.getEditorReferences(); for (IEditorReference editor2 : editors) { IEditorPart editor= editor2.getEditor(false); if (editor != null && page.isPartVisible(editor)) { startHighlighting(editor); } } } }
@Override public void selectionChanged(IWorkbenchPart part, ISelection sel) { // we ignore selection if we are hidden OR selection is coming from // another source as the last one if (part == null || !part.equals(currentPart)) { return; } // we ignore null selection, or if we are pinned, or our own selection // or same selection if (sel == null || !isImportant(part) || sel.equals(currentSelection)) { return; } currentPart = part; currentSelection = sel; boolean visible = getSite() != null && getSite().getPage().isPartVisible(this); if (!visible) { selectionUpdatePending = true; return; } // pass the selection to the page showSelectionAndDescription(); }
/** * Show the view without effecting user preferences * * @param viewId the id of the view to show */ public void showViewQuiet(String viewId) { if (fWindow == null) { return; // disposed; } IWorkbenchPage page = fWindow.getActivePage(); if (page != null) { try { fIgnoreChanges = true; IViewPart part = page.showView(viewId, null, IWorkbenchPage.VIEW_VISIBLE); if (!page.isPartVisible(part)) { page.bringToTop(part); } } catch (PartInitException e) { DebugUIPlugin.log(e); } finally { fIgnoreChanges = false; } } }
@Override public void selectionChanged(IWorkbenchPart part, ISelection sel) { // we ignore selection if we are hidden OR selection is coming from // another source as the last one if (part == null || !part.equals(currentPart)) { return; } // we ignore null selection, or if we are pinned, or our own selection // or same selection if (sel == null || !isImportant(part) || sel.equals(currentSelection)) { return; } currentPart = part; currentSelection = sel; boolean visible = getSite() != null && getSite().getPage().isPartVisible(this); if (!visible) { return; } // pass the selection to the page IPropertySheetPage page = (IPropertySheetPage) getCurrentPage(); if (page != null) { page.selectionChanged(currentPart, currentSelection); } updateContentDescription(); }
/** * Checks weather the search view is visible * Note: This method must be run from the UI thread * @return InstaSearchView */ public static boolean isSearchViewVisible() { IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if( win != null && win.getActivePage() != null ) { IViewPart view = win.getActivePage().findView(InstaSearchView.ID); return win.getActivePage().isPartVisible(view); } return false; }
/** * Makes sure that the editor's folding state is correct the next time * it becomes visible. If it already is visible, it toggles the folding * state. If not, it either registers a part listener to toggle folding * when the editor becomes visible, or cancels an already registered * runner. */ public void runWhenNextVisible() { // if there is one already: toggling twice is the identity if (fFoldingRunner != null) { fFoldingRunner.cancel(); return; } IWorkbenchPartSite site= getSite(); if (site != null) { IWorkbenchPage page= site.getPage(); if (!page.isPartVisible(JavaEditor.this)) { // if we're not visible - defer until visible fPage= page; fFoldingRunner= this; page.addPartListener(this); return; } } // we're visible - run now toggleFolding(); }
/** * Makes sure that the editor's folding state is correct the next time * it becomes visible. If it already is visible, it toggles the folding * state. If not, it either registers a part listener to toggle folding * when the editor becomes visible, or cancels an already registered * runner. */ public void runWhenNextVisible() { // if there is one already: toggling twice is the identity if (fFoldingRunner != null) { fFoldingRunner.cancel(); return; } IWorkbenchPartSite site= getSite(); if (site != null) { IWorkbenchPage page= site.getPage(); if (!page.isPartVisible(JavaEditor.this)) { // if we're not visible - defer until visible fPage= page; fFoldingRunner= this; page.addPartListener(this); return; } } // we're visible - run now toggleFolding(); }
/** * Makes sure that the editor's folding state is correct the next time * it becomes visible. If it already is visible, it toggles the folding * state. If not, it either registers a part listener to toggle folding * when the editor becomes visible, or cancels an already registered * runner. */ public void runWhenNextVisible() { // if there is one already: toggling twice is the identity if (fFoldingRunner != null) { fFoldingRunner.cancel(); return; } IWorkbenchPartSite site= getSite(); if (site != null) { IWorkbenchPage page= site.getPage(); if (!page.isPartVisible(JavaEditor.this)) { // if we're not visible - defer until visible fPage= page; fFoldingRunner= this; page.addPartListener(this); return; } } // we're visible - run now toggleFolding(); }
ConsoleView consoleView = (ConsoleView) iter.next(); if (consoleView.getSite().getPage().equals(page)) { boolean consoleVisible = page.isPartVisible(consoleView); if (consoleVisible) { consoleFound = true;
for (IConsoleView consoleView : fConsoleViews) { if (consoleView.getSite().getPage().equals(page)) { boolean consoleVisible = page.isPartVisible(consoleView); if (consoleVisible) { consoleFound = true;
for (IViewReference ref : viewrefs) { IWorkbenchPart part = ref.getPart(false); if (part == null || part == this || !page.isPartVisible(part)) { continue;
for (IViewReference ref : viewrefs) { IWorkbenchPart part = ref.getPart(false); if (part == null || part == this || !page.isPartVisible(part)) { continue;
if(!page.isPartVisible(editor)) { page.bringToTop(editor);
if (!this.getSite().getPage().isPartVisible(this)) return null;
if (site != null && IDebugUIConstants.ID_DEBUG_VIEW.equals(site.getId())) { IWorkbenchPage page = site.getWorkbenchWindow().getActivePage(); if (page != null && page.isPartVisible(part)) { ISelection selection = event.getContext(); if (selection instanceof IStructuredSelection) {