Bug 73150 - Visualiser should handle Colors better
Summary: Visualiser should handle Colors better
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: 1.1.12   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Matt Chapman CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-02 09:42 EDT by Matt Chapman CLA
Modified: 2004-09-07 04:40 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Chapman CLA 2004-09-02 09:42:53 EDT
SWT Color objects require operating system resources, and so must be disposed
when finished with. Furthermore the visualiser allocates all the set Colors it
may need upfront - much better would be to only allocate the Colors if/when they
are required.
Comment 1 Matt Chapman CLA 2004-09-02 10:42:58 EDT
Fixing this by changing the colour classes to return RGB values instead of Color
objects. It is then up to the markup provider to allocate and dispose of the
required Color objects.

In the process of doing this I have also generalised the mechanism of defining a
set of colours. I have created an new extension point:
    org.eclipse.contribution.visualiser.palettes
that can be used to contribue a class implementing the new IVisualiserPalette
interface. I have converted the two existing colour sets (one in the visualiser
and one in AJDT) to be implementors of this extension point.

Provider extensions can now optionally include a "paletteid" attribute, refering
to a palette which should become the current palette when that provider is selected.

A future enhancement would be to add preference page support to allow users to
select between contributed palettes.
Comment 2 Matt Chapman CLA 2004-09-07 04:40:01 EDT
The preference page support for this and other options is covered by enhancement
73341: Visualiser rendering enhancements