Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » [jface.viewers] How do discriminate active and non-active links in ColumnViewer?
[jface.viewers] How do discriminate active and non-active links in ColumnViewer? [message #483159] Mon, 31 August 2009 12:19 Go to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080802000507050401010202
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

I recently needed a table-like ColumnViewer that is capable to
show hyper-links in the column cells. As usually recommended,
I did not embed real hyper-link controls, but instead used
owner-drawn label providers, which are of great advantage
therefore. I could realize both the perfect link color/underlining
as well as mouse cursor changes. You can see that in the code
provided as attachment and you are invited to use it according
to the EPL.

Now my actual question: I would really love to realize an even
more "living" behavior of the links such that it corresponds even
more to that of the hyper-link widgets of SWT. Just open the PDE
editor and move the mouse above such a link, and you will notice
that the color changes during the time the mouse cursor has
switched to the "hand form" between active and non active link
color. I would like to realize the same behavior, even though
I guess that this is probably not trivial. It seems sufficient
to store information of the last active cell, because there can
only be one active cell per column. The question is, how this
information can be represented given the fact that such a table
may be refreshed (not done in the example below). I assume I have
to use this information to return to the previously active cell
and switch that to the inactive color (Viewer.update maybe?)

Besides the question of the backtracking, performance is another
critical issue, because the mouse-form test happens on each mouse-
move. E.g. I could /not/ use Object.equals on the cell elements,
because that could be too costly for the real-objects I have in my
mind. Maybe I should save the last cell item reference?

If anyone has an idea how to realize that, I would be happy
to add his or her contribution to the shared code ;-)

Thanks & Greetings from Bremen,

