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/JavaEditor.java
int position= widgetOffset2ModelOffset(viewer, viewer.getTextWidget().getCaretOffset());
			
				
				final IPreferenceStore store= getNewPreferenceStore();
				final ITypedRegion region= TextUtilities.getPartition(document, IJavaPartitions.JAVA_PARTITIONING, position);
				if (!store.getBoolean(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION)) {
					super.run();
					return;				
				}
				
				if (Character.isJavaIdentifierStart(document.getChar(position))) {
					int offset= 0;
					int order= CollationElementIterator.NULLORDER;
					short previous= Short.MAX_VALUE;
					short next= Short.MAX_VALUE;
					
					final String buffer= document.get(position, region.getOffset() + region.getLength() - position);
					final CollationElementIterator iterator= fCollator.getCollationElementIterator(buffer);
					
					do {
						
						offset= iterator.getOffset();
						if (!Character.isJavaIdentifierPart(document.getChar(position + offset)))
							throw new BadLocationException();
						
						order= iterator.next();
						next= CollationElementIterator.tertiaryOrder(order);
						if (next <= previous)
							previous= next;