fEditor, false);
if (!(inputElement instanceof ISourceModule && inputElement.exists()))
return;
// ITypeRoot typeRoot= (ITypeRoot) inputElement;
ISourceRange sourceRange;
try {
sourceRange = inputElement.getSourceRange();
if (sourceRange == null || sourceRange.getLength() == 0) {
MessageDialog
.openInformation(
fEditor.getEditorSite().getShell(),
Messages.StructureSelectionAction_0,
Messages.StructureSelectionAction_1);
return;
}
} catch (ModelException e) {
}
ITextSelection selection = getTextSelection();
ISourceRange newRange = getNewSelectionRange(
createSourceRange(selection), inputElement);
// 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();
}
}