/** * 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()); } } }
/** * 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()); } } }
/** * 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());
fSourceViewer.setEditable(isEditable());
fSourceViewer.setEditable(isEditable()); fSourceViewer.showAnnotations(model != null);
fSourceViewer.setEditable(isEditable()); fSourceViewer.showAnnotations(model != null);
fSourceViewer.setEditable(isEditable()); fSourceViewer.showAnnotations(model != null);
/** * Sets up this editor's context menu before it is made visible. * <p> * Subclasses may extend to add other actions.</p> * * @param menu the menu */ protected void editorContextMenuAboutToShow(IMenuManager menu) { menu.add(new Separator(ITextEditorActionConstants.GROUP_UNDO)); menu.add(new GroupMarker(ITextEditorActionConstants.GROUP_SAVE)); menu.add(new Separator(ITextEditorActionConstants.GROUP_COPY)); menu.add(new Separator(ITextEditorActionConstants.GROUP_PRINT)); menu.add(new Separator(ITextEditorActionConstants.GROUP_EDIT)); menu.add(new Separator(ITextEditorActionConstants.GROUP_FIND)); menu.add(new Separator(IWorkbenchActionConstants.GROUP_ADD)); menu.add(new Separator(ITextEditorActionConstants.GROUP_REST)); menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); if (isEditable()) { addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.UNDO); addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.REVERT_TO_SAVED); addAction(menu, ITextEditorActionConstants.GROUP_SAVE, ITextEditorActionConstants.SAVE); addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.CUT); addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.COPY); addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.PASTE); } else { addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.COPY); } }
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); if (isEditable()) { addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.UNDO); addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.REVERT_TO_SAVED);
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); if (isEditable()) { addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.UNDO); addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.REVERT_TO_SAVED);