public void setActiveEditor(IAction action, IEditorPart targetEditor) { workbenchPart = targetEditor; fDelegateAction = action; if (targetEditor != null && targetEditor.getEditorSite() != null && targetEditor.getEditorSite().getSelectionProvider() != null) { updateWith(targetEditor.getEditorSite().getSelectionProvider().getSelection()); } }
public void setActiveEditor(IAction action, IEditorPart targetEditor) { workbenchPart = targetEditor; fDelegateAction = action; if (targetEditor != null && targetEditor.getEditorSite() != null && targetEditor.getEditorSite().getSelectionProvider() != null) { updateWith(targetEditor.getEditorSite().getSelectionProvider().getSelection()); } }
@Override public void launch(IEditorPart editor, String mode) { MessageDialog.openError(editor.getEditorSite().getShell(), "Error", "Should not run from editor"); } }
@Override public void setActiveEditor(IEditorPart targetEditor) { // Hook in the actions this.hookInActions(targetEditor); // Update the action bars targetEditor.getEditorSite().getActionBars().updateActionBars(); }
private boolean isPinned(IEditorPart editor) { if (editor == null) return false; IEditorReference[] editorRefs= editor.getEditorSite().getPage().getEditorReferences(); int i= 0; while (i < editorRefs.length) { if (editor.equals(editorRefs[i].getEditor(false))) return editorRefs[i].isPinned(); i++; } return false; }
/** * Convenience constructor to use the {@link IProject} and {@link Shell} of * the {@link IEditorPart}. * * @param editor * {@link IEditorPart}. */ public ClasspathClassInput(IEditorPart editor) { this(ProjectConfigurationContext.getProject(editor.getEditorInput()), editor.getEditorSite().getShell()); }
/** * Convenience constructor to use the {@link IProject} and {@link Shell} of * the {@link IEditorPart}. * * @param editor * {@link IEditorPart}. */ public ClasspathFileInput(IEditorPart editor) { this(ProjectConfigurationContext.getProject(editor.getEditorInput()), editor.getEditorSite().getShell()); }
protected IWorkbenchPage getWorkbenchPage(IRenameElementContext context) { IEditorPart triggeringEditor = context.getTriggeringEditor(); return (triggeringEditor == null) ? workbench.getActiveWorkbenchWindow().getActivePage() : triggeringEditor .getEditorSite().getPage(); }
@Override protected void showMatch(Match match, int currentOffset, int currentLength, boolean activate) throws PartInitException { IEditorPart editor= fEditorOpener.openMatch(match); if (editor != null && activate) editor.getEditorSite().getPage().activate(editor); if (editor instanceof ITextEditor) { ITextEditor textEditor= (ITextEditor) editor; textEditor.selectAndReveal(currentOffset, currentLength); } }
@Override protected void showMatch(Match match, int currentOffset, int currentLength, boolean activate) throws PartInitException { IEditorPart editor= fEditorOpener.openMatch(match); if (editor != null && activate) editor.getEditorSite().getPage().activate(editor); if (editor instanceof ITextEditor) { ITextEditor textEditor= (ITextEditor) editor; textEditor.selectAndReveal(currentOffset, currentLength); } }
/** * Returns the status line manager of the active editor. * @return the status line manager of the active editor */ private IStatusLineManager getStatusLineManager() { IEditorPart editor= fWorkbenchPart.getSite().getPage().getActiveEditor(); if (editor == null) return null; return editor.getEditorSite().getActionBars().getStatusLineManager(); }
private IProgressMonitor getProgressMonitor() { IWorkbenchPage wbPage= JavaPlugin.getActivePage(); if (wbPage == null) return null; IEditorPart editor= wbPage.getActiveEditor(); if (editor == null) return null; return editor.getEditorSite().getActionBars().getStatusLineManager().getProgressMonitor(); }
private IProgressMonitor getProgressMonitor() { IWorkbenchPage wbPage= JavaPlugin.getActivePage(); if (wbPage == null) return null; IEditorPart editor= wbPage.getActiveEditor(); if (editor == null) return null; return editor.getEditorSite().getActionBars().getStatusLineManager().getProgressMonitor(); }
private IProgressMonitor getProgressMonitor() { IWorkbenchPage wbPage= JavaPlugin.getActivePage(); if (wbPage == null) return null; IEditorPart editor= wbPage.getActiveEditor(); if (editor == null) return null; return editor.getEditorSite().getActionBars().getStatusLineManager().getProgressMonitor(); }
private IProgressMonitor getProgressMonitor() { IWorkbenchPage wbPage= JavaPlugin.getActivePage(); if (wbPage == null) return null; IEditorPart editor= wbPage.getActiveEditor(); if (editor == null) return null; return editor.getEditorSite().getActionBars().getStatusLineManager().getProgressMonitor(); }
/** * Returns the status line manager of the active editor. * @return the status line manager of the active editor */ private IStatusLineManager getStatusLineManager() { IEditorPart editor= fWorkbenchPart.getSite().getPage().getActiveEditor(); if (editor == null) return null; return editor.getEditorSite().getActionBars().getStatusLineManager(); }
/** * Returns the status line manager of the active editor. * @return the status line manager of the active editor */ private IStatusLineManager getStatusLineManager() { IEditorPart editor= fWorkbenchPart.getSite().getPage().getActiveEditor(); if (editor == null) return null; return editor.getEditorSite().getActionBars().getStatusLineManager(); }
private void setStatusBarMessage(String message) { IWorkbenchPart part= getActivePart(); if (part instanceof IEditorPart) { IEditorActionBarContributor contributor= ((IEditorPart) part).getEditorSite().getActionBarContributor(); if (contributor instanceof EditorActionBarContributor) { IStatusLineManager manager= ((EditorActionBarContributor) contributor).getActionBars().getStatusLineManager(); manager.setMessage(message); } } }
protected void showMatch(Match match, int currentOffset, int currentLength, boolean activate) throws PartInitException { try { IEditorPart editor= fEditorOpener.openMatch(match); if (editor != null && activate) editor.getEditorSite().getPage().activate(editor); if (editor instanceof ITextEditor) { ITextEditor textEditor= (ITextEditor) editor; textEditor.selectAndReveal(currentOffset, currentLength); } } catch (JavaModelException e1) { throw new PartInitException(e1.getStatus()); } }
public DesignViewGraphicalViewer(IEditorPart editor, CommonSelectionManager manager) { super(); setContextMenu(new DesignViewContextMenuProvider(editor, this, this)); editor.getEditorSite().registerContextMenu("org.eclipse.wst.xsd.ui.popup.graph", getContextMenu(), internalSelectionProvider, false); //$NON-NLS-1$ // make the internalSelectionProvider listen to graph view selection changes addSelectionChangedListener(internalSelectionProvider); internalSelectionProvider.addSelectionChangedListener(manager); manager.addSelectionChangedListener(this); setKeyHandler(new BaseGraphicalViewerKeyHandler(this)); }