private Shell getShell() { return fEditor.getSite().getShell(); }
private Shell getShell() { return fEditor.getSite().getShell(); }
private Shell getShell() { return fEditor.getSite().getShell(); }
@Override public void shellDeactivated(ShellEvent e) { if (fIsMenuUp) return; final Shell editorShell= fEditor.getSite().getShell(); display.asyncExec(new Runnable() { // post to UI thread since editor shell only gets activated after popup has lost focus @Override public void run() { Shell activeShell= display.getActiveShell(); if (activeShell != editorShell) { fRenameLinkedMode.cancel(); } } }); } });
@Override public void shellDeactivated(ShellEvent e) { if (fIsMenuUp) return; final Shell editorShell= fEditor.getSite().getShell(); display.asyncExec(new Runnable() { // post to UI thread since editor shell only gets activated after popup has lost focus @Override public void run() { Shell activeShell= display.getActiveShell(); if (activeShell != editorShell) { fRenameLinkedMode.cancel(); } } }); } });
private void activateEditor() { fEditor.getSite().getShell().setActive(); }
private void activateEditor() { fEditor.getSite().getShell().setActive(); }
private void activateEditor() { fEditor.getSite().getShell().setActive(); }
public boolean ownsFocusShell() { if (fInfoPopup == null) return false; if (fInfoPopup.ownsFocusShell()) { return true; } Shell editorShell= fEditor.getSite().getShell(); Shell activeShell= editorShell.getDisplay().getActiveShell(); if (editorShell == activeShell) return true; return false; }
/** * Tells whether this is the active editor in the active page. * * @return <code>true</code> if this is the active editor in the active page * @see IWorkbenchPage#getActiveEditor */ protected final boolean isActiveEditor() { IWorkbenchWindow window= getSite().getWorkbenchWindow(); IWorkbenchPage page= window.getActivePage(); if (page == null) return false; IEditorPart activeEditor= page.getActiveEditor(); return activeEditor != null && activeEditor.equals(this); }
@Override public boolean ownsFocusShell() { if (fInfoPopup == null) return false; if (fInfoPopup.ownsFocusShell()) { return true; } Shell editorShell= fEditor.getSite().getShell(); Shell activeShell= editorShell.getDisplay().getActiveShell(); if (editorShell == activeShell) return true; return false; }
@Override public boolean ownsFocusShell() { if (fInfoPopup == null) return false; if (fInfoPopup.ownsFocusShell()) { return true; } Shell editorShell= fEditor.getSite().getShell(); Shell activeShell= editorShell.getDisplay().getActiveShell(); if (editorShell == activeShell) return true; return false; }
/** * Tells whether this is the active editor in the active page. * * @return <code>true</code> if this is the active editor in the active page * @see IWorkbenchPage#getActiveEditor */ protected final boolean isActiveEditor() { IWorkbenchWindow window= getSite().getWorkbenchWindow(); IWorkbenchPage page= window.getActivePage(); if (page == null) return false; IEditorPart activeEditor= page.getActiveEditor(); return activeEditor != null && activeEditor.equals(this); }
/** * Tells whether this is the active editor in the active page. * * @return <code>true</code> if this is the active editor in the active page * @see IWorkbenchPage#getActiveEditor */ protected final boolean isActiveEditor() { IWorkbenchWindow window= getSite().getWorkbenchWindow(); IWorkbenchPage page= window.getActivePage(); if (page == null) return false; IEditorPart activeEditor= page.getActiveEditor(); return activeEditor != null && activeEditor.equals(this); }
public void registerCommands(CompilationUnitEditor editor) { IWorkbench workbench= PlatformUI.getWorkbench(); ICommandService commandService= (ICommandService) workbench.getAdapter(ICommandService.class); IHandlerService handlerService= (IHandlerService) workbench.getAdapter(IHandlerService.class); if (commandService == null || handlerService == null) { return; } if (fCorrectionHandlerActivations != null) { JavaPlugin.logErrorMessage("correction handler activations not released"); //$NON-NLS-1$ } fCorrectionHandlerActivations= new ArrayList(); Collection definedCommandIds= commandService.getDefinedCommandIds(); for (Iterator iter= definedCommandIds.iterator(); iter.hasNext();) { String id= (String) iter.next(); if (id.startsWith(COMMAND_PREFIX)) { boolean isAssist= id.endsWith(ASSIST_SUFFIX); CorrectionCommandHandler handler= new CorrectionCommandHandler(editor, id, isAssist); IHandlerActivation activation= handlerService.activateHandler(id, handler, new LegacyHandlerSubmissionExpression(null, null, editor.getSite())); fCorrectionHandlerActivations.add(activation); } } }
public void reconciled(CompilationUnit ast, boolean forced, IProgressMonitor progressMonitor) { // see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=58245 JavaPlugin javaPlugin= JavaPlugin.getDefault(); if (javaPlugin == null) return; // Always notify AST provider javaPlugin.getASTProvider().reconciled(ast, getInputJavaElement(), progressMonitor); // Notify listeners Object[] listeners = fReconcilingListeners.getListeners(); for (int i = 0, length= listeners.length; i < length; ++i) ((IJavaReconcilingListener)listeners[i]).reconciled(ast, forced, progressMonitor); // Update Java Outline page selection if (!forced && !progressMonitor.isCanceled()) { Shell shell= getSite().getShell(); if (shell != null && !shell.isDisposed()) { shell.getDisplay().asyncExec(new Runnable() { public void run() { selectionChanged(); } }); } } }
public void startFullDialog() { cancel(); try { String newName= fNamePosition.getContent(); RenameSupport renameSupport= undoAndCreateRenameSupport(newName); if (renameSupport != null) renameSupport.openDialog(fEditor.getSite().getShell()); } catch (CoreException e) { JavaPlugin.log(e); } catch (BadLocationException e) { JavaPlugin.log(e); } }
public void startFullDialog() { cancel(); try { String newName= fNamePosition.getContent(); RenameSupport renameSupport= undoAndCreateRenameSupport(newName); if (renameSupport != null) renameSupport.openDialog(fEditor.getSite().getShell()); } catch (CoreException e) { JavaPlugin.log(e); } catch (BadLocationException e) { JavaPlugin.log(e); } }
public void startFullDialog() { cancel(); try { String newName= fNamePosition.getContent(); RenameSupport renameSupport= undoAndCreateRenameSupport(newName); if (renameSupport != null) renameSupport.openDialog(fEditor.getSite().getShell()); } catch (CoreException e) { JavaPlugin.log(e); } catch (BadLocationException e) { JavaPlugin.log(e); } }
@Override public void widgetDisposed(DisposeEvent e) { fEditor.getSite().getWorkbenchWindow().getPartService().removePartListener(PopupVisibilityManager.this); if (! textWidget.isDisposed()) { textWidget.removeControlListener(PopupVisibilityManager.this); textWidget.removeMouseListener(PopupVisibilityManager.this); textWidget.removeKeyListener(PopupVisibilityManager.this); } fEditor.getSite().getShell().removeControlListener(PopupVisibilityManager.this); viewer.removeTextListener(PopupVisibilityManager.this); viewer.removeViewportListener(PopupVisibilityManager.this); if (fMenuImage != null) { fMenuImage.dispose(); fMenuImage= null; } if (fMenuManager != null) { fMenuManager.dispose(); fMenuManager= null; } fRenameLinkedMode.cancel(); } });