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
}
	
	/*
	 * @see org.eclipse.ui.texteditor.ExtendedTextEditor#initializeKeyBindingScopes()
	 */
	protected void initializeKeyBindingScopes() {
		setKeyBindingScopes(new String[] { "org.eclipse.jdt.ui.javaEditorScope" });  
	}
	
	/*
	 * @see org.eclipse.ui.texteditor.ExtendedTextEditor#initializeEditor()
	 */
	protected void initializeEditor() {
		IPreferenceStore newStore= createNewPreferenceStore(null);
		setNewPreferenceStore(newStore, JavaPlugin.getDefault().getPreferenceStore());
		JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
		setSourceViewerConfiguration(new JavaSourceViewerConfiguration(textTools.getColorManager(), newStore, this, IJavaPartitions.JAVA_PARTITIONING));
		fMarkOccurrenceAnnotations= newStore.getBoolean(PreferenceConstants.EDITOR_MARK_OCCURRENCES);
		fStickyOccurrenceAnnotations= newStore.getBoolean(PreferenceConstants.EDITOR_STICKY_OCCURRENCES);
	}
	
	/*
	 * @see AbstractTextEditor#createSourceViewer(Composite, IVerticalRuler, int)
	 */
	protected final ISourceViewer createSourceViewer(Composite parent, IVerticalRuler verticalRuler, int styles) {
		
		ISourceViewer viewer= createJavaSourceViewer(parent, verticalRuler, getOverviewRuler(), isOverviewRulerVisible(), styles);
		
		StyledText text= viewer.getTextWidget();
		text.addBidiSegmentListener(new  BidiSegmentListener() {