Bug 219393 - [Viewers] StyledCellLabelProvider update
Summary: [Viewers] StyledCellLabelProvider update
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 219271 219581
  Show dependency tree
 
Reported: 2008-02-19 04:12 EST by Martin Aeschlimann CLA
Modified: 2008-03-28 15:28 EDT (History)
3 users (show)

See Also:


Attachments
patch (62.49 KB, patch)
2008-02-19 04:12 EST, Martin Aeschlimann CLA
no flags Details | Diff
JDT UI patch (141.43 KB, patch)
2008-02-19 04:14 EST, Martin Aeschlimann CLA
no flags Details | Diff
uddated patch for JFace (74.88 KB, patch)
2008-02-21 10:53 EST, Martin Aeschlimann CLA
no flags Details | Diff
patch for JDT/UI (152.59 KB, patch)
2008-02-21 10:54 EST, Martin Aeschlimann CLA
no flags Details | Diff
Delegating and Decorating label provider & snippet update (56.29 KB, patch)
2008-02-26 10:01 EST, Martin Aeschlimann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2008-02-19 04:12:59 EST
Created attachment 90042 [details]
patch

3.4 M6

The following patch is an update on the ongoing effort to make API for labels with styles.

- Reworked the SimpleStyledCellLabelProvider (SSCLP) to make it more consistent with other CellLabelProvider. No need for an inner class LabelInfoProvider: User update the labels in 'update'. I extended the ViewerCell to contain getter/setters for the styled ranges.
I renamed SSCLP to 'StyledCellLabelProvider'. SSCLP is marked as deprecated and should be removed before M6.

- StyledString: Represents a string with styled ranges
- DelegatingStyledCellLabelProvider: An implementation of a StyledCellLabelProvider that delegates the request for styled text labels to a IStyledLabelProvider (inner class of DSCLP).
  This interface is useful when enhancing existing (old fashioned) ILabelProviders with styled label capability. In JDT we have lots of LP that are API and where we can change the hierarchy.

- default decoration colors moved to JFace
  - JFacePreferences.QUALIFIER_COLOR, JFacePreferences.DECORATION_COLOR,
    JFacePreferences.COUNTER_COLOR...
  - open point: initialization of the colors:
    I'm not sure how this happens in JFace

The patch also contains an update to the FilteredItemsSelectionDialog to allow subclasses to use styled labels (colors in the open type dialog)
Comment 1 Martin Aeschlimann CLA 2008-02-19 04:14:04 EST
Created attachment 90043 [details]
JDT UI patch

These are the changes in JDT UI: Attached to this bug to not loose them
Comment 2 Martin Aeschlimann CLA 2008-02-19 04:23:41 EST
Note that this patch also contains the changes requested for bug 218344.
Comment 3 Chris Aniszczyk CLA 2008-02-21 10:10:19 EST
Boris/Tom, is there a target milestone for this? PDE is very interested in adopting this.
Comment 4 Martin Aeschlimann CLA 2008-02-21 10:53:36 EST
Created attachment 90363 [details]
uddated patch for JFace

This updates the patch for JFace:

- The DelegatingStyledCellLabelProvider now optionally takes a decorator and can act as a replacement of the DecoratingLabelProvider
- renamed to DecoratingStyledCellLabelProvider

It is open for discussion if it makes sense to rather have two classes DelegatingStyledCellLabelProvider and DecoratingStyledCellLabelProvider.
Comment 5 Martin Aeschlimann CLA 2008-02-21 10:54:14 EST
Created attachment 90364 [details]
patch for JDT/UI
Comment 6 Martin Aeschlimann CLA 2008-02-21 11:04:13 EST
note that DecoratingStyledCellLabelProvider solves the flickering from label decorators (bug 219581) that we got again by switching to the StyledCellLabelProvider in M6
Comment 7 Boris Bokowski CLA 2008-02-22 00:07:48 EST
Tom, could you have a look at Martin's patch as well? I would like to know what you think about adding API to ViewerCell (other feedback is welcome too, of course).
Comment 8 Thomas Schindl CLA 2008-02-22 04:23:09 EST
OK. One small comment, when creating setData-constants we use Policy.JFACE + "...." as far as I remember. I'm fine with the new methods added.
Comment 9 Boris Bokowski CLA 2008-02-25 12:50:15 EST
First step. Released changes to:

SimpleStyledCellLabelProvider.java
StyledCellLabelProvider.java
TableViewerRow.java
TreeViewerRow.java
ViewerCell.java
ViewerRow.java

with two additional null checks in StyledCellLabelProvider, and the change to the constant as suggested by Tom.

I am now waiting for a new patch from Martin which splits DecoratingStyledCellLabelProvider into two separate classes, one for delegation, and the other for decoration.
Comment 10 Chris Aniszczyk CLA 2008-02-25 13:01:59 EST
I can't wait.

http://www.youtube.com/watch?v=w-DcNPFWhbk
Comment 11 Boris Bokowski CLA 2008-02-25 22:54:32 EST
I also released StyledStringBuilder.java (renamed from StyledString.java), and associated changes in JFacePreferences.java.

Outstanding changes: DecoratingStyledCellLabelProvider, snippets, and FilteredItemsSelectionDialog.

Chris:
http://www.youtube.com/watch?v=9yL715aBemA
Comment 12 Martin Aeschlimann CLA 2008-02-26 10:01:51 EST
Created attachment 90747 [details]
Delegating and Decorating label provider & snippet update
Comment 13 Boris Bokowski CLA 2008-02-26 10:26:41 EST
Released "Delegating and Decorating label provider & snippet update" >20080226
Comment 14 Boris Bokowski CLA 2008-02-26 10:32:50 EST
Since we have a delayed I build today I have released the two additional classes for the I build.
Comment 15 Jason Brennan CLA 2008-03-28 15:15:14 EDT
Verified in I20080327-2251
Comment 16 Kim Horne CLA 2008-03-28 15:28:27 EDT
Marking as verified.