[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] Patch: MenuItem fix
From: |
Roman Kennke |
Subject: |
Re: [cp-patches] Patch: MenuItem fix |
Date: |
Tue, 01 Nov 2005 18:11:46 +0100 |
Hi Lillian,
Am Dienstag, den 01.11.2005, 10:10 -0500 schrieb Lillian Angel:
> > > public class BasicCheckBoxMenuItemUI extends BasicMenuItemUI
> > > {
> > >+
> > >+ /**
> > >+ * Creates a new BasicCheckBoxMenuItemUI object.
> > >+ */
> > >+ public BasicCheckBoxMenuItemUI()
> > >+ {
> > >+ super();
> > >+ UIDefaults defaults = UIManager.getLookAndFeelDefaults();
> > >+ checkIcon = UIManager.getIcon("CheckBoxMenuItem.checkIcon");
> > >+ }
> > >+
> >
> > You don't need the defaults variable here. Also I would think that the
> > checkIcon should actually be loaded by the BasicMenuItemUI via the
> > getPropertyPrefix method.
>
> I disagree. The prefix for BasicMenuItemUI is 'MenuItem'. The prefix for
> BasicCheckBoxMenuItemUI is 'CheckBoxMenuItem'. If I changed it so
> BasicMenuItemUI loads the checkIcon, the correct icon would not be
> loaded.
If you load it in BasicMenuItemUI, using the getPropertyPrefix() method,
you would load MenuItem.checkIcon in BasicMenuItemUI and
CheckBoxMenuItem.checkIcon in BasicCheckBoxMenuItemUI since
getPropertyPrefix is overridden in BasicCheckBoxMenuItemUI.
/Roman
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil