|
From: Dale A. <da...@gr...> - 2012-04-17 21:08:06
|
It is. The jEdit text area was developed as a custom component because of
the exceedingly poor performance of the swing components when they first
came out. Now there is so much of jEdit built around that custom component
that no one wants to replace it with a swing component.
On Tue, Apr 17, 2012 at 2:36 PM, Steve Curtis <sjc...@gm...> wrote:
> Hm. On first glance, it doesn't look like that kind of functionality is
> available to jEdit's ScrollListener class. Looking at some of the JDK
> stuff as an example, it seems that a ScrollListener would be notified with
> a ScrollEvent that had as one of it's members a TextArea source, with some
> other information in it that could distinguish cursor movements, from
> scroll bar shifts, to the dreaded automatic jump left. Instead, it is
> notified with the TextArea with no way of making the distinction of what
> kind of scroll event occurred. But a change like that would involve a
> major change to the jEdit API. Is that assessment accurate?
>
> Steve
>
>
> On Tue, Apr 17, 2012 at 4:09 PM, Steve Curtis <sjc...@gm...> wrote:
>
>> Wow. That was quick, and quite affective. I work with java, but haven't
>> done any jEdit bean shell scripting. I'll try to use this as a launch
>> point to write a macro that doesn't ignore the scroll bar/cursor events,
>> but ignores events that cause the automatic jump to the left. This lock is
>> a little too affective. You should call it "Horizontal vice grip". lol
>>
>> Thanks for the script,
>> Steve
>>
>>
>> On Tue, Apr 17, 2012 at 3:37 PM, Dale Anson <da...@gr...> wrote:
>>
>>> The macro below will lock the horizontal scroll bar. Run it again to
>>> unlock it. Copy it to your jEdit Settings/macro directory. To find your
>>> jEdit Settings directory from jEdit, go to the Utilities menu, mouse over
>>> the Settings Directory, and the actual directory location will be the first
>>> menu item. Name the macro file name Toggle_Horizontal_Scroll_Lock.bsh. Then
>>> you can run it from the macros menu or assign a shortcut to it.
>>>
>>> Let me know if you have any problems with this.
>>>
>>> Dale
>>>
>>> ~~~~~
>>>
>>>
>>> import org.gjt.sp.jedit.textarea.ScrollListener;
>>> import org.gjt.sp.jedit.textarea.TextArea;
>>>
>>> String clientKey = "macro_horizontal_scroll_lock";
>>>
>>> toggleHorizontalLock() {
>>> ScrollListener scrollListener =
>>> (ScrollListener)textArea.getClientProperty(clientKey);
>>> if (scrollListener == null) {
>>> // scrolling not locked, set to locked
>>> int offset = textArea.getHorizontalOffset();
>>> scrollListener = new ScrollListener() {
>>> public void scrolledHorizontally(TextArea ta) {
>>> ta.setHorizontalOffset(offset);
>>> }
>>> public void scrolledVertically(TextArea ta){}
>>> };
>>> textArea.putClientProperty(clientKey, scrollListener);
>>> textArea.addScrollListener(scrollListener);
>>> }
>>> else {
>>> // locked, unlock scrolling
>>> textArea.removeScrollListener(scrollListener);
>>> textArea.putClientProperty(clientKey, null);
>>> }
>>> }
>>>
>>> toggleHorizontalLock();
>>>
>>>
>>> ~~~~~
>>>
>>> On Tue, Apr 17, 2012 at 10:47 AM, Steve Curtis <sjc...@gm...>wrote:
>>>
>>>> When viewing a log file with a jagged right margin, is there a way to
>>>> lock the horizontal scrolling such that the view does not jump to the left
>>>> when the longest line no longer reaches the right most view boundary?
>>>>
>>>> Thanks,
>>>> Steve
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Better than sec? Nothing is better than sec when it comes to
>>>> monitoring Big Data applications. Try Boundary one-second
>>>> resolution app monitoring today. Free.
>>>> http://p.sf.net/sfu/Boundary-dev2dev
>>>> --
>>>> -----------------------------------------------
>>>> jEdit Users' List
>>>> jEd...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/jedit-users
>>>>
>>>>
>>>
>>
>
|