public IWorkbenchWindow getWorkbenchWindow() { return editorSite.getWorkbenchWindow(); }
public void windowActivated(IWorkbenchWindow window) { if (window == getEditorSite().getWorkbenchWindow()) { /* * Workaround for problem described in * http://dev.eclipse.org/bugs/show_bug.cgi?id=11731 Will be * removed when SWT has solved the problem. */ window.getShell().getDisplay().asyncExec(new Runnable() { public void run() { handleActivation(); } }); } }
public void windowActivated(IWorkbenchWindow window) { if (window == getEditorSite().getWorkbenchWindow()) { /* * Workaround for problem described in * http://dev.eclipse.org/bugs/show_bug.cgi?id=11731 * Will be removed when SWT has solved the problem. */ window.getShell().getDisplay().asyncExec(new Runnable() { public void run() { handleActivation(); } }); } }
@Override public void windowActivated(IWorkbenchWindow window) { if (fHandleActivation && window == getEditorSite().getWorkbenchWindow()) { /* * Workaround for problem described in * http://dev.eclipse.org/bugs/show_bug.cgi?id=11731 * Will be removed when SWT has solved the problem. */ window.getShell().getDisplay().asyncExec(new Runnable() { @Override public void run() { handleActivation(); } }); } }
@Override public void init(final IEditorSite site, final IEditorInput input) throws PartInitException { setSite(site); internalInit(site.getWorkbenchWindow(), site, input); fActivationListener= new ActivationListener(site.getWorkbenchWindow().getPartService()); }
@Override public void init(final IEditorSite site, final IEditorInput input) throws PartInitException { setSite(site); internalInit(site.getWorkbenchWindow(), site, input); fActivationListener= new ActivationListener(site.getWorkbenchWindow().getPartService()); }
public void init(final IEditorSite site, final IEditorInput input) throws PartInitException { setSite(site); internalInit(site.getWorkbenchWindow(), site, input); fActivationListener= new ActivationListener(site.getWorkbenchWindow().getPartService()); }
@Override public void windowActivated(IWorkbenchWindow window) { if (fHandleActivation && window == getEditorSite().getWorkbenchWindow()) { /* * Workaround for problem described in * http://dev.eclipse.org/bugs/show_bug.cgi?id=11731 * Will be removed when SWT has solved the problem. */ window.getShell().getDisplay().asyncExec(() -> handleActivation()); } }
public void windowActivated(IWorkbenchWindow window) { if (window == getEditorSite().getWorkbenchWindow()) { /* * Workaround for problem described in * http://dev.eclipse.org/bugs/show_bug.cgi?id=11731 Will be removed * when SWT has solved the problem. */ window.getShell().getDisplay().asyncExec(new Runnable() { public void run() { handleActivation(); } }); } }
@Override public void windowDeactivated(IWorkbenchWindow window) { if (window == getEditorSite().getWorkbenchWindow() && fMarkOccurrenceAnnotations && isActivePart()) removeOccurrenceAnnotations(); }
@Override public void windowDeactivated(IWorkbenchWindow window) { if (window == getEditorSite().getWorkbenchWindow() && fMarkOccurrenceAnnotations && isActivePart()) removeOccurrenceAnnotations(); }
public void windowDeactivated(IWorkbenchWindow window) { if (window == getEditorSite().getWorkbenchWindow() && fMarkOccurrenceAnnotations && isActivePart()) removeOccurrenceAnnotations(); }
public void init(IEditorSite site, IEditorInput input) throws PartInitException { super.init(site, input); site.getWorkbenchWindow().getPartService().addPartListener(fActivationListener); }
public void init(IEditorSite site, IEditorInput input) throws PartInitException { try { super.init(site, input); // we want to listen for our own activation fActivationListener = new ActivationListener(site.getWorkbenchWindow().getPartService()); } catch (Exception e) { Logger.logException("exception initializing " + getClass().getName(), e); //$NON-NLS-1$ } setPartName(input.getName()); }
@Override public void windowActivated(IWorkbenchWindow window) { if (window == getEditorSite().getWorkbenchWindow() && fMarkOccurrenceAnnotations && isActivePart()) { fForcedMarkOccurrencesSelection= getSelectionProvider().getSelection(); ITypeRoot inputJavaElement= getInputJavaElement(); if (inputJavaElement != null) { IProgressMonitor monitor = getProgressMonitor(); try { updateOccurrenceAnnotations((ITextSelection)fForcedMarkOccurrencesSelection, SharedASTProvider.getAST(inputJavaElement, SharedASTProvider.WAIT_NO, monitor)); } finally { monitor.done(); } } } }
@Override public void windowActivated(IWorkbenchWindow window) { if (window == getEditorSite().getWorkbenchWindow() && fMarkOccurrenceAnnotations && isActivePart()) { fForcedMarkOccurrencesSelection= getSelectionProvider().getSelection(); ITypeRoot inputJavaElement= getInputJavaElement(); if (inputJavaElement != null) { IProgressMonitor monitor = getProgressMonitor(); try { updateOccurrenceAnnotations((ITextSelection)fForcedMarkOccurrencesSelection, SharedASTProviderCore.getAST(inputJavaElement, SharedASTProviderCore.WAIT_NO, monitor)); } finally { monitor.done(); } } } }
public void windowActivated(IWorkbenchWindow window) { if (window == getEditorSite().getWorkbenchWindow() && fMarkOccurrenceAnnotations && isActivePart()) { fForcedMarkOccurrencesSelection= getSelectionProvider().getSelection(); updateOccurrenceAnnotations((ITextSelection)fForcedMarkOccurrencesSelection, JavaPlugin.getDefault().getASTProvider().getAST(getInputJavaElement(), ASTProvider.WAIT_NO, getProgressMonitor())); } }
/** * The <code>MultiPageEditorExample</code> implementation of this method * checks that the input is an instance of <code>IFileEditorInput</code>. */ public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException { // if (!(editorInput instanceof IFileEditorInput)) // throw new PartInitException("Invalid Input: Must be IFileEditorInput"); //$NON-NLS-1$ super.init(site, editorInput); getCommandStack().addCommandStackListener(this); initializeActionRegistry(); String title = null; if (getEditorInput() != null) { title = getEditorInput().getName(); } setPartName(title); fActivationListener = new CommonActivationListener(site.getWorkbenchWindow().getPartService()); }
protected void editorContextMenuAboutToShow(IMenuManager menu) { super.editorContextMenuAboutToShow(menu); IAction preferencesAction= getAction(ITextEditorActionConstants.CONTEXT_PREFERENCES); menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator(ITextEditorActionConstants.GROUP_SETTINGS)); menu.appendToGroup(ITextEditorActionConstants.GROUP_SETTINGS, preferencesAction); menu.appendToGroup(ITextEditorActionConstants.GROUP_SAVE, new Separator(ITextEditorActionConstants.GROUP_OPEN)); MenuManager showInSubMenu= new MenuManager(getShowInMenuLabel()); showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(getEditorSite().getWorkbenchWindow())); menu.appendToGroup(ITextEditorActionConstants.GROUP_OPEN, showInSubMenu); }
@Override protected void editorContextMenuAboutToShow(IMenuManager menu) { super.editorContextMenuAboutToShow(menu); IAction preferencesAction= getAction(ITextEditorActionConstants.CONTEXT_PREFERENCES); menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator(ITextEditorActionConstants.GROUP_SETTINGS)); menu.appendToGroup(ITextEditorActionConstants.GROUP_SETTINGS, preferencesAction); menu.appendToGroup(ITextEditorActionConstants.GROUP_SAVE, new Separator(ITextEditorActionConstants.GROUP_OPEN)); IEditorInput editorInput= getEditorInput(); if ((editorInput.getAdapter(IResource.class)) instanceof IFile) { MenuManager openWithSubMenu= new MenuManager(TextEditorMessages.AbstractDecoratedTextEditor_openWith_menu); final IWorkbenchPage page= getEditorSite().getPage(); // XXX: Internal reference will get fixed during 3.7, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=307026 openWithSubMenu.add(new OpenWithMenu(page, editorInput) { @Override protected void openEditor(IEditorDescriptor editorDescriptor, boolean openUsingDescriptor) { super.openEditor(editorDescriptor, openUsingDescriptor); ISelection selection= getSelectionProvider().getSelection(); if (selection instanceof ITextSelection) { revealInEditor(page.getActiveEditor(), ((ITextSelection)selection).getOffset(), ((ITextSelection)selection).getLength()); } } }); menu.appendToGroup(ITextEditorActionConstants.GROUP_OPEN, openWithSubMenu); } MenuManager showInSubMenu= new MenuManager(getShowInMenuLabel()); showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(getEditorSite().getWorkbenchWindow())); menu.appendToGroup(ITextEditorActionConstants.GROUP_OPEN, showInSubMenu); }