/** * Sets the editable state of the given source viewer. * * @param sourceViewer * the source viewer * @param state * the state * @since 3.5 */ protected void setEditable(ISourceViewer sourceViewer, boolean state) { sourceViewer.setEditable(state); }
@Override protected void configureSourceViewer(ISourceViewer sourceViewer) { sourceViewer.setEditable(false); sourceViewer.configure(sourceViewerConfiguration); if (sourceViewer instanceof ITextViewerExtension6) { ITextViewerExtension6 textViewerExtension6 = (ITextViewerExtension6) sourceViewer; textViewerExtension6.setHyperlinkDetectors(null, sourceViewerConfiguration.getHyperlinkStateMask(sourceViewer)); } if (sourceViewer instanceof ITextViewerExtension2) { ITextViewerExtension2 textViewerExtension2 = (ITextViewerExtension2) sourceViewer; String[] configuredContentTypes = sourceViewerConfiguration.getConfiguredContentTypes(sourceViewer); for (String contentType : configuredContentTypes) { textViewerExtension2.removeTextHovers(contentType); } } }
/** * Updates the state of the given editor input such as read-only flag. * * @param input the input to be validated * @since 2.0 */ protected void updateState(IEditorInput input) { IDocumentProvider provider= getDocumentProvider(); if (provider instanceof IDocumentProviderExtension) { IDocumentProviderExtension extension= (IDocumentProviderExtension) provider; try { boolean wasReadOnly= isEditorInputReadOnly(); extension.updateStateCache(input); if (fSourceViewer != null) fSourceViewer.setEditable(isEditable()); if (wasReadOnly != isEditorInputReadOnly()) updateStateDependentActions(); } catch (CoreException x) { Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID); ILog log= Platform.getLog(bundle); log.log(x.getStatus()); } } }
fSourceViewer.setEditable(isEditable());
fSourceViewer.setEditable(isEditable());
/** * Updates the state of the given editor input such as read-only flag. * * @param input the input to be validated * @since 2.0 */ protected void updateState(IEditorInput input) { IDocumentProvider provider= getDocumentProvider(); if (provider instanceof IDocumentProviderExtension) { IDocumentProviderExtension extension= (IDocumentProviderExtension) provider; try { boolean wasReadOnly= isEditorInputReadOnly(); extension.updateStateCache(input); if (fSourceViewer != null) fSourceViewer.setEditable(isEditable()); if (wasReadOnly != isEditorInputReadOnly()) updateStateDependentActions(); } catch (CoreException x) { Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID); ILog log= Platform.getLog(bundle); log.log(x.getStatus()); } } }
fSourceViewer.setEditable(isEditable());
/** * Updates the state of the given editor input such as read-only flag. * * @param input the input to be validated * @since 2.0 */ protected void updateState(IEditorInput input) { IDocumentProvider provider= getDocumentProvider(); if (provider instanceof IDocumentProviderExtension) { IDocumentProviderExtension extension= (IDocumentProviderExtension) provider; try { boolean wasReadOnly= isEditorInputReadOnly(); extension.updateStateCache(input); if (fSourceViewer != null) fSourceViewer.setEditable(isEditable()); if (wasReadOnly != isEditorInputReadOnly()) updateStateDependentActions(); } catch (CoreException x) { Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID); ILog log= Platform.getLog(bundle); log.log(x.getStatus()); } } }
protected synchronized void evaluationStarts() { if (fThread != null) { try { IThread thread = fThread; fThread = null; thread.resume(); } catch (DebugException e) { JDIDebugUIPlugin.log(e); showException(e); return; } } fEvaluating = true; setTitleImage(); fireEvalStateChanged(); showStatus(SnippetMessages.getString("SnippetEditor.evaluating")); //$NON-NLS-1$ getSourceViewer().setEditable(false); }
fSourceViewer.setEditable(isEditable()); fSourceViewer.showAnnotations(model != null);
fSourceViewer.setEditable(isEditable()); fSourceViewer.showAnnotations(model != null);
fSourceViewer.setEditable(isEditable()); fSourceViewer.showAnnotations(model != null);
getSourceViewer().setEditable(false);