ColorFieldEditor [message #42678] |
Wed, 21 May 2003 20:18 |
Eclipse User |
|
|
|
Originally posted by: gsrt.terra.com.br
--------------A8612DF59ABFBEF9C9FA1B65
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi ,
Get and set colors from any program is a common task (I suppose). I've
faced with a program where I need to collect several colors from a
WizardPage. Well, my first though was to check for any available class
to help me.
I've found the class ColorFieldEditor, wich was made originally to work
with preference pages. Despite this fact, the constructor receives a
Composite, and works perfectly inside a WizardPage.
The only problem is that I can't get the choosed RGB, because it fits
inside a private field called ColorSelector. There is no getter or
setter for this field (colorSelector) or even its value. The only
available methods are doLoad and doStore, that saves the information to
a preferences class.
Subclass does not work either, because the field is private. If I
redeclare the field in my subclass is not the solution as well, because
two fields exists (my field and the superclass field).
The only way was to copy the entire class and change it for my needs. If
the field colorSelector were declared protected, by the other hand, the
class could be usefull in other situations, and the field is still
protected from doubt access.
[]s
Glauco Reis
--------------A8612DF59ABFBEF9C9FA1B65
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi ,
<p>Get and set colors from any program is a common task (I suppose). I've
faced with a program where I need to collect several colors from a WizardPage.
Well, my first though was to check for any available class to help me.
<br>I've found the class <b>ColorFieldEditor</b>, wich was made originally
to work with preference pages. Despite this fact, the constructor receives
a Composite, and works perfectly inside a WizardPage.
<br>The only problem is that I can't get the choosed RGB, because it fits
inside a private field called ColorSelector. There is no getter or setter
for this field (colorSelector) or even its value. The only available methods
are doLoad and doStore, that saves the information to a preferences class.
<br>Subclass does not work either, because the field is private. If
I redeclare the field in my subclass is not the solution as well, because
two fields exists (my field and the superclass field).
<br>The only way was to copy the entire class and change it for my needs.
If the field colorSelector were declared protected, by the other hand,
the class could be usefull in other situations, and the field is still
protected from doubt access.
<p>[]s
<br>Glauco Reis
<br> </html>
--------------A8612DF59ABFBEF9C9FA1B65--
|
|
|
Powered by
FUDForum. Page generated in 0.03056 seconds