Community
Participate
Working Groups
Build 20020307 EG says: finally... now the variables view can use red text labels for changed values rather than greying out the icons. From the eclipse newsgroup: In the latest Integration and Stable builds this is not possible. However, we have just released code for Windows that will do this (it is in the nightly builds but I recommend you wait for the next integration build). There is new API on TableItem and TreeItem called setForeground() and setBackground(). The implementation for this functionality on motif, photon and gtk will also be available shortly. --- Darin, I got exited too soon, using colors in table items also needs JFace support... Nick, are there any plans to surface this new support through JFace Viewers/LabelProviders? We have some good uses of this in JDT. --- NE replies: This would be good to add. How about: /** * Extends <code>IBaseLabelProvider</code> with the methods to provide * the foreground and background color for the label of a given element. * Used by table viewers and tree viewers. * <p> * This interface is normally implemented by a class also implementing * <code>ILabelProvider</code> or <code>ITableLabelProvider</code>. */ interface ILabelColorProvider extends IBaseLabelProvider { /** * Returns the foreground color to use for the label of the given element, * or <code>null</code> to use the default foreground color. */ Color getForeground(Object element); /** * Returns the background color to use for the label of the given element, * or <code>null</code> to use the default background color. */ Color getBackground(Object element); }
Should do for early M5.
Makes sense. Should there be color support for label decorators as well? The problem is that a label can only have a single color, but the user can control which decorator should have control. A colored label for dirty elements looks nicer than the ASCII ">". (carboned Kevin since we have discussed this some time ago)
Should be able to do this by having DecoratingLabelProvider implement the interface above, and check for it on its decorator (only one involved here). The decorator manager could work similarly, but only consider the first decorator to implement the interface above. Alternatively, it could stop when it found a colour decoration. This could lead to different decorators providing the foreground and background colours though. But that may be more flexible.
Erich, how important is this for 2.0? Can we defer?
Haven't heard back from EG. My feeling is this is not a strong requirement for 2.0, and using colour has accessibility issues. Defering to post-2.0.
Reopen to investigate
For my ramblings on how cool colors and fonts could be, please see http://bugs.eclipse.org/bugs/show_bug.cgi?id=23011.
*** Bug 25739 has been marked as a duplicate of this bug. ***
Added support for colour in AbstractTreeViewer for M4. See IColorProvider. Need to add to remaining viewers.
Added support in TableViewer for I20030213.
Added support in TableTreeViewer for >I20030213. Tree, Table and TableTree are the only SWT controls that support colour per item. AbstractTreeViewer (which covers Tree and TableTree) and TableViewer (which covers Table) now support IColorProvider, so this work is complete.