Find support in Eclipse embedding

1 view
Skip to first unread message

Matt Hillsdon

unread,
Jun 3, 2009, 6:27:59 PM6/3/09
to terminat...@googlegroups.com
I've been working on adding find support to the Eclipse embedding. FWIW
I did the UI differently, using a Firefox-style search bar [1]. I'll
probably add a regex enabled checkbox too, mostly for the
self-documenting benefit.

Attached is a patch that restructures the find code to let me avoid
using a JLabel to retrieve the status and share your code for compiling
the regex, not repeating the same search etc. I think it's an
improvement to have the UI doing less. What do you think?

Matt.

[1] http://matt.hillsdon.net/pb/2009-06-03/findBar.png

findStatus.patch

Martin Dorey

unread,
Jun 3, 2009, 6:32:03 PM6/3/09
to terminat...@googlegroups.com
> a regex enabled checkbox too, mostly for the
> self-documenting benefit.

Good idea! A Python programmer here said that one of the reasons he
wasn't using Evergreen was that the regex search confused him when he
wanted a literal search.

Elliott Hughes

unread,
Jun 3, 2009, 6:37:31 PM6/3/09
to terminat...@googlegroups.com
On Wed, June 3, 2009 15:27, Matt Hillsdon wrote:
> I've been working on adding find support to the Eclipse embedding. FWIW
> I did the UI differently, using a Firefox-style search bar [1]. I'll
> probably add a regex enabled checkbox too, mostly for the self-documenting
> benefit.
>
> Attached is a patch that restructures the find code to let me avoid
> using a JLabel to retrieve the status and share your code for compiling the
> regex, not repeating the same search etc. I think it's an improvement to
> have the UI doing less. What do you think?

i think our current dialog sucks ;-)

i think you might not find it a particularly hard sell to just get us to
use your Firefox-style search bar in Terminator as the only interface...

> Matt.
>
>
> [1] http://matt.hillsdon.net/pb/2009-06-03/findBar.png

--
Elliott Hughes, http://www.jessies.org/~enh/


Matt Hillsdon

unread,
Jun 3, 2009, 6:53:16 PM6/3/09
to terminat...@googlegroups.com
Elliott Hughes wrote:
> i think you might not find it a particularly hard sell to just get us to
> use your Firefox-style search bar in Terminator as the only interface...
>

It doesn't come for free unfortunately because I've implemented it in
SWT. I don't really want Swing widgets inside Eclipse, it just looks
weird [1]. The patch moving more code into the FindHighlighter should
make it easier to play with different UI though.

You do lose some terminal space when the find bar is active. I thought
that a worthwhile trade for it being really obvious when a find is
active and previous/next being more prominent.

Matt.


[1] More so than it should on Linux because the GTK LAF seems less than
stable.

Elliott Hughes

unread,
Jun 3, 2009, 7:06:53 PM6/3/09
to terminat...@googlegroups.com

On Wed, June 3, 2009 15:53, Matt Hillsdon wrote:
> Elliott Hughes wrote:
>> i think you might not find it a particularly hard sell to just get us
>> to use your Firefox-style search bar in Terminator as the only
>> interface...
>
> It doesn't come for free unfortunately because I've implemented it in
> SWT. I don't really want Swing widgets inside Eclipse, it just looks
> weird [1]. The patch moving more code into the FindHighlighter should make
> it easier to play with different UI though.

that's a pity.

> You do lose some terminal space when the find bar is active. I thought
> that a worthwhile trade for it being really obvious when a find is active
> and previous/next being more prominent.

that (and the fact that a dialog is just a few oft-hammered out lines of
code) was the original thinking behind the dialog. in practice, the dialog
appears right on top of your terminal and often needs to be moved before
you can carry on working. Evergreen and Firefox both "steal" space, but i
think it works better in practice.

> Matt.
>
>
>
> [1] More so than it should on Linux because the GTK LAF seems less than
> stable.

--
Elliott Hughes, http://www.jessies.org/~enh/


Matt Hillsdon

