@Override public IWorkbenchWindow getWorkbenchWindow() { return parentSite.getWorkbenchWindow(); }
@Override public IWorkbenchWindow getWorkbenchWindow() { return viewSite.getWorkbenchWindow(); }
public IWorkbenchWindow getWorkbenchWindow() { return viewSite.getWorkbenchWindow(); }
protected void run( IRunnableWithProgress runnable ) { try { getViewSite().getWorkbenchWindow().run( true, true, runnable ); } catch ( InvocationTargetException e ) { // TODO Auto-generated catch block e.printStackTrace(); } catch ( InterruptedException e ) { // TODO Auto-generated catch block e.printStackTrace(); } }
private void commonInit(IViewSite site) { site.getPage().addPartListener((IPartListener2) this); site.getWorkbenchWindow().addPageListener(this); site.getWorkbenchWindow().addPerspectiveListener(this); }
private PackageExplorerPart getActivePackageExplorer() { PackageExplorerPart explorerPart= PackageExplorerPart.getFromActivePerspective(); if (explorerPart == null) return null; IWorkbenchPage activePage= explorerPart.getViewSite().getWorkbenchWindow().getActivePage(); if (activePage == null) return null; if (activePage.getActivePart() != explorerPart) return null; return explorerPart; }
@Override public void init(IViewPart view) { fView = view; DebugUITools.getDebugContextManager().getContextService(fView.getViewSite().getWorkbenchWindow()).addDebugContextListener(fDebugContextListener); DebugPlugin.getDefault().getMemoryBlockManager().addListener(fListener); fUpdateJob.runInUIThread(new NullProgressMonitor()); }
/** * Returns the active debug context for this view based on the view's * site IDs. * * @return Active debug context for this view. * * @since 3.7 */ protected ISelection getDebugContext() { IViewSite site = (IViewSite)getSite(); IDebugContextService contextService = DebugUITools.getDebugContextManager().getContextService(site.getWorkbenchWindow()); return contextService.getActiveContext(site.getId(), site.getSecondaryId()); }
@Override public void init(IViewSite site, IMemento memento) throws PartInitException { super.init(site, memento); PREF_STATE_MEMENTO = PREF_STATE_MEMENTO + site.getId(); IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore(); String string = store.getString(PREF_STATE_MEMENTO); if(string.length() > 0) { try (ByteArrayInputStream bin = new ByteArrayInputStream(string.getBytes()); InputStreamReader reader = new InputStreamReader(bin);) { XMLMemento stateMemento = XMLMemento.createReadRoot(reader); setMemento(stateMemento); } catch (WorkbenchException e) { } catch (IOException e1) { } } IMemento mem = getMemento(); // check the weights to makes sure they are valid -- bug 154025 setLastSashWeights(DEFAULT_SASH_WEIGHTS); if (mem != null) { int[] weights = getWeights(mem); if (weights != null) { setLastSashWeights(weights); } } site.getWorkbenchWindow().addPerspectiveListener(this); }
@Override public void dispose() { fAction = null; DebugPlugin.getDefault().getMemoryBlockManager().removeListener(fListener); DebugUITools.getDebugContextManager().getContextService(fView.getViewSite().getWorkbenchWindow()).removeDebugContextListener(fDebugContextListener); if (fMenuCreator != null) { fMenuCreator.dispose(); } }
@Override public void init(IViewSite site, IMemento memento) throws PartInitException { super.init(site); Workbench workbench = (Workbench) site.getWorkbenchWindow() .getWorkbench(); try { introPart = workbench.getWorkbenchIntroManager() .createNewIntroPart(); // reset the part name of this view to be that of the intro title setPartName(introPart.getTitle()); introPart.addPropertyListener((source, propId) -> firePropertyChange(propId)); introSite = new ViewIntroAdapterSite(site, workbench .getIntroDescriptor()); introPart.init(introSite, memento); } catch (CoreException e) { WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_proxy, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_proxy, e)); } }
public void init(IViewSite site, IMemento memento) throws PartInitException { if (memento!=null) this.firstPageId = memento.getString("pageId"); //$NON-NLS-1$ init(site); reusableHelpPart = new ReusableHelpPart(site.getWorkbenchWindow(), getHelpPartStyle()); IActionBars actionBars = site.getActionBars(); reusableHelpPart.init(actionBars, actionBars.getToolBarManager(), actionBars.getStatusLineManager(), memento); IWorkbenchWindow window = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); IPartService service = window.getPartService(); service.addPartListener(this); }
@Override public void fillContextMenu(IMenuManager menuManager) { ISearchResult result= getCurrentSearchResult(); if (result != null) { // first check if we have a selection for the show in mechanism, bugzilla 127718 IShowInSource showInSource= getAdapter(IShowInSource.class); if (showInSource != null) { ShowInContext context= showInSource.getShowInContext(); if (context != null) { ISelection sel= context.getSelection(); if (sel != null && !sel.isEmpty()) { MenuManager showInSubMenu= new MenuManager(getShowInMenuLabel()); showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(getViewSite().getWorkbenchWindow())); menuManager.appendToGroup(IContextMenuConstants.GROUP_OPEN, showInSubMenu); } } } } }
public void fillContextMenu(IMenuManager menuManager) { ISearchResult result= getCurrentSearchResult(); if (result != null) { menuManager.appendToGroup(IContextMenuConstants.GROUP_SEARCH, fSearchAgainAction); // first check if we have a selection for the show in mechanism, bugzilla 127718 IShowInSource showInSource= (IShowInSource) getAdapter(IShowInSource.class); if (showInSource != null) { ShowInContext context= showInSource.getShowInContext(); if (context != null) { ISelection sel= context.getSelection(); if (sel != null && !sel.isEmpty()) { MenuManager showInSubMenu= new MenuManager(getShowInMenuLabel()); showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(getViewSite().getWorkbenchWindow())); menuManager.appendToGroup(IContextMenuConstants.GROUP_OPEN, showInSubMenu); } } } } }
composite.setLayoutData(new GridData(GridData.FILL_BOTH)); final IViewSite viewSite = getViewSite(); final IWorkbenchWindow workbenchWindow = viewSite.getWorkbenchWindow(); final IWorkbenchPage page = viewSite.getPage(); final IWorkbenchPage activePage = workbenchWindow.getActivePage();
showInMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(getViewSite().getWorkbenchWindow()));