private void doListSelectionChanged(int page, ISourceRange[] ranges, JavaEditor editor) { if (editor != null && ranges != null && page >= 0 && page < ranges.length) { ISourceRange range= ranges[page]; editor.selectAndReveal(range.getOffset(), range.getLength()); } }
private void doListSelectionChanged(int page, ISourceRange[] ranges, JavaEditor editor) { if (ranges != null && page >= 0 && page < ranges.length) { ISourceRange range= ranges[page]; editor.selectAndReveal(range.getOffset(), range.getLength()); } }
private void doListSelectionChanged(int page, ISourceRange[] ranges) { if (fEditor != null && ranges != null && page >= 0 && page < ranges.length) { ISourceRange range= ranges[page]; fEditor.selectAndReveal(range.getOffset(), range.getLength()); } }
private void doListSelectionChanged(int page, ISourceRange[] ranges, JavaEditor editor) { if (ranges != null && page >= 0 && page < ranges.length) { ISourceRange range= ranges[page]; editor.selectAndReveal(range.getOffset(), range.getLength()); } }
public void run() { ISourceRange old= fHistory.getLast(); if (old != null) { try { fHistory.ignoreSelectionChanges(); fEditor.selectAndReveal(old.getOffset(), old.getLength()); } finally { fHistory.listenToSelectionChanges(); } } } }
@Override public void run() { ISourceRange old= fHistory.getLast(); if (old != null) { try { fHistory.ignoreSelectionChanges(); fEditor.selectAndReveal(old.getOffset(), old.getLength()); } finally { fHistory.listenToSelectionChanges(); } } } }
@Override public void run() { ISourceRange old= fHistory.getLast(); if (old != null) { try { fHistory.ignoreSelectionChanges(); fEditor.selectAndReveal(old.getOffset(), old.getLength()); } finally { fHistory.listenToSelectionChanges(); } } } }
@Override public final void run() { ITextSelection selection= getTextSelection(); ISourceRange newRange= getNewSelectionRange(createSourceRange(selection), null); // Check if new selection differs from current selection if (selection.getOffset() == newRange.getOffset() && selection.getLength() == newRange.getLength()) return; fEditor.selectAndReveal(newRange.getOffset(), newRange.getLength()); }
public final void run() { ITextSelection selection= getTextSelection(); ISourceRange newRange= getNewSelectionRange(createSourceRange(selection), null); // Check if new selection differs from current selection if (selection.getOffset() == newRange.getOffset() && selection.getLength() == newRange.getLength()) return; fEditor.selectAndReveal(newRange.getOffset(), newRange.getLength()); }
@Override public final void run() { ITextSelection selection= getTextSelection(); ISourceRange newRange= getNewSelectionRange(createSourceRange(selection), null); // Check if new selection differs from current selection if (selection.getOffset() == newRange.getOffset() && selection.getLength() == newRange.getLength()) return; fEditor.selectAndReveal(newRange.getOffset(), newRange.getLength()); }
OccurrenceLocation location= JavaElementHyperlinkDetector.findBreakOrContinueTarget(input, region); if (location != null) { fEditor.selectAndReveal(location.getOffset(), location.getLength()); return; fEditor.selectAndReveal(location.getOffset(), location.getLength()); return;
editor.selectAndReveal(textSelection.getOffset(), textSelection.getLength());
fEditor.selectAndReveal(textSelection.getOffset(), textSelection.getLength());
editor.selectAndReveal(textSelection.getOffset(), textSelection.getLength());
editor.selectAndReveal(textSelection.getOffset(), textSelection.getLength());
OccurrenceLocation location= JavaElementHyperlinkDetector.findBreakOrContinueTarget(input, region); if (location != null) { fEditor.selectAndReveal(location.getOffset(), location.getLength()); return;
public final void run() { IJavaElement inputElement= EditorUtility.getEditorInputJavaElement(fEditor, false); if (!(inputElement instanceof ISourceReference && inputElement.exists())) return; ISourceReference source= (ISourceReference)inputElement; ISourceRange sourceRange; try { sourceRange= source.getSourceRange(); if (sourceRange == null || sourceRange.getLength() == 0) { MessageDialog.openInformation(fEditor.getEditorSite().getShell(), SelectionActionMessages.StructureSelect_error_title, SelectionActionMessages.StructureSelect_error_message); return; } } catch (JavaModelException e) { } ITextSelection selection= getTextSelection(); ISourceRange newRange= getNewSelectionRange(createSourceRange(selection), source); // Check if new selection differs from current selection if (selection.getOffset() == newRange.getOffset() && selection.getLength() == newRange.getLength()) return; fSelectionHistory.remember(new SourceRange(selection.getOffset(), selection.getLength())); try { fSelectionHistory.ignoreSelectionChanges(); fEditor.selectAndReveal(newRange.getOffset(), newRange.getLength()); } finally { fSelectionHistory.listenToSelectionChanges(); } }
@Override public final void run() { IJavaElement inputElement= EditorUtility.getEditorInputJavaElement(fEditor, false); if (!(inputElement instanceof ITypeRoot && inputElement.exists())) return; ITypeRoot typeRoot= (ITypeRoot) inputElement; ISourceRange sourceRange; try { sourceRange= typeRoot.getSourceRange(); if (sourceRange == null || sourceRange.getLength() == 0) { MessageDialog.openInformation(fEditor.getEditorSite().getShell(), SelectionActionMessages.StructureSelect_error_title, SelectionActionMessages.StructureSelect_error_message); return; } } catch (JavaModelException e) { } ITextSelection selection= getTextSelection(); ISourceRange newRange= getNewSelectionRange(createSourceRange(selection), typeRoot); // Check if new selection differs from current selection if (selection.getOffset() == newRange.getOffset() && selection.getLength() == newRange.getLength()) return; fSelectionHistory.remember(new SourceRange(selection.getOffset(), selection.getLength())); try { fSelectionHistory.ignoreSelectionChanges(); fEditor.selectAndReveal(newRange.getOffset(), newRange.getLength()); } finally { fSelectionHistory.listenToSelectionChanges(); } }
@Override public final void run() { IJavaElement inputElement= EditorUtility.getEditorInputJavaElement(fEditor, false); if (!(inputElement instanceof ITypeRoot && inputElement.exists())) return; ITypeRoot typeRoot= (ITypeRoot) inputElement; ISourceRange sourceRange; try { sourceRange= typeRoot.getSourceRange(); if (sourceRange == null || sourceRange.getLength() == 0) { MessageDialog.openInformation(fEditor.getEditorSite().getShell(), SelectionActionMessages.StructureSelect_error_title, SelectionActionMessages.StructureSelect_error_message); return; } } catch (JavaModelException e) { } ITextSelection selection= getTextSelection(); ISourceRange newRange= getNewSelectionRange(createSourceRange(selection), typeRoot); // Check if new selection differs from current selection if (selection.getOffset() == newRange.getOffset() && selection.getLength() == newRange.getLength()) return; fSelectionHistory.remember(new SourceRange(selection.getOffset(), selection.getLength())); try { fSelectionHistory.ignoreSelectionChanges(); fEditor.selectAndReveal(newRange.getOffset(), newRange.getLength()); } finally { fSelectionHistory.listenToSelectionChanges(); } }
MessageDialog.openInformation(getShell(), ActionMessages.OrganizeImportsAction_error_title, message); if (parseError.getSourceStart() != -1) { editor.selectAndReveal(parseError.getSourceStart(), parseError.getSourceEnd() - parseError.getSourceStart() + 1);