unread,
Jun 7, 2009, 9:01:25 AM6/7/09
to terminat...@googlegroups.com
Elliott Hughes wrote:
> On Wed, June 3, 2009 15:53, Matt Hillsdon wrote:
>
>> Elliott Hughes wrote:
>>
>>> i think you might not find it a particularly hard sell to just get us
>>> to use your Firefox-style search bar in Terminator as the only
>>> interface...
>>>
>> It doesn't come for free unfortunately because I've implemented it in
>> SWT. I don't really want Swing widgets inside Eclipse, it just looks
>> weird [1]. The patch moving more code into the FindHighlighter should make
>> it easier to play with different UI though.
>>
>
> that's a pity.
>

Yes. I might get the time to look at doing something similar for
Terminator later, though my Swing is pretty rusty. What do you make of
the patch on my original mail?

Thanks,

Matt.

Elliott Hughes

unread,
Jun 7, 2009, 12:30:06 PM6/7/09
to terminat...@googlegroups.com

do you actually need "clear" as a separate operation? if i replaced JLabel
with EStatusBar (thus removing the " " hack, and making clearStatus
equivalent to setStatus("", false)), would that be sufficient?

--elliott

> Thanks,
>
>
> Matt.

Matt Hillsdon

unread,
Jun 7, 2009, 5:36:54 PM6/7/09
to terminat...@googlegroups.com
Elliott Hughes wrote:
>> Yes. I might get the time to look at doing something similar for
>> Terminator later, though my Swing is pretty rusty. What do you make of
>> the patch on my original mail?
>>
>
> do you actually need "clear" as a separate operation? if i replaced JLabel
> with EStatusBar (thus removing the " " hack, and making clearStatus
> equivalent to setStatus("", false)), would that be sufficient?
>

I would be fine with the smaller interface FindStatusDisplay { void
setStatus(message, isError) }. My current implementation doesn't even
use isError yet, though it should.

EStatusBar looks like it might change the font (size?), not sure whether
that's a problem. Better to have the " " somewhere with a comment
though (as in EStatusBar), I only preserved that behavior by default,
not through understanding the reason for it. Perhaps it would be
obvious if I did more Swing...

Matt.

Elliott Hughes

unread,
Jun 7, 2009, 7:08:26 PM6/7/09
to terminat...@googlegroups.com
On Sun, June 7, 2009 14:36, Matt Hillsdon wrote:
> Elliott Hughes wrote:
>>> Yes. I might get the time to look at doing something similar for
>>> Terminator later, though my Swing is pretty rusty. What do you make
>>> of the patch on my original mail?
>>
>> do you actually need "clear" as a separate operation? if i replaced
>> JLabel
>> with EStatusBar (thus removing the " " hack, and making clearStatus
>> equivalent to setStatus("", false)), would that be sufficient?
>
> I would be fine with the smaller interface FindStatusDisplay { void
> setStatus(message, isError) }. My current implementation doesn't even use
> isError yet, though it should.

cool. i'll go with that then.

> EStatusBar looks like it might change the font (size?), not sure whether
> that's a problem.

yeah, i've broken it into ELabel (which is just a non-broken JLabel) and
EStatusBar (which chooses a font appropriate for a status bar, which isn't
the same as the regular label font on all platforms; generally smaller).
there are a few other places (in other projects) where i can now stop
manually messing about with " ", so that's a good thing all round.

> Better to have the " " somewhere with a comment though
> (as in EStatusBar), I only preserved that behavior by default,
> not through understanding the reason for it. Perhaps it would be obvious
> if I did more Swing...

the "" versus " " is a well-known Swing JLabel gotcha. (i assume you've
already read the comment.)

Elliott Hughes

unread,
Jun 7, 2009, 8:42:51 PM6/7/09
to terminator-users
committed as r1542.

--elliott

Matt Hillsdon

unread,
Jun 8, 2009, 3:56:28 AM6/8/09
to terminat...@googlegroups.com
Elliott Hughes wrote:
> committed as r1542.
>
>
Thanks. Minor patch attached to fix for Java 1.5 (which I think you
still support). String.isEmpty has to be the most common way to break
1.5 builds, it's so natural.

Matt.

findStringLength.patch

Elliott Hughes

unread,
Jun 8, 2009, 11:41:48 AM6/8/09
to terminat...@googlegroups.com

d'oh. thanks, committed. hopefully Java 6 will be the default in Mac OS
10.6; i'm getting sick of this.

Reply all
Reply to author
Forward
0 new messages