This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 178684

Summary: sidebar on the right side of editor area
Product: editor Reporter: Vladimir Voskresensky <vv159170>
Component: Painting & PrintingAssignee: Miloslav Metelka <mmetelka>
Status: RESOLVED WONTFIX    
Severity: normal CC: issues
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Now on the left side
Preffered annotation on the right side

Description Vladimir Voskresensky 2009-12-15 14:26:12 UTC
We have some annotations from profiler tools and display the metrics on the
left part of editor. 
The issue is that not each line has such metric => there
are parts of file without metrics at all => side bar area is blank.
It is confusing for user to see his text shifted to the right without any reason.

It would be great to have possibility put side bars to the right side of editor (before scrollbar).
For instance we can consider Editor to have "sidebar position" of 10000 and all sidebars after 10000 will be drawn on the right side of editor, not on the left of it
Comment 1 Vladimir Voskresensky 2009-12-15 14:26:49 UTC
Created attachment 92633 [details]
Now on the left side
Comment 2 Vladimir Voskresensky 2009-12-15 14:27:16 UTC
Created attachment 92634 [details]
Preffered annotation on the right side
Comment 3 Vladimir Voskresensky 2009-12-16 01:42:37 UTC
Oh, great. You have such support... almost :-)
<attr name="location" stringvalue="East"/>
should do a trick, but for now it is:

java.lang.IllegalArgumentException: Unsupported side bar position, scrollable = true, position=East
	at org.netbeans.modules.editor.NbEditorUI.processSideBars(NbEditorUI.java:308)
	at org.netbeans.modules.editor.NbEditorUI.createExtComponent(NbEditorUI.java:240)
	at org.netbeans.editor.EditorUI.getExtComponent(EditorUI.java:860)
	at org.netbeans.modules.editor.NbEditorDocument.createEditor(NbEditorDocument.java:178)
Comment 4 Jan Lahoda 2009-12-16 04:11:53 UTC
Well, yes it is unsupported, because the supported scrollable locations (west and north) are directly supported by JScrollPane. JScrollPane does not support custom components in east and south locations (scrollbars are there). Extending the JScrollPane to support east and south locations is non-trivial, AFAIK. The best option to explore, I can currently imagine, is to subclass ScrollPaneLayout, rewrite it to support the two additional locations (subclass of JScrollPane may also be needed, but is not sufficient, I think). As always, a tested patch greatly increases probability of an enhancement to be implemented.
Comment 5 shunbul 2011-07-05 06:48:13 UTC
I would love to see this implemented... it gives much more flexibility to presenting annotation.  There is often loads of whitespace on the right margin that could be put to better use.

I am sure that the feature would be used by many if implemented
Comment 7 Martin Balin 2016-07-07 07:27:28 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss