public Shell getShell() { return editorSite.getShell(); }
public Shell getShell() { return currentEditor.getEditorSite().getShell(); }
private void postImageChange(final Image newImage) { Shell shell= fJavaEditor.getEditorSite().getShell(); if (shell != null && !shell.isDisposed()) { shell.getDisplay().syncExec(new Runnable() { public void run() { fJavaEditor.updatedTitleImage(newImage); } }); } }
private void postImageChange(final Image newImage) { Shell shell= fJavaEditor.getEditorSite().getShell(); if (shell != null && !shell.isDisposed()) { shell.getDisplay().syncExec(new Runnable() { @Override public void run() { fJavaEditor.updatedTitleImage(newImage); } }); } }
private void postImageChange(final Image newImage) { Shell shell= fJavaEditor.getEditorSite().getShell(); if (shell != null && !shell.isDisposed()) { shell.getDisplay().syncExec(new Runnable() { @Override public void run() { fJavaEditor.updatedTitleImage(newImage); } }); } }
final Shell getShell() { if (fEditor != null) return fEditor.getEditorSite().getShell(); return JavaPlugin.getActiveWorkbenchShell(); }
final Shell getShell() { if (fEditor != null) return fEditor.getEditorSite().getShell(); return JavaPlugin.getActiveWorkbenchShell(); }
/** * Displays a {@link Dialog} for the {@link IStatus}. * * @param status * {@link IStatus}. * @param title * Title for {@link Dialog}. */ public void messageStatus(IStatus status, String title) { ErrorDialog.openError(this.getEditorSite().getShell(), title, null, status); }
protected void warnReadOnly() { String title = Messages.editorResourceWarnTitle; String message = Messages.editorResourceWarnMessage; MessageDialog.openWarning(editor.getEditorSite().getShell(), title, message); }
final Shell getShell() { if (fEditor != null) return fEditor.getEditorSite().getShell(); return JavaPlugin.getActiveWorkbenchShell(); }
@Override public void launch(IEditorPart editor, String mode) { MessageDialog.openError(editor.getEditorSite().getShell(), "Error", "Should not run from editor"); } }
private void asyncStructureChanged(final IFile file, final boolean added) { if (editor == null || editor.getEditorSite() == null) return; Shell shell = editor.getEditorSite().getShell(); Display display = shell != null ? shell.getDisplay() : Display.getDefault(); display.asyncExec(() -> structureChanged(file, added)); }
private void showErrorInStatusLine(final String message, ITextEditor textEditor) { Display display= textEditor.getEditorSite().getShell().getDisplay(); display.beep(); final IEditorStatusLine statusLine= textEditor.getAdapter(IEditorStatusLine.class); if (statusLine != null) { display.asyncExec(new Runnable() { /* * @see java.lang.Runnable#run() */ @Override public void run() { statusLine.setMessage(true, message, null); } }); } } }
/** * 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 void promptReadOnlyServerFile(String id) { commandManager.setReadOnly(id, true); String title = Messages.editorResourceModifiedTitle; String message = Messages.editorReadOnlyMessage; MessageDialog.openInformation(getEditorSite().getShell(), title, message); }
* Opens a preference page and refreshes the combo choices when closed * @param pageID the preference page ID to open */ private void openPreferencePage(String pageID) { fBlockChanges = true; PreferencesUtil.createPreferenceDialogOn(fEditor.getEditorSite().getShell(), pageID, new String[] {pageID}, null).open(); // reset JRE select because either JDT preference page allows user to add/remove JREs fNamedJREsCombo.setItems(VMUtil.getVMInstallNames()); refresh(); fBlockChanges = false; } }
/** * Revert to last valid. * * @param msg the msg * @param msgDetails the msg details * @return true, if successful */ private boolean revertToLastValid(String msg, String msgDetails) { String[] buttonLabels = new String[2]; buttonLabels[0] = Messages.getString("MultiPageEditor.revertToLastValid"); //$NON-NLS-1$ buttonLabels[1] = Messages.getString("MultiPageEditor.EditExisting"); //$NON-NLS-1$ MessageDialog dialog = new MessageDialog(getEditorSite().getShell(), msg, null, msgDetails, MessageDialog.WARNING, buttonLabels, 0); dialog.open(); // next line depends on return code for button 1 (which is 1) // and CANCEL code both being == 1 return dialog.getReturnCode() == 0; }
@Override public void createPartControl(Composite parent) { super.createPartControl(parent); ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer(); createFoldingSupport(projectionViewer); if (isFoldingEnabled()) { projectionViewer.doOperation(ProjectionViewer.TOGGLE); } if (fMarkOccurrenceAnnotations) { installOccurrencesFinder(); } getEditorSite().getShell().addShellListener(fActivationListener); fEditorSelectionChangedListener = new EditorSelectionChangedListener(); fEditorSelectionChangedListener.install(getSelectionProvider()); }
@Override public void afterCreatePartControl(XtextEditor editor) { super.afterCreatePartControl(editor); IResource resource = editor.getResource(); if (resource!=null && !toggleNature.hasNature(resource.getProject()) && resource.getProject().isAccessible() && !resource.getProject().isHidden()) { String title = Messages.NatureAddingEditorCallback_MessageDialog_Title; String message = Messages.NatureAddingEditorCallback_MessageDialog_Msg0 + resource.getProject().getName() + Messages.NatureAddingEditorCallback_MessageDialog_Msg1; Image image = null; MessageDialog dialog = new MessageDialog(editor.getEditorSite().getShell(), title, image, message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0); int open = dialog.open(); if (open==0) { toggleNature.toggleNature(resource.getProject()); } } }