Bug 55968 [misc] segmented view does not work with new methods
i2004-03-24+plugin export - add a new method into a class by typing: public void test() {[enter] - the closing bracket is made automatically and the cursor is placed in the method - press "show source of selected element only" - observed behavior: the selected segment is the whole class rather than the method in which the cursor was
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
private IJavaElement fElement;
		
		private int fElementLine;
		
		/**
		 * Store visual properties of the given offset.  
		 * 
		 * @param offset Offset in the document
		 */
		public void setOffset(int offset) {
			try {
				IDocument document= getSourceViewer().getDocument();
				fLine= document.getLineOfOffset(offset);
				fColumn= offset - document.getLineOffset(fLine);
				fElement= getElementAt(offset, true);
				fElementLine= -1;
				if (fElement instanceof IMember) {
					ISourceRange range= ((IMember) fElement).getNameRange();
					if (range != null)
						fElementLine= document.getLineOfOffset(range.getOffset());
				}
				if (fElementLine == -1)
					fElementLine= document.getLineOfOffset(getOffset(fElement));
			} catch (BadLocationException e) {
				
				JavaPlugin.log(e);
				clear();
			} catch (JavaModelException e) {