#518 Improved layout manager for text area

None
closed-accepted
Dale Anson
None
5
2014-03-31
2013-12-07
Dale Anson
No

This patch allows the ColumnRuler plugin and the "blame" command from the SVN plugin to work in harmony. See this tracker for some background:

https://sourceforge.net/tracker/index.php?func=detail&aid=3615262&group_id=588&atid=565475

This patch modifies ScrollLayout to be essentially a 3 x 3 grid layout. Previously, it was very similar to a BorderLayout. With the 3 x 3 layout, it is now possible to add small components, like buttons or labels, in the corners of the text area. For the case of ColumnRuler, it still is placed in the top center. For the SVN blame command, the "close blame" button can go in the top right corner, which lets them both be visible at once without clashing. There are constraints on the sizes of the corners, for example, the width of the bottom left corner is the width of the gutter, the height of the bottom left corner is the height of the bottom scrollbar.

The patch also adds a few methods to TextArea to set the corner components. I did not add methods to remove the corner components since the "remove(Component)" method inherited from JComponent already does that.

One side effect/feature is now the bottom scroll bar is the same width as the center text area rather than extending under the gutter and under any components added to the right side of the text area.

Discussion

  • Dale Anson
    Dale Anson
    2013-12-07

     
    Attachments
  • Dale Anson
    Dale Anson
    2013-12-07

    Screenshot

     
    Attachments
  • Dale Anson
    Dale Anson
    2013-12-07

    Attached a screenshot.

     
  • Alan Ezust
    Alan Ezust
    2013-12-12

    Been testing it for 5 days, so far so good. The little corner spaces are noticable but are not a problem for me.
    CommonControls blame will need to be fixed to check the jEdit version to decide where to put its blame button.

     
  • Dale Anson
    Dale Anson
    2013-12-12

    Thanks, I was hoping someone would try it out and agree it's okay before I committed the change since it does alter the layout of the text area.

     
  • Alan Ezust
    Alan Ezust
    2014-03-30

    Dale, are you going to commit it or are you waiting for someone else to?
    I think this should go into 5.2

     
  • Alan Ezust
    Alan Ezust
    2014-03-30

    • assigned_to: Dale Anson
    • Group: -->
     
  • Dale Anson
    Dale Anson
    2014-03-30

    Yes, I should finally have some time this week to get to jEdit things.

     
  • Dale Anson
    Dale Anson
    2014-03-31

    Patch applied in revision 23451.

    Once 5.2 is released, there are changes for both ColumnRuler and CommonControls to release.

     
  • Dale Anson
    Dale Anson
    2014-03-31

    • status: open --> closed-accepted