Daniel Kr
Re: [jface.viewers] How do discriminate active and non-active links in ColumnViewer? [message #485524 is a reply to message #483159] Sat, 12 September 2009 13:44 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Would you like to make an example out of it an add it to our Snippet
collection?

Then please file a bugzilla under
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=UI&bug_severity=enhancement&rep_platf orm=All&op_sys=All&short_desc=[Snippets]

Tom

Daniel Krügler schrieb:
> Hi,
>
> I recently needed a table-like ColumnViewer that is capable to
> show hyper-links in the column cells. As usually recommended,
> I did not embed real hyper-link controls, but instead used
> owner-drawn label providers, which are of great advantage
> therefore. I could realize both the perfect link color/underlining
> as well as mouse cursor changes. You can see that in the code
> provided as attachment and you are invited to use it according
> to the EPL.
>
> Now my actual question: I would really love to realize an even
> more "living" behavior of the links such that it corresponds even
> more to that of the hyper-link widgets of SWT. Just open the PDE
> editor and move the mouse above such a link, and you will notice
> that the color changes during the time the mouse cursor has
> switched to the "hand form" between active and non active link
> color. I would like to realize the same behavior, even though
> I guess that this is probably not trivial. It seems sufficient
> to store information of the last active cell, because there can
> only be one active cell per column. The question is, how this
> information can be represented given the fact that such a table
> may be refreshed (not done in the example below). I assume I have
> to use this information to return to the previously active cell
> and switch that to the inactive color (Viewer.update maybe?)
>
> Besides the question of the backtracking, performance is another
> critical issue, because the mouse-form test happens on each mouse-
> move. E.g. I could /not/ use Object.equals on the cell elements,
> because that could be too costly for the real-objects I have in my
> mind. Maybe I should save the last cell item reference?
>
> If anyone has an idea how to realize that, I would be happy
> to add his or her contribution to the shared code ;-)
>
> Thanks & Greetings from Bremen,
>
> Daniel Krügler
>
Re: [jface.viewers] How do discriminate active and non-active links in ColumnViewer? [message #485602 is a reply to message #485524] Mon, 14 September 2009 05:53 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Tom Schindl wrote:
> Hi,
>
> Would you like to make an example out of it an add it to our Snippet
> collection?
>
> Then please file a bugzilla under
> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=UI&bug_severity=enhancement&rep_platf orm=All&op_sys=All&short_desc=[Snippets]

Of-course I would like to do that. Just for clarification:
Do you suggest the bugzilla as an entry point for the example
or for the unresolved problem I have? (For the latter one
I have no real solution yet, but where simply asking for
assistance).

Greetings from Bremen,

- Daniel
Re: [jface.viewers] How do discriminate active and non-active links in ColumnViewer? [message #485627 is a reply to message #485602] Mon, 14 September 2009 08:26 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Only for the snippet. I have no clue yet how to optimize your strategy
beside using a MouseMove-Listener and fetching the hovered cell using
ColumnViewer#getCell(Point).

Tom

Daniel Krügler schrieb:
> Tom Schindl wrote:
>> Hi,
>>
>> Would you like to make an example out of it an add it to our Snippet
>> collection?
>>
>> Then please file a bugzilla under
>> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=UI&bug_severity=enhancement&rep_platf orm=All&op_sys=All&short_desc=[Snippets]
>>
>
> Of-course I would like to do that. Just for clarification:
> Do you suggest the bugzilla as an entry point for the example
> or for the unresolved problem I have? (For the latter one
> I have no real solution yet, but where simply asking for
> assistance).
>
> Greetings from Bremen,
>
> - Daniel
Re: [jface.viewers] How do discriminate active and non-active links in ColumnViewer? [message #485639 is a reply to message #485627] Mon, 14 September 2009 09:37 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Tom Schindl wrote:
> Only for the snippet.

OK.

I have no clue yet how to optimize your strategy
> beside using a MouseMove-Listener and fetching the hovered cell using
> ColumnViewer#getCell(Point).

My main question is: What would you use as the actual identifier
of the last "hot-spot-selection"? I assume that ViewerCell's are
basically volatile in nature and may simply be recreated from one point
to another, is that correct?
Do you suggest to use the previous object reference?
Do you think that the idea of the local update is the right way to go?

Thanks in advance,

- Daniel
Re: [jface.viewers] How do discriminate active and non-active links in ColumnViewer? [message #485646 is a reply to message #485639] Mon, 14 September 2009 10:00 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Daniel Krügler schrieb:
> Tom Schindl wrote:
>> Only for the snippet.
>
> OK.
>
> I have no clue yet how to optimize your strategy
>> beside using a MouseMove-Listener and fetching the hovered cell using
>> ColumnViewer#getCell(Point).
>
> My main question is: What would you use as the actual identifier
> of the last "hot-spot-selection"? I assume that ViewerCell's are
> basically volatile in nature and may simply be recreated from one point
> to another, is that correct?

Yes it is recreated whenever you call getViewerCell(Point) but from a
performance PoV it's not that bad as you might think it is.

We ourselves do such tracking when you are using our ToolTip support so
maybe you take a look at it :-)

> Do you suggest to use the previous object reference?

Yes you need to store this information so that your label provider has
access to it. Whenever the hovered cell changes you need to issue a
redraw (ideally only from the areas that changed which are 2 rectangles).

> Do you think that the idea of the local update is the right way to go?
>

Yes but naturally your LabelProvider also has to be implemented in a way
that global updates work (I'm not 100% sure any more how the owner draw
listeners but when I implemented the cell navigation I think I also used
redrawing of local areas instead of the whole client-area).

Tom
Re: [jface.viewers] How do discriminate active and non-active links in ColumnViewer? [message #485667 is a reply to message #485524] Mon, 14 September 2009 12:20 Go to previous message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Tom Schindl wrote:
> Would you like to make an example out of it an add it to our Snippet
> collection?
>
> Then please file a bugzilla under
> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=UI&bug_severity=enhancement&rep_platf orm=All&op_sys=All&short_desc=[Snippets]

Done: #289341

- Daniel
Previous Topic:Traverse to get all children
Next Topic:View Maximize Event
Goto Forum:
  


Current Time: Tue Apr 16 19:01:48 GMT 2024

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

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

Back to the top