Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » JFace TableViewer - always edit cell on mouse down?
JFace TableViewer - always edit cell on mouse down? [message #67606] Mon, 09 June 2003 02:31 Go to next message
Eclipse UserFriend
Originally posted by: eclipse.10.jgale.spamgourmet.com

Hi all,

I have a question about using JFace in a standalone app, I was directed here
from eclipse.platform.swt.

My standlone app uses TableViewers. I have just recently added in-place cell
editing to my Table using the TableViewer/CellEditor/ICellModifier approach.
My problem is that whenever the cell is clicked, it automatically activates
the CellEditor. I am somewhat surprised that this is the default behaviour
and more surprised that there doesn't seem to be a way to turn it off.

Looking at the source for the implementation of TableViewer, I see that
hookControl() always adds a mouse listener for mouse down events, and starts
editing the cell immediately when it sees that event. For tables that are
primarily used for display/selection (e.g a file explorer) this behaviour is
annoying. I would prefer to disable the mouse down behaviour and instead
call editElement() when the users selects Rename or something along those
lines. In an ideal world, I'd like the cell editing to be activated when
they click on the cell then move the mouse slightly to the side, like most
operating systems file managers do.

IMO, this mouse down behaviour should be optional. Does anyone else consider
it a bug in the TableViewer implementation?

Right now I've using my own copy of the TableViewer class with that part of
hookControl() commented out. Is there a more elegant solution? I'd derive a
class from TableViewer but ContentViewer javadoc says that
super.hookControl() must be called anyway. I suppose I could also create
editors manually w/o using the JFace model but this seems like more trouble
than it's worth considering the JFace model is so close to what I want.

Platform: Win32
Elcipse: R2.1

Thanks very much!
Jeremy Gale
Re: JFace TableViewer - always edit cell on mouse down? [message #69582 is a reply to message #67606] Tue, 10 June 2003 12:13 Go to previous message
Eclipse UserFriend
Originally posted by: lynne_kues.oti.com

I haven't actually tried it, but if you want to avoid subclassing
TableViewer it looks like you could just add the cell editor (via
setCellEditors) when your rename action occurs and then remove the cell
editor (via setCellEditors) when the rename is done.

"Jeremy Gale" <eclipse.10.jgale@spamgourmet.com> wrote in message
news:bc19kf$pfo$1@rogue.oti.com...
> Hi all,
>
> I have a question about using JFace in a standalone app, I was directed
here
> from eclipse.platform.swt.
>
> My standlone app uses TableViewers. I have just recently added in-place
cell
> editing to my Table using the TableViewer/CellEditor/ICellModifier
approach.
> My problem is that whenever the cell is clicked, it automatically
activates
> the CellEditor. I am somewhat surprised that this is the default behaviour
> and more surprised that there doesn't seem to be a way to turn it off.
>
> Looking at the source for the implementation of TableViewer, I see that
> hookControl() always adds a mouse listener for mouse down events, and
starts
> editing the cell immediately when it sees that event. For tables that are
> primarily used for display/selection (e.g a file explorer) this behaviour
is
> annoying. I would prefer to disable the mouse down behaviour and instead
> call editElement() when the users selects Rename or something along those
> lines. In an ideal world, I'd like the cell editing to be activated when
> they click on the cell then move the mouse slightly to the side, like most
> operating systems file managers do.
>
> IMO, this mouse down behaviour should be optional. Does anyone else
consider
> it a bug in the TableViewer implementation?
>
> Right now I've using my own copy of the TableViewer class with that part
of
> hookControl() commented out. Is there a more elegant solution? I'd derive
a
> class from TableViewer but ContentViewer javadoc says that
> super.hookControl() must be called anyway. I suppose I could also create
> editors manually w/o using the JFace model but this seems like more
trouble
> than it's worth considering the JFace model is so close to what I want.
>
> Platform: Win32
> Elcipse: R2.1
>
> Thanks very much!
> Jeremy Gale
>
>
>
>
Previous Topic:Want to add a new toolbar to...
Next Topic:Problem with installation
Goto Forum:
  


Current Time: Sat Jul 26 05:02:36 EDT 2025

Powered by FUDForum. Page generated in 0.03698 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top