if (fEditorStatusLine == null) { IStatusLineManager statusLineManager= getStatusLineManager(); ISelectionProvider selectionProvider= getSelectionProvider(); if (statusLineManager != null && selectionProvider != null) fEditorStatusLine= new EditorStatusLine(statusLineManager, selectionProvider);
if (fEditorStatusLine == null) { IStatusLineManager statusLineManager= getStatusLineManager(); ISelectionProvider selectionProvider= getSelectionProvider(); if (statusLineManager != null && selectionProvider != null) fEditorStatusLine= new EditorStatusLine(statusLineManager, selectionProvider);
if (fEditorStatusLine == null) { IStatusLineManager statusLineManager= getStatusLineManager(); ISelectionProvider selectionProvider= getSelectionProvider(); if (statusLineManager != null && selectionProvider != null) fEditorStatusLine= new EditorStatusLine(statusLineManager, selectionProvider);
/** * Jumps to the next annotation according to the given direction. * * @param forward <code>true</code> if search direction is forward, <code>false</code> if backward * @return the selected annotation or <code>null</code> if none * @see #isNavigationTarget(Annotation) * @see #findAnnotation(int, int, boolean, Position) * @since 3.2 */ @Override public Annotation gotoAnnotation(boolean forward) { ITextSelection selection= (ITextSelection) getSelectionProvider().getSelection(); Position position= new Position(0, 0); Annotation annotation= findAnnotation(selection.getOffset(), selection.getLength(), forward, position); setStatusLineErrorMessage(null); setStatusLineMessage(null); if (annotation != null) { selectAndReveal(position.getOffset(), position.getLength()); setStatusLineMessage(annotation.getText()); } return annotation; }
/** * Jumps to the next annotation according to the given direction. * * @param forward <code>true</code> if search direction is forward, <code>false</code> if backward * @return the selected annotation or <code>null</code> if none * @see #isNavigationTarget(Annotation) * @see #findAnnotation(int, int, boolean, Position) * @since 3.2 */ @Override public Annotation gotoAnnotation(boolean forward) { ITextSelection selection= (ITextSelection) getSelectionProvider().getSelection(); Position position= new Position(0, 0); Annotation annotation= findAnnotation(selection.getOffset(), selection.getLength(), forward, position); setStatusLineErrorMessage(null); setStatusLineMessage(null); if (annotation != null) { selectAndReveal(position.getOffset(), position.getLength()); setStatusLineMessage(annotation.getText()); } return annotation; }
/** * Selects and reveals the specified ranges in this text editor. * * @param selectionStart the offset of the selection * @param selectionLength the length of the selection * @param revealStart the offset of the revealed range * @param revealLength the length of the revealed range * @since 3.0 */ protected void selectAndReveal(int selectionStart, int selectionLength, int revealStart, int revealLength) { if (fSourceViewer == null) return; ISelection selection= getSelectionProvider().getSelection(); if (selection instanceof ITextSelection) { ITextSelection textSelection= (ITextSelection) selection; if (textSelection.getOffset() != 0 || textSelection.getLength() != 0) markInNavigationHistory(); } StyledText widget= fSourceViewer.getTextWidget(); widget.setRedraw(false); { adjustHighlightRange(revealStart, revealLength); fSourceViewer.revealRange(revealStart, revealLength); fSourceViewer.setSelectedRange(selectionStart, selectionLength); markInNavigationHistory(); } widget.setRedraw(true); }
/** * Jumps to the next annotation according to the given direction. * * @param forward <code>true</code> if search direction is forward, <code>false</code> if backward * @return the selected annotation or <code>null</code> if none * @see #isNavigationTarget(Annotation) * @see #findAnnotation(int, int, boolean, Position) * @since 3.2 */ public Annotation gotoAnnotation(boolean forward) { ITextSelection selection= (ITextSelection) getSelectionProvider().getSelection(); Position position= new Position(0, 0); Annotation annotation= findAnnotation(selection.getOffset(), selection.getLength(), forward, position); setStatusLineErrorMessage(null); setStatusLineMessage(null); if (annotation != null) { selectAndReveal(position.getOffset(), position.getLength()); setStatusLineMessage(annotation.getText()); } return annotation; }
/** * Selects and reveals the specified ranges in this text editor. * * @param selectionStart the offset of the selection * @param selectionLength the length of the selection * @param revealStart the offset of the revealed range * @param revealLength the length of the revealed range * @since 3.0 */ protected void selectAndReveal(int selectionStart, int selectionLength, int revealStart, int revealLength) { if (fSourceViewer == null) return; ISelection selection= getSelectionProvider().getSelection(); if (selection instanceof ITextSelection) { ITextSelection textSelection= (ITextSelection) selection; if (textSelection.getOffset() != 0 || textSelection.getLength() != 0) markInNavigationHistory(); } StyledText widget= fSourceViewer.getTextWidget(); widget.setRedraw(false); { adjustHighlightRange(revealStart, revealLength); fSourceViewer.revealRange(revealStart, revealLength); fSourceViewer.setSelectedRange(selectionStart, selectionLength); markInNavigationHistory(); } widget.setRedraw(true); }
/** * Selects and reveals the specified ranges in this text editor. * * @param selectionStart the offset of the selection * @param selectionLength the length of the selection * @param revealStart the offset of the revealed range * @param revealLength the length of the revealed range * @since 3.0 */ protected void selectAndReveal(int selectionStart, int selectionLength, int revealStart, int revealLength) { if (fSourceViewer == null) return; ISelection selection= getSelectionProvider().getSelection(); if (selection instanceof ITextSelection) { ITextSelection textSelection= (ITextSelection) selection; if (textSelection.getOffset() != 0 || textSelection.getLength() != 0) markInNavigationHistory(); } StyledText widget= fSourceViewer.getTextWidget(); widget.setRedraw(false); { adjustHighlightRange(revealStart, revealLength); fSourceViewer.revealRange(revealStart, revealLength); fSourceViewer.setSelectedRange(selectionStart, selectionLength); markInNavigationHistory(); } widget.setRedraw(true); }
fSelectionListener.uninstall(getSelectionProvider()); fSelectionListener= null;
getSelectionProvider().addSelectionChangedListener(getSelectionChangedListener()); getEditorSite().registerContextMenu(fEditorContextMenuId, manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); else if (fCompatibilityMode) getEditorSite().registerContextMenu(DEFAULT_EDITOR_CONTEXT_MENU_ID, manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); getEditorSite().registerContextMenu(partId + ".EditorContext", manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); //$NON-NLS-1$ getEditorSite().registerContextMenu(COMMON_EDITOR_CONTEXT_MENU_ID, manager, getSelectionProvider(), false); getEditorSite().registerContextMenu(fRulerContextMenuId, manager, getSelectionProvider(), false); else if (fCompatibilityMode) getEditorSite().registerContextMenu(DEFAULT_RULER_CONTEXT_MENU_ID, manager, getSelectionProvider(), false); getEditorSite().registerContextMenu(partId + ".RulerContext", manager, getSelectionProvider(), false); //$NON-NLS-1$ getEditorSite().registerContextMenu(COMMON_RULER_CONTEXT_MENU_ID, manager, getSelectionProvider(), false); getSite().setSelectionProvider(getSelectionProvider()); fSelectionListener.install(getSelectionProvider()); fSelectionListener.setDocument(getDocumentProvider().getDocument(getEditorInput()));
getSelectionProvider().addSelectionChangedListener(getSelectionChangedListener()); getEditorSite().registerContextMenu(fEditorContextMenuId, manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); else if (fCompatibilityMode) getEditorSite().registerContextMenu(DEFAULT_EDITOR_CONTEXT_MENU_ID, manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); getEditorSite().registerContextMenu(partId + ".EditorContext", manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); //$NON-NLS-1$ getEditorSite().registerContextMenu(COMMON_EDITOR_CONTEXT_MENU_ID, manager, getSelectionProvider(), false); getEditorSite().registerContextMenu(fRulerContextMenuId, manager, getSelectionProvider(), false); else if (fCompatibilityMode) getEditorSite().registerContextMenu(DEFAULT_RULER_CONTEXT_MENU_ID, manager, getSelectionProvider(), false); getEditorSite().registerContextMenu(partId + ".RulerContext", manager, getSelectionProvider(), false); //$NON-NLS-1$ getEditorSite().registerContextMenu(COMMON_RULER_CONTEXT_MENU_ID, manager, getSelectionProvider(), false); getSite().setSelectionProvider(getSelectionProvider()); fSelectionListener.install(getSelectionProvider()); fSelectionListener.setDocument(getDocumentProvider().getDocument(getEditorInput()));
fSelectionListener.uninstall(getSelectionProvider()); fSelectionListener= null;
fSelectionListener.uninstall(getSelectionProvider()); fSelectionListener= null;
getSelectionProvider().addSelectionChangedListener(getSelectionChangedListener()); getEditorSite().registerContextMenu(fEditorContextMenuId, manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); else if (fCompatibilityMode) getEditorSite().registerContextMenu(DEFAULT_EDITOR_CONTEXT_MENU_ID, manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); getEditorSite().registerContextMenu(partId + ".EditorContext", manager, getSelectionProvider(), isEditorInputIncludedInContextMenu()); //$NON-NLS-1$ getEditorSite().registerContextMenu(fRulerContextMenuId, manager, getSelectionProvider(), false); else if (fCompatibilityMode) getEditorSite().registerContextMenu(DEFAULT_RULER_CONTEXT_MENU_ID, manager, getSelectionProvider(), false); getEditorSite().registerContextMenu(partId + ".RulerContext", manager, getSelectionProvider(), false); //$NON-NLS-1$ fRulerContextMenuId= DEFAULT_RULER_CONTEXT_MENU_ID; getSite().setSelectionProvider(getSelectionProvider()); fSelectionListener.install(getSelectionProvider()); fSelectionListener.setDocument(getDocumentProvider().getDocument(getEditorInput()));
ISelection sel= getSelectionProvider().getSelection(); IEditorInput input= getEditorInput(); IDocument document= getDocumentProvider().getDocument(